ubuntu 12.04 安装rabbit-mq(erlang环境)



1、到官网https://www.erlang-solutions.com/downloads/download-erlang-otp下载最新的源码包。

2、清理一下Ubuntu安装前的环境.首先卸载已经安装的Erlang:

sudo apt-get remove erlang



3、在编译之前,先需要安装好编译需要的环境.

   libncurses5-dev

m4

libssl-dev

unixodbc

unixodbc-dev

libc6

freeglut3-dev

libwxgtk2.8-dev

xsltproc

fop

g++

build-essential



sudo apt-get install g++

sudo apt-get install build-essential libncurses5-dev m4 libssl-dev unixodbc unixodbc-dev libc6 freeglut3-dev libwxgtk2.8-dev xsltproc fop g++ build-essential




4、编译安装Erlang

tar zxvf otp_src_R15B01.tar.gz(解压下载好的Erlang源码文件)

cd otp_src_R15B01

sudo ./configure

sudo make

sudo make install



5、验证安装成功:终端内输入erl,出现如下信息

Erlang R15B03 (erts-5.9.3) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.3 (abort with ^G)

1>

6、如果安装不成功,一般是缺少依赖的库,可以尝试在新立得软件包管理器里一个个地手动安装上述清单里依赖的库,新立得会自动安装其他的相关依赖。



参考:http://blog.csdn.net/respawn/article/details/7506572

安装rabbitMQ





下载安装RabbitMQ-Server

下载rabbitmq-server_2.4.1-1_all.deb或rabbitmq-server_3.0.1-1_all.deb软件包

安装:dpkg �Ci rabbitmq-server_2.4.1-1_all.deb

dpkg �Cr 可以卸载相应都 .deb软件

另外这一步出现错误和以来问题可以先

sudo apt-get rabbitmq-server默认安装来解决一下以来问题在卸载这个默认应用商店2.。7.1版本

sudo apt-get remove rabbitmq-server

然后在dpkg �Ci rabbitmq-server_ooxx_all.deb
(有关dpkg安装软件的步骤和方法网上有很多)

默认安装在ubuntu操作系统的/etc/lib

----------------------------------------------------------

查找安装的rabbit-mq位置

sudo find / -name rabbitmq

[sudo] password for huangming:
/usr/lib/ocf/resource.d/rabbitmq
/usr/lib/rabbitmq
/run/rabbitmq
/etc/rabbitmq
/var/lib/rabbitmq
/var/log/rabbitmq


 -------------------------------------------------------------

ps -ef |grep rabbitmq
rabbitmq  1171     1  0 10:24 ?        00:00:00 /usr/local/lib/erlang/erts-5.9.1/bin/epmd -daemon
rabbitmq  1222     1  0 10:24 ?        00:00:00 /bin/sh /usr/sbin/rabbitmq-server
rabbitmq  1230  1222  0 10:24 ?        00:00:01 /usr/lib/erlang/erts-5.8.5/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.0.1/sbin/../ebin -noshell -noinput -s rabbit boot -sname rabbit@huangming-HP-431-Notebook-PC -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/[email protected]"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/[email protected]"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.0.1/sbin/../plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@huangming-HP-431-Notebook-PC-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@huangming-HP-431-Notebook-PC"
rabbitmq  1419  1230  0 10:24 ?        00:00:00 inet_gethost 4
rabbitmq  1420  1419  0 10:24 ?        00:00:00 inet_gethost 4
1000      5417  2331  0 10:53 pts/1    00:00:00 grep --color=auto rabbitmq

----------------------------------------------------------------------------------

cd /var/log/rabbitmq/

ls -al (察看日志生成日期为当前时间,已随系统启动)

察看到如下信息说明rabbit-mq已随本机服务正确启动

cat /var/log/rabbitmq/startup_log

+---+   +---+
|   |   |   |
|   |   |   |
|   |   |   |
|   +---+   +-------+
|                   |
| RabbitMQ  +---+   |
|           |   |   |
|   v3.0.1  +---+   |
|                   |
+-------------------+
AMQP 0-9-1 / 0-9 / 0-8
Copyright (C) 2007-2012 VMware, Inc.
Licensed under the MPL.  See http://www.rabbitmq.com/

node           : rabbit@huangming-HP-431-Notebook-PC
app descriptor : /usr/lib/rabbitmq/lib/rabbitmq_server-3.0.1/sbin/../ebin/rabbit.app
home dir       : /var/lib/rabbitmq
config file(s) : (none)
cookie hash    : m5tbBbUoIo+dMmcEgZyO7Q==
log            : /var/log/rabbitmq/[email protected]
sasl log       : /var/log/rabbitmq/[email protected]
database dir   : /var/lib/rabbitmq/mnesia/rabbit@huangming-HP-431-Notebook-PC
erlang version : 5.8.5

