AMQP server: RabbitMQ

Revision as of 14:47, 11 July 2014 by WikiFreak (talk | contribs) (Created page with " ----------------------------- Requirements ----------------------------- # PostgreSQL + Python sudo apt-get install postgresql python3 sudo apt-get install python3-amqplib ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Requirements


  1. PostgreSQL + Python

sudo apt-get install postgresql python3 sudo apt-get install python3-amqplib


Repository


[source: http://www.rabbitmq.com/install-debian.html]

  1. 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.


  1. Add repo key

wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc sudo apt-key add rabbitmq-signing-key-public.asc

  1. Update package list

sudo apt-get update



RabbitMQ installation


  1. server installation

sudo apt-get install rabbitmq-server amqp-tools



Enable plugins


  1. Start server

service rabbitmq-server start

  1. enable command line client

rabbitmq-plugins enable amqp_client

  1. Enable web console

rabbitmq-plugins enable rabbitmq_management

  1. restart rabbit rabbitmq-server service

service rabbitmq-server restart

Default ports: Web console: 15672 AMQP Messages: 5672



User creation


    1. add admin user

rabbitmqctl add_user rtd

  1. set user rights

rabbitmqctl set_user_tags rtd administrator rabbitmqctl set_permissions -p / rtd ".*" ".*" ".*"

  1. Remove default admin user

rabbitmqctl delete_user guest

  1. restart service

service rabbitmq-server restart


Change port


[source: https://www.rabbitmq.com/configure.html]

  1. if activeMq is install, stop it

service activemq stop

sudo vim /etc/rabbitmq/rabbitmq-env.conf

  1. Add the following at the beggining of the file

NODE_PORT=5673

  1. restart services

service rabbitmq-server restart service activemq start



Firewall


  1. open firewall ports

vi /etc/init.d/firewall

  1. add this rules
  2. rabbitMq

$IPT -A INPUT -p tcp --dport 15672 -j ACCEPT $IPT -A INPUT -p tcp --dport 5673 -j ACCEPT


  1. 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