RABBITMQ is written in Erlang, so we need to install Erlang, install Erlang and install Python and Simplejson, so we'll start with Python:
1. Install Python:
[PHP]View Plaincopy
- #wget http://www.python.org/ftp/python/2.5.2/python-2.5.2.tar.bz2
- #tar-JXVF python-2.5.2.tar.bz2
- #cd Python-2.5.2
- #./configure
- #make && make Install
- Test: Enter python at the command line and the Python interpreter will indicate that it is installed correctly.
2, installation Simplejson:
[HTML]View Plaincopy
- #wget http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.9.tar.gz
- #tar ZXVF simplejson-2.0.9.tar.gz
- #cd simplejson-2.0.9
- #python setup.py Build
- #python setup.py Install
3. Installing Erlang
[HTML]View Plaincopy
- Install the following dependencies first, and don't ask why the installation is done by line or you're bitter.
- #yum-y install make GCC gcc-c++ kernel-devel M4 ncurses-devel Openssl-devel
- #yum install libx* java* tk unixODBC unixodbc-devel
- #yum-y Install Ncurses-devel
- #yum Install Ncurses-devel
- #yum-y Install Xmlto
- #wget http://www.erlang.org/download/otp_src_R13B04.tar.gz
- #mv otp_src_r16b02 erlang_r16b #重命名解压厚的文件
- #cd erlang_r16b/
- #./configure --prefix=/usr/local/erlang--with-ssl--enable-threads--enable-smp-support--enable-kernel-poll-- Enable-hipe--without-javac
- #make && make Install
- #vi/etc/profile
- Erl_home=/usr/local/erlang
- Path= $ERL _home/bin: $PATH
- Export Erl_home PATH
- #source/etc/profile
- Update environment variables
- Execute Erl, enter Erlang Shell to successfully install test if installation is successful, enter command Erl in console
4, Installation RabbitMQ
[PHP]View Plaincopy
- #yum Install NC (nc.x86_64)
- Cd/usr/local
- #wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.1/rabbitmq-server-3.1.1.tar.gz
- #cd rabbitmq-server-3.1.1
- #make
- #make Install TARGET_DIR=/OPT/MQ/RABBITMQ Sbin_dir=/opt/mq/rabbitmq/sbin Man_dir=/opt/mq/rabbitmq/man
- The latest package to add to other directories, forget what is the directory. Make install to see the error message. Compiling RABBITMQ into the/OPT/MQ/RABBITMQ directory
5. Install the Web plugin management interface
[PHP]View Plaincopy
- #cd/opt/mq/rabbitmq/sbin
- #mkdir/etc/rabbitmq/
- #rabbitmq-plugins Enable Rabbitmq_management
[PHP]View Plaincopy
- #./rabbitmq-server Start &
[PHP]View Plaincopy
- To start the RABBITMQ service:
- Foreground run: Rabbitmq-server start (after the user closes the connection, the process automatically ends)
[PHP]View Plaincopy
- Running in the background: rabbitmq-server-detached
6, good, to here RABBITMQ has been configured, you can start:
[HTML]View Plaincopy
- Let's look at the default listening port 5672 for RABBITMQ:
- #netstat-tnlp|grep 5672
- It is best that we can enter the http://ip:15672/login admin interface on the browser:
- The username and password used for login are counted as guest by default, and the following pages are logged in:
- Another machine accesses the RABBITMQ (just outside the machine) and needs to open port 15672
- #vi/etc/sysconfig/iptables to add the 15672 port in. Then restart service iptables restart
Http://www.oschina.net/news/66104/rabbitmq-3-5-5-rc2?utm_source=tuicool
RABBITMQ Common Commands
Rabbitmq-server Start or service rabbitmq-server start #启动rabbitmq
Rabbitmqctl list_exchanges
Rabbitmqctl list_bindings
Rabbitmqctl list_queues #分别查看当前系统种存在的Exchange和Exchange上绑定的Queue信息.
Rabbitmqctl Status #查看运行信息
Rabbitmqctl Stop #停止运行rabbitmq
Rabbitmq-plugins Enable Rabbitmq_management
#启动rabbitmq的图形管理界面, this operation must restart RABBITMQ, and then http://10.109.18.226:15672 the user name and password in the Web is guest guest. If the LAN cannot access the set firewall filtering rules or turn off the firewall.
RABBITMQ can be built as a cluster
Building Architecture:
A haproxy, reverse proxy RABBITMQ service node, RABBITMQ service only agent memory node, to ensure speed.
Web monitoring side Proxy disk node, all nodes are metadata are synchronized.
Basically you can guarantee that if not all the machines are down, the RABBITMQ service will not be down. Concrete construction See: Http://www.tuicool.com/articles/YbYvIj
Ubuntu Installation Rabbitmq-server