-- rabbit boot start
starting file handle cache server                                     ...done
starting worker pool                                                  ...done
starting database                                                     ...done
starting database sync                                                ...done
starting codec correctness check                                      ...done
-- external infrastructure ready
starting plugin registry                                              ...done
starting auth mechanism cr-demo                                       ...done
starting auth mechanism amqplain                                      ...done
starting auth mechanism plain                                         ...done
starting statistics event manager                                     ...done
starting logging server                                               ...done
starting exchange type direct                                         ...done
starting exchange type fanout                                         ...done
starting exchange type headers                                        ...done
starting exchange type topic                                          ...done
-- kernel ready
starting alarm handler                                                ...done
starting node monitor                                                 ...done
starting cluster delegate                                             ...done
starting guid generator                                               ...done
starting memory monitor                                               ...done
-- core initialized
starting empty DB check                                               ...done
starting HA policy validation                                         ...done
starting policy parameters                                            ...done
starting exchange, queue and binding recovery                         ...done
starting mirror queue slave sup                                       ...done
starting adding mirrors to queues                                     ...done
-- message delivery logic ready
starting error log relay                                              ...done
starting background garbage collection                                ...done
starting networking                                                   ...done
starting direct client                                                ...done
starting notify cluster nodes                                         ...done

broker running
 ----------------------------------------------------------------

使用rabbitmqctl控制台命令(位于/usr/lib/rabbitmq/bin>)来配置vhost,创建用户,密码,绑定权限

1.创建VHOST

sudo rabbitmqctl add_vhost csc_mq
Creating vhost "csc_mq" ...
...done.

2.删除VHOST

注:删除虚拟主机 rabbitmqctl delete_vhost vhostpath

3.列出VHOST LIST

sudo rabbitmqctl list_vhosts


Listing vhosts ...
/
csc_mq
...done.

4.添加用户和密码(用户名huangming, 密码:huangming)

sudo rabbitmqctl add_user huangming huangming


5.帮顶用户权限

sudo rabbitmqctl set_permissions -p csc_mq huangming ".*" ".*" ".*"


Setting permissions for user "huangming" in vhost "csc_mq" ...
...done.

6.列出用户权限:

sudo rabbitmqctl list_user_permissions huangming  

//注:清除用户权限 rabbitmqctl clear_permissions [-p vhostpath] username
  Listing permissions for user "huangming" ...
  csc_mq    .*    .*    .*
  ...done.
现在
完成了单机上rabbitmq的环境配置.

----------------------------------------------------------------------

安装Rabbit-mq Management Plugin

一下内容来自官网:http://previous.rabbitmq.com/management.html

The rabbitmq-management plugin provides an HTTP-based API for management and monitoring of your RabbitMQ server

Screenshots

http://previous.rabbitmq.com/img/management/overview.png

nstallation

The management plugin is included in the RabbitMQ           distribution.  To enable it, use rabbitmq-plugins:


sudo rabbitmq-plugins enable rabbitmq_management
[sudo] password for huangming:
The following plugins have been enabled:
 mochiweb
 webmachine
 rabbitmq_mochiweb
 amqp_client
 rabbitmq_management_agent
 rabbitmq_management
Plugin configuration has changed. Restart RabbitMQ for changes to take effect.

访问地址:

http://localhost:15672/

  • The web UI is located at:             http://server-name:55672/mgmt/

  • The HTTP API and its documentation are both located at:             http://server-name:55672/api/ (or view             our             latest HTTP API documentation here).

  • Download rabbitmqadmin             at: http://server-name:55672/cli/

To use the web UI you will need to authenticate as a           RabbitMQ user (on a fresh installation the user "guest" is           created with password "guest"). From here you can manage           exchanges, queues, bindings, virtual hosts, users and           permissions. Hopefully the UI is fairly self-explanatory.


插件

//常用rabbit插件

使用rabbitmq-plugins来管理插件

//开启基于http 的管理插件

1.rabbitmq-plugins enable rabbitmq_management

2.打开http://server-name:15672/

默认初始管理员用户为user:guest,psw:guest

若没有用户或用户权限不够,可用命令行手动创建用户:rabbitmqctl add_user 并指定管理权限 rabbitmqctl set_user_tags


其他插件相关详细:http://www.rabbitmq.com/plugins.html


另外rabbitmq提供了一个api和rabbitmqadmin脚本管理:

http的api:http://192.168.144.157:15672/api/

rabbitmqadmin脚本下载:http://localhost:15672/cli/

1. rabbitmq-plugins:(web控制台插件)

a) sudo rabbitmq-plugins enable rabbitmq_management

b) sudo rabbitmqctl stop

c) sudo rabbitmq-server �Cdetached

2. rabbitmqadmin:(rabbitmqadmin命令行插件)

a) wget http://hg.rabbitmq.com/rabbitmq-management/raw-file/rabbitmq_v3_2_1/bin/rabbitmqadmin

b) sudo cp rabbitmqadmin /usr/local/bin

c) cd /usr/local/bin

d) sudo chmod 777 rabbitmqadmin


该脚本提供了一个命令行方式来操作web方式都有的管理功能。详情参见http://www.rabbitmq.com/management-cli.html


--------------------------------------------------------------------

使用JAVA端:

JAVA CLIENTS开发相关:http://previous.rabbitmq.com/devtools.html

3.0.1API地址:http://www.rabbitmq.com/releases/rabbitmq-java-client/v3.0.1/rabbitmq-java-client-javadoc-3.0.1/

API操作指引:http://previous.rabbitmq.com/api-guide.html


使用NET端

http://www.cnblogs.com/daizhj/archive/2010/10/21/1857374.html

http://www.cnblogs.com/daizhj/archive/2010/10/21/1857403.html

你可能感兴趣的:(安装,ubuntu)