How to Install RabbitMQ Server and Erlang on Linux
Link: https://bbs.huaweicloud.com/blogs/367934
【Abstract】 RabbitMQ is an open source message queue server that you can use to build your messaging applications. In simple terms, you can put messages into a queue from one application and retrieve messages from the queue of the same application or a different application. You can use a variety of programming languages to connect to RabbitMQ, create and retrieve messages.
RabbitMQ is an open source message queue server that you can use to build your messaging applications. In simple terms, you can put messages into a queue from one application and retrieve messages from the queue of the same application or a different application. You can use a variety of programming languages to connect to RabbitMQ, create and retrieve messages.
Installing Erlang
For RabbitMQ to work properly, you need to have Erlang installed on your system.
The current stable version of Erlang is R16B, which can be downloaded from the Erlang website.
cd /usr/save
wget http://www.erlang.org/download/otp_src_R16B.tar.gz
tar xvfz /usr/save/otp_src_R16B.tar.gz
After downloading Erlang, install the Erlang R16B version from source as shown below.
cd otp_src_R16B
LANG=C; export LANG
./configure
make
make install
Verifying Erlang
Now, when you type erl from the command line, you should get the Erlang Shell as shown below. This indicates that you have successfully installed Erlang.
# erl
Erlang R16B (erts-5.10.1) [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.1 (abort with ^G)
1>
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
(v)ersion (k)ill (D)b-tables (d)istribution
a
Download RabbitMQ
The current stable version of RabbitMQ server is 3.0.4. When you visit the RabbitMQ website, you will see versions available for download for the following Linux platforms: 1) Debian / Ubuntu 2) Fedora / RHEL 3) Generic Unix 4) Solaris
In this example, I selected RabbitMQ for Generic Unix.
cd /usr/save
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.0.4/rabbitmq-server-generic-unix-3.0.4.tar.gz
tar xvfz rabbitmq-server-generic-unix-3.0.4.tar.gz
cd rabbitmq_server-3.0.4
Start the RabbitMQ server
Start the RabbitMQ server by passing the -detached option as shown below.
# cd /usr/save/rabbitmq_server-3.0.4
# sbin/rabbitmq-server -detached
Warning: PID file not written; -detached was passed.
If you receive the could_not_start_tcp_listener error message when starting the RabbitMQ server, see the Troubleshooting section below for solutions on how to resolve this issue.
Verify RabbitMQ status
Use the rabbitmqctl command to verify the status of the RabbitMQ server and stop it if necessary.
# sbin/rabbitmqctl status
Status of node 'rabbit@db-dev' ...
[{pid,30069},
{running_applications,[{rabbit,"RabbitMQ","3.0.4"},
{mnesia,"MNESIA CXC 138 12","4.8"},
{os_mon,"CPO CXC 138 46","2.2.11"},
{sasl,"SASL CXC 138 11","2.3.1"},
{stdlib,"ERTS CXC 138 10","1.19.1"},
{kernel,"ERTS CXC 138 10","2.16.1"}]},
{os,{unix,linux}},
{erlang_version,"Erlang R16B (erts-5.10.1) [source] [smp:4:4] [async-threads:30] [hipe] [kernel-poll:true]\n"},
{memory,[{total,15087368},
{connection_procs,1432},
{queue_procs,2864},
{plugins,0},
{other_proc,4748681},
{mnesia,30672},
{mgmt_db,0},
{msg_index,8652},
{other_ets,369668},
{binary,5976},
{code,6973062},
{atom,387397},
{other_system,2558964}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,1699810508},
{disk_free_limit,1000000000},
{disk_free,913096704},
{file_descriptors,[{total_limit,924},
{total_used,3},
{sockets_limit,829},
{sockets_used,1}]},
{processes,[{limit,1048576},{used,124}]},
{run_queue,0},
{uptime,6}]
...done.
To stop the RabbitMQ server, use the rabbitmqctl command as shown below.
# sbin/rabbitmqctl stop
troubleshooting
Problem: On CentOS 6, if you installed rabbitmq using yum, or from source as described above, and if you receive a "BOOT FAILED { could_not_start_tcp_listener ,{“::”,5672}}" message, you may have a port conflict.
Solution: The Matahari package installed by default on CentOS 6 also runs on port 5672. This process is started by default. Try stopping qpidd (Qpid AMQP daemon) to see if it solves the problem. You can also uninstall matahari, matahari-broker, qpid-cpp-server-ssl and qpid-cpp-server packages if Matahari is not needed.
Stop the qpidd daemon and disable it from system startup using the chkconfig command.
# chkconfig --list | grep -i qpid
qpidd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# service qpidd stop
Stopping Qpid AMQP daemon: [ OK ]
# chkconfig qpidd off
# chkconfig --list | grep -i qpid
qpidd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Now if you start the RabbitMQ server it should work.
Autumn
The recruitment has already begun. If you are not well prepared,
Autumn
It's hard to find a good job.
Here is a big employment gift package for everyone. You can prepare for the spring recruitment and find a good job!