AMQP server: RabbitMQ
Requirements
- PostgreSQL + Python
sudo apt-get install postgresql python3 sudo apt-get install python3-amqplib
Repository
[source: http://www.rabbitmq.com/install-debian.html]
- Add rabbitMQ repository
sudo vim /etc/apt/sources.list
deb http://www.rabbitmq.com/debian/ testing main
--- !!! Even the name is "testing" it's actually the latest stable version
--- They use "testing" as this is not in the "main" distro repo yet.
- Add repo key
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc sudo apt-key add rabbitmq-signing-key-public.asc
- Update package list
sudo apt-get update
RabbitMQ installation
- server installation
sudo apt-get install rabbitmq-server amqp-tools
Enable plugins
- Start server
service rabbitmq-server start
- enable command line client
rabbitmq-plugins enable amqp_client
- Enable web console
rabbitmq-plugins enable rabbitmq_management
- restart rabbit rabbitmq-server service
service rabbitmq-server restart
Default ports: Web console: 15672 AMQP Messages: 5672
User creation
- add admin user
rabbitmqctl add_user rtd
- set user rights
rabbitmqctl set_user_tags rtd administrator rabbitmqctl set_permissions -p / rtd ".*" ".*" ".*"
- Remove default admin user
rabbitmqctl delete_user guest
- restart service
service rabbitmq-server restart
Change port
[source: https://www.rabbitmq.com/configure.html]
- if activeMq is install, stop it
service activemq stop
sudo vim /etc/rabbitmq/rabbitmq-env.conf
- Add the following at the beggining of the file
NODE_PORT=5673
- restart services
service rabbitmq-server restart service activemq start
Firewall
- open firewall ports
vi /etc/init.d/firewall
- add this rules
- rabbitMq
$IPT -A INPUT -p tcp --dport 15672 -j ACCEPT $IPT -A INPUT -p tcp --dport 5673 -j ACCEPT
- Output
DO NOT FILTER OUTPUT since RabbitMQ port is dynamic. :(
Update startup
cd /etc/init.d/ update-rc.d rabbitmq-server defaults
Sources: https://www.rabbitmq.com/management-cli.html https://www.rabbitmq.com/configure.html https://www.rabbitmq.com/tutorials/tutorial-two-python.html