RabbitMQ service installation and configuration in CentOS7

Source: Internet
Author: User

RabbitMQ service installation and configuration in CentOS7

RabbitMQ is a popular open-source Message Queue System and is a standard implementation of AMQP (Advanced Message Queuing Protocol Advanced Message Queue Protocol). It is developed in erlang language. RabbitMQ is said to have good performance and timeliness. It also supports cluster and load deployment and is very suitable for use in large-scale distributed systems. The specific features are still being verified, to be tested. As required by the project, RabbitMQ is installed and configured, and the server operating system is CentOS7. The procedure is as follows:

Install the dependency file:

Yum install gcc glibc-devel make ncurses-devel openssl-devel xmlto

1. Erlang installation Configuration

Download the installation package at http://www.erlang.org/downloads. I chose otp_src_18.3.tar.gz.

Decompress the file:

[Root @ iZ25e3bt9a6Z rabbitmq] # tar-xzvf otp_src_18.3.tar.gz
[Root @ iZ25e3bt9a6Z rabbitmq] # cd otp_src_18.3/

Configure the installation path to compile the Code:

[Root @ iZ25e3bt9a6Z otp_src_18.3] #./configure -- prefix =/opt/erlang

Execute the compilation result:

[Root @ iZ25e3bt9a6Z otp_src_18.3] # make & make install

After the execution is complete, go to/opt/erlang to view the execution result.

[Root @ iZ25e3bt9a6Z rabbitmq] # cd/opt/erlang/
[Root @ iZ25e3bt9a6Z erlang] # erl
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp: 8: 8] [async-threads: 10] [hipe] [kernel-poll: false]

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

If the preceding information is displayed, the installation is complete. Enter 'halt (). 'to exit.

Then, add the following environment variables in the configuration of the Erlang environment variable vi/etc/profile file:

# Set erlang environment
Export PATH = $ PATH:/opt/erlang/bin


Source/etc/profile to make the file take effect

During Erlang installation, you may encounter the following problems, generally because the corresponding package is missing in the system. You can directly install yum without any package.

2. Download and install RabbitMq

[Root @ iZ25e3bt9a6Z rabbitmq] # weget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix-3.6.1.tar.xz

Decompress the file

[Root @ iZ25e3bt9a6Z rabbitmq] # xz-d rabbitmq-server-generic-unix-3.6.1.tar.xz
[Root @ iZ25e3bt9a6Z rabbitmq] # tar-xvf rabbitmq-server-generic-unix-3.6.1.tar-C/opt

Decompress the package and enter the folder/opt to find more folder rabbitmq-server-generic-unix-3.6.1, rename it rabbitmq for memory.

Then, add the following environment variable in the configuration of the rabbitmq environment variable vi/etc/profile file:

# Set rabbitmq environment
Export PATH = $ PATH:/opt/rabbitmq/sbin

Source/etc/profile to make the file take effect

3. Close RabbitMQ Service Startup

The above has already completed the installation of RabbitMq. How can I start the service?

Start the service:

[Root @ iZ25e3bt9a6Z rabbitmq] # cd sbin/
[Root @ iZ25e3bt9a6Z sbin] #./rabbitmq-server-detached

View service status:

