centos6 installed RabbitMQ

A mounting step Notes environment

The first step to install erlang environment 
Step install RabbitMQ

Second, the installation environment erlang

1) install the compiler environment, and basic dependencies

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

2) Download erlang, unzip the file

http: // erlang.org/download/otp_src_18.3.tar.gz 
tar xvf otp_src_18. 3 .tar.gz 
cd otp_src_18. 3

3) compile and install

./configure \
--prefix=/usr/local/erlang \
--with-ssl -enable-threads \
-enable-smmp-support \
-enable-kernel-poll \
--enable-hipe \
--without-javac

make && make install

4) configuration environment variable

Vim / etc / Profile 
# file, add the following code at the end ' ERLANG_HOME ' is equal to the previous step ' --prefix ' directory specified 
ERLANG_HOME = / usr / local / Erlang 
the PATH = $ ERLANG_HOME / bin: $ the PATH 
Export ERLANG_HOME 
Export the PATH 

# make the environment variables to take effect 
Source / etc / Profile

5) detects whether the installation is successful

[root@web01 ~]# erl
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.3  (abort with ^G)
1> 
erl

Third, install RabbitMQ

1) Download and unzip RabbitMQ

Official Download HTTP: // www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix-3.6.1.tar.xz 
# decompression rabbitmq, official to the package is a compressed package xz , it is necessary to use the command xz 
xz -d RabbitMQ-Server-Generic-unix- 3.6 . . 1 .tar.xz 

obtained after #xz .tar packet decompression, and then extract the tar command 
tar -xvf RabbitMQ-Server-Generic-unix- 3.6 . 1 .tar

2) to move to the individual installation directory

-rf ./rabbitmq_server- cp 3.6 . 1 / usr / local / 
cd / usr / local / 

# Edit folder name 
mv rabbitmq_server - 3.6 . 1 rabbitmq- 3.6 . 1

3) open the administration page plug-in

cd ./rabbitmq-3.6.1/sbin/
./rabbitmq-plugins enable rabbitmq_management

4) command to start

# Start command, the command ctrl + c When will shut down the service 
. / Rabbitmq- Server 

# start Rabbit in the background 
. / Rabbitmq-Server - detached 

# close the service 
. / Rabbitmqctl STOP 

# close the service (kill) found rabbitmq services pid [not recommended ] 
PS -ef | grep RabbitMQ 
the kill - 9 ****

View port

[root@web01 ~]# netstat -lntup|grep beam
tcp        0      0 0.0.0.0:15672               0.0.0.0:*                   LISTEN      67085/beam          
tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN      67085/beam          
tcp        0      0 :::5672                     :::*                        LISTEN      67085/beam 

http://192.168.10.111:15672/

5) Add User

# Into the RabbitMQ installation directory 
cd / usr / local / rabbitmq- 3.6 . 1 / sbin 

# add users 
#rabbitmqctl add_user the Username Password 
. / Rabbitmqctl add_user rabbitadmin 123456 

# assign users Label 
#rabbitmqctl set_user_tags the User Tag 
# [Administrator]: Administrator labels 
. / rabbitmqctl set_user_tags rabbitadmin administrator

6) Test Connection

 

7) authorized users, so that other programs can operate them

[root@mysql sbin]# ./rabbitmqctl set_permissions -p / rabbitadmin ".*" ".*" ".*"
View Code

 Fourth, the view has not been received in the message queue

1) Check the Message Queue command line

 Analog transmit data using python

 ./rabbitmqctl list_queues

[root@mysql sbin]# ./rabbitmqctl list_queues
Listing queues ...
hello    1
[root@mysql sbin]# ./rabbitmqctl list_queues
Listing queues ...
hello    2
[root@mysql sbin]# 

2) the new message using a web interface, and not view the received message

 

Guess you like

Origin www.cnblogs.com/linu/p/10192302.html