Janet: Looking at the IT architecture in the Big Data Era (3) rabbitmq-installation, configuration and monitoring of Message Queuing
First, installation
1. Installing Erlang1) System compilation Environment (Linux/unix environment is used here)① Installation Environment
Virtual machine: vmware®workstation 10.0.1 Build
Linux system: CentOS6.5
RABBITMQ official website Download:http://www.rabbitmq.com/download.html
Er Lang's official website download: http://www.erlang.org/download.html  
2) RABBITMQ required Ancillary packages (Erlang, simplejson) Installation: ① installing Erlang
RABBITMQ is based on Erlang, so you must first configure the Erlang environment.
Download the latest Erlang installation package from Erlang's official website http://www.erlang.org/download.html , the version i downloaded is otp_src_R14B03.tar.gz.
And then:
- Then unzip the downloaded GZ package tar zxcf *.tar.gz
- CD into the extracted folder
- Execute ./configure--prefix=/opt/erlang will start compiling the installation will be compiled to/opt/erlang and executed
- Make and make install
- After the compilation is complete, enter /opt/erlangand the erl test Erlang is installed successfully.
- Modify the /etc/profile file to add the following environment variables:
- #set Erlang Environment
- Export path= $PATH:/opt/erlang/bin
- Source profile makes the file effective
- Ken will be able to find the case of the package can not be found, directly yum install it!
after installing Erlang, start loading rabbitmq-server, the main reference Official document:http://www.rabbitmq.com/build-server.html ; ② Installing Simplejson (if you need to install a Python version )
A newer version of Python needs to be installed. Easy to install .
Need to install Simplejson. Download the latest version from here: http://pypi.python.org/pypi/simplejson#downloads . The version i downloaded is simplejson-2.2.1.tar.gz
2, installation RABBITMQthen install RABBITMQ Server. Download the source code version of RABBITMQ: http://www.rabbitmq.com/server.htmlfrom here. The version i downloaded is rabbitmq-server-generic-unix-2.7.1.tar.gz
- There are many versions of RABBITMQ installed, and we use the Generic UNIX version.
- CD/
- wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.7.1/rabbitmq-server-generic-unix-2.7.1.tar.gz Download RABBITMQ
- Tar zxvf rabbitmq-server-generic-unix-2.7.1.tar.gz-c/opt unzip to the specified folder
- Cd/opt, establishing a soft link ln-s rabbitmq-server-generic-unix rabbitmq
- CD Rabbitmq/sbin,./rabbitmq-server-detached to enable background startup
- modifying /etc/profile, adding environment variables
- #set RABBITMQ Environment
- Export path= $PATH:/opt/rabbitmq/sbin
- Source profile makes the file effective
- Cd/opt/rabbitmq/sbin,./rabbitmqctl stop close rabbitmq
- This completes the installation
This will make the installation successful.
3. Trial run
- Enable Admin mode (manage MQ with Web page) cd/opt/rabbitmq/sbin/
- Execute./rabbitmq-plugin Enable Rabbitmq-management
- Then visit http://localhost:55672
Second, the configuration
Main references official documents:http://www.rabbitmq.com/configure.html
In general, the default configuration for RABBITMQ is sufficient. If you want a special setting, there are two ways:
- One is the environment variable configuration file rabbitmq-env.conf;
- A configuration file that is configuration information rabbitmq.config;
Note that these two files are not by default and must be created yourself if necessary.
Rabbitmq-env.conf
The location of this file is deterministic and immutable, located in:/etc/rabbitmq directory (this directory needs to be created by itself).
- The contents of the file include some of the environment variables of RABBITMQ, commonly used are:
- #RABBITMQ_NODE_PORT =//Port number
- #HOSTNAME =
- Rabbitmq_nodename=mq
- rabbitmq_config_file=//path of the configuration file
- Rabbitmq_mnesia_base=/rabbitmq/data//path of the MNESIA database to be used
- Rabbitmq_log_base=/rabbitmq/log//log's Path
- Rabbitmq_plugins_dir=/rabbitmq/plugins//plug-in Path
For a specific list, see:http://www.rabbitmq.com/configure.html#define-environment-variables
Rabbitmq.config
This is a standard Erlang configuration file. It must conform to the standards of the Erlang profile.
It has both a default directory and can be configured in the rabbitmq-env.conf file.
The contents of the file are described in:http://www.rabbitmq.com/configure.html#config-items
third, monitoring
Main references official documents:http://www.rabbitmq.com/management.html
RABBITMQ provides a web-based monitoring page system that is invoked in a plugin manner.
First, configure the location of the plugins directory in rabbitmq-env.conf: Rabbitmq_config_file
Download the plugin required for the monitoring page to the plugins directory, which includes the following plugin:
- Mochiweb
- Webmachine
- Rabbitmq_mochiweb
- Amqp_client
- Rabbitmq_management_agent
- Rabbitmq_management
Download path is located at:http://www.rabbitmq.com/plugins.html#rabbitmq_management
Restart the RABBITMQ and enter the http://server-name:55672/mgmt/to access the monitoring page. The default user name and password are: Guest and guest.
Janet: Looking at the IT architecture in the Big Data Era (3) rabbitmq-installation, configuration, and monitoring of Message Queuing