[Root @ iZ25e3bt9a6Z sbin] #./rabbitmqctl status
Status of node rabbit @ iZ25e3bt9a6Z...
[{Pid, 11849 },
{Running_applications,
[{Rabbitmq_management, "RabbitMQ Management Console", "3.6.1 "},
{Rabbitmq_management_agent, "RabbitMQ Management Agent", "3.6.1 "},
{Rabbitmq_web_dispatch, "RabbitMQ Web Dispatcher", "3.6.1 "},
{Webmachine, "webmachine", "1.10.3 "},
{Amqp_client, "RabbitMQ AMQP Client", "3.6.1 "},
{Mochiweb, "MochiMedia Web Server", "2.8.0 "},
{Syntax_tools, "Syntax tools", "1.7 "},
{Ssl, "Erlang/otp ssl application", "7.3 "},
{Public_key, "Public key infrastructure", "1.1.1 "},
{Asn1, "The Erlang ASN1 compiler version 4.0.2", "4.0.2 "},
{Crypto, "CRYPTO", "3.6.3 "},
{Compiler, "erts cxc 138 10", "6.0.3 "},
{Inets, "inets cxc 138 49", "6.2 "},
{Rabbit, "RabbitMQ", "3.6.1 "},
{Mnesia, "mnesia cxc 138 12", "4.13.3 "},
{Rabbit_common, [], "3.6.1 "},
{Xmerl, "XML parser", "1.3.10 "},
{OS _mon, "CPO CXC 138 46", "2.4 "},
{Ranch, "Socket acceptor pool for TCP protocols.", "1.2.1 "},
{Sasl, "sasl cxc 138 11", "2.7 "},
{Stdlib, "erts cxc 138 10", "2.8 "},
{Kernel, "erts cxc 138 10", "4.2"}]},
{OS, {unix, linux }},
{Erlang_version,
"Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp: 8: 8] [async-threads: 64] [hipe] [kernel-poll: true] \ n "},
{Memory,
[{Total, 64111264 },
{Connection_readers, 0 },
{Connection_writers, 0 },
{Connection_channels, 0 },
{Connection_other, 2808 },
{Queue_procs, 2808 },
{Queue_slave_procs, 0 },
{Plugins, 367288 },
{Other_proc, 19041296 },
{Mnesia, 61720 },
{Mgmt_db, 158696 },
{Msg_index, 47120 },
{Other_ets, 1372440 },
{Binary, 128216 },
{Code, 27368230 },
{Atom, 992409 },
{Other_system, 14568233}]},
{Alarms, []},
{Listeners, [{clustering, 25672, ":" },{ amqp, 5672, ":"}]},
{Vm_memory_high_watermark, 0.4 },
{Vm_memory_limit, 6556241100 },
{Disk_free_limit, 50000000 },
{Disk_free, 37431123968 },
{File_descriptors,
[{Total_limit, 65435 },
{Total_used, 2 },
{Sockets_limit, 58889 },
{Sockets_used, 0}]},
{Processes, [{limit, 1048576}, {used, 204}]},
{Run_queue, 0 },
{Uptime, 412681 },
{Kernel, {net_ticktime, 60}]

Close the service:

[Root @ iZ25e3bt9a6Z sbin] #./rabbitmqctl stop
Stopping and halting node rabbit @ iZ25e3bt9a6Z...

4. Configure the webpage plug-in

Create a directory first; otherwise, an error may be reported:

Mkdir/etc/rabbitmq


Then enable the plug-in:

./Rabbitmq-plugins enable rabbitmq_management

Configure linux port 15672 Web Page Management port 5672 AMQP
Access http: // localhost: 15672.

Default User guest password guest

5. Remote Access Configuration

By default, webpage access is not allowed. You need to add a user to modify the permission. The Code is as follows:

Add User: rabbitmqctl add_user hxb

Add permission: rabbitmqctl set_permissions-p "/" hxb ".*"".*"".*"

Modify user role rabbitmqctl set_user_tags hxb administrator

Then you can remotely access the service and configure user permissions.

  

6. Common rabbitmq commands

Add_user <UserName> <Password>

Delete_user <UserName>

Change_password <UserName> <NewPassword>

List_users

Add_vhost <VHostPath>

Delete_vhost <VHostPath>

List_vhostsset_permissions [-p <VHostPath>] <UserName> <Regexp>

Clear_permissions [-p <VHostPath>] <UserName>

List_permissions [-p <VHostPath>]

List_user_permissions <UserName>

List_queues [-p <VHostPath>] [<QueueInfoItem>...]

List_exchanges [-p <VHostPath>] [<ExchangeInfoItem>...]

List_bindings [-p <VHostPath>]

List_connections [<ConnectionInfoItem>...]

Install RabbitMQ in CentOS 5.6

Detailed installation record of RabbitMQ client C ++

Try RabbitMQ in Python

Deployment of production instances in the RabbitMQ Cluster Environment

Use PHP + RabbitMQ in Ubuntu

Process of installing RabbitMQ on CentOS

RabbitMQ concept and Environment Construction

RabbitMQ getting started

RabbitMQ details: click here
RabbitMQ: click here

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.