Setting up RabbitMQ server in Linux and setting up linuxrabbitmq

Source: Internet
Author: User

Setting up RabbitMQ server in Linux and setting up linuxrabbitmq
System Environment

Operating System: CentOS6.9

Erlang: OTP 19.3

Rabbitmq: rabbitmq-server 3.6.12 Installation Steps to install erlang

1. Install the pre-Environment

Install the following components using yum and run the following command:

[Root @ rabbitmqserver erlang] # yum-y install make gcc-c ++ kernel-devel m4 ncurses-devel openssl-devel


2. Download the source code file of erlang and decompress it.

Run the following command to decompress the package.

[Root @ rabbitmqserver softwares] # tar-xvf otp_src_19.3.tar.gz

Then, run the following command to rename the folder as erlang.

[Root @ rabbitmqserver softwares] # mv otp_src_19.3./erlang


3. Configure and install

First, check the compiling environment and configure the installation path. Run the following command:

[Root @ rabbitmqserver erlang] #./configure -- prefix =/usr/erlang -- without-javac

Then, make, compile the source code, and run the following command:

[Root @ rabbitmqserver erlang] # make

Finally, make install to start installation and run the following command:

[Root @ rabbitmqserver erlang] # make install


4. Set Environment Variables

Run the following command to edit the/etc/profile file.

[Root @ rabbitmqserver erlang] # vim/etc/profile

Append the following content at the end.

Save, and then run the following command to make the environment variable take effect immediately.

[Root @ rabbitmqserver erlang] # source/etc/profile


5. verify whether the installation is successful.

Run the following command to verify whether erlang is successfully installed.

[Root @ rabbitmqserver erlang] # erl


Install rabbitmq-server

1. download and install the rpm package

Run the following command to install the rpm package.

[Root @ rabbitmqserver softwares] # rpm-ivh rabbitmq-server-3.6.12-1.el6.noarch.rpm

You may encounter the following problems:

Solution:

Http://blog.csdn.net/yunfeng482/article/details/72853983


2. Set Environment Variables

Run the following command to edit the/etc/profile file.

[Root @ rabbitmqserver softwares] # vim/etc/profile

Append the following content at the end.

Save, and then run the following command to make the environment variable take effect immediately.

[Root @ rabbitmqserver erlang] # source/etc/profile


3. Enable Web Monitoring

First, run the following command to enable rabbitmq

[Root @ rabbitmqserver rabbitmq] # rabbitmq-server

After the process is canceled by ctrl + c, run the following command to enable web monitoring.

[Root @ rabbitmqserver rabbitmq] # rabbitmq-plugins enable rabbitmq_management


4. Start

After enabling web monitoring, we can officially start rabbitmq.

There are two methods to start rabbitmq.

The first method is to directly run the rabbitmq-server command.

However, once the terminal exits, the rabbitmq service is stopped, so this is not recommended.

The second method is to run the service rabbitmq-server xxx command.

Service rabbitmq-server start # start

Service rabbitmq-server stop # stop

Service rabbitmq-server restart # restart

Service rabbitmq-server status # view the status

Service rabbitmq-server etc # Check which commands can be used

Add rabbitmq-server to the auto-start service at startup and run the following command:

[Root @ rabbitmqserver bin] # chkconfig rabbitmq-server on

The best practice is the second method. Notes

1, rpm-ivh rabbitmq-server-3.6.12-1.el6.noarch.rpm reported the following error?

Error: Failed dependencies: erlang> = R16B-03 is needed by rabbitmq-server-3.6.6-1.el6.noarch socat is needed by rabbitmq-server-3.6.6-1.el6.noarch

Solution: http://blog.csdn.net/yunfeng482/article/details/72853983


2. Failed to start running service rabbitmq-server start, prompting '/usr/lib/rabbitmq/bin/rabbitmq-server: line 50: erl: command not found '?

Solution:

Because the environment variables are different, the corresponding commands cannot be found. Follow the instructions to connect the erl of erlang to the/usr/bin directory and run the following command.

[Root @ rabbitmqserver bin] # ln-s/usr/erlang/bin/erl/usr/bin/erl references

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.