RabbitMQ concept and environment setup (I) Single-node installation and configuration, and rabbitmq nodes
######################################## #######
# Asynchronous and distributed Message Processing Model
######################################## #######
Binding + ---------- ++ ---------------- +
/------------ + Queue + --- + consumer +
+ --------------- ++ ---------------- + | + ----------- ++ ---------------- +
+ Publisher + --- + exchange + --- |
+ --------------- ++ ---------------- + \ + ----------- ++ ---------------- +
----------- + Queue + --- + consumer +
Binding + ----------- ++ ---------------- +
######################################## ########
RabbitMQ Server Installation
######################################## ########
1. Install Erlang
Sudo yum install erlang
2. Install RabbitMQ Server
Import key first
Sudo rpm -- import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
You can save the content to the hosts file first. For example, rabbitmq-signing-key-public.asc.txt
Sudo rpm -- import rabbitmq-signing-key-public.asc.txt
3. Install rabbitmq-server-3.4.1-1.noarch.rpm
Sudo yum install rabbitmq-server-3.4.1-1.noarch.rpm
4. Start RabbitMQ Server
Register as a system service
Sudo chkconfig rabbitmq-server on
Start RabbitMQ Server
Sudo/etc/init. d rabbitmq-server stop/start/etc
Sudo service rabbitmq-server stop/start/etc
5. Check whether the port is occupied if startup fails.
4369 (epmd), 25672 (Erlang distribution)
5672,567 1 (AMQP 0-9-1 without and with TLS)
15672 (if management plugin is enabled)
61613,616 14 (if STOMP is enabled)
1883,888 3 (if MQTT is enabled)
Refer:
Http://www.rabbitmq.com/install-rpm.html
######################################## ##########
RabbitMQ Server Configuration
######################################## ##########
1. Configure through environment variables
You can directly configure it in Shell.
Or configure in rabbitmq-env.conf
2. Configure through the configuration file
Sudo cp/usr/share/doc/rabbitmq-server-3.4.1/rabbitmq. config. example/etc/rabbitmq. config
Sudo vim/etc/rabbitmq. config
Related File Location
For RPM/etc/rabbitmq/, such as/etc/rabbitmq. config,/etc/rabbitmq/rabbitmq-env.conf
3. runtime configuration
Refer:
Http://www.rabbitmq.com/configure.html
######################################## #########
# RabbitMQ logs, users, and clients
######################################## #########
1. Logs
Ls-l/var/log/rabbitmq
2. Default virtual host and Default user
Virtual host :/
User: guest
Passwd: guest
Note: by default, users can only connect to/on localhost and have full permissions.
3. RabbitMQ Client
Python client
Pika-0.9.14.tar.gz
Tar-xzvf pika-0.9.14.tar.gz
Cd pika-0.9.14
Sudo python27 setup. py install
JS client
Amqp. node