Difference between revisions of "OpenStack: Install RabbitMQ Message Broker"
Jump to navigation
Jump to search
(Created page with "== Install RabbitMQ Server == <syntaxhighlight> yum -y install rabbitmq-server systemctl start rabbitmq-server </syntaxhighlight> == User Management == <syntaxhighlight> rabbitmqctl delete_user guest rabbitm...") |
|||
| Line 23: | Line 23: | ||
touch index.txt | touch index.txt | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
<syntaxhighlight> | <syntaxhighlight> | ||
wget -P /etc/rabbitmq/testca/ http://classroom.example.com/materials/openssl.cnf | wget -P /etc/rabbitmq/testca/ http://classroom.example.com/materials/openssl.cnf | ||
| + | </syntaxhighlight> | ||
| − | + | <syntaxhighlight> | |
| − | + | openssl req -x509 -config openssl.cnf -newkey rsa:2048 -days 365 -out cacert.pem -outform PEM -subj /CN=MyTestCA/ -nodes | |
| − | + | openssl x509 -in cacert.pem -out cacert.cer -outform DER | |
| − | + | </syntaxhighlight> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | <syntaxhighlight> | ||
| + | mkdir -p /etc/rabbitmq/server | ||
| + | cd /etc/rabbitmq/server | ||
| + | openssl genrsa -out key.pem 2048 | ||
| + | openssl req -new -key key.pem -out req.pem -outform PEM -subj /CN=$(hostname)/O=server= -nodes | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | mkdir -p /etc/rabbitmq/client | ||
| + | cd /etc/rabbitmq/client | ||
| + | openssl genrsa -out key.pem 2048 | ||
| + | openssl req -new -key key.pem -out req.pem -outform PEM -subj /CN=$(hostname)/O=client/ -nodes | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | cd ../testca/ | ||
| + | openssl ca -config openssl.cnf -in ../server/req.pem -out ../server/cert.pem -notext -batch -extensions client_ca_extensions | ||
| + | cd ../server | ||
| + | openssl pkcs12 -export -out keycert.p12 -in cert.pem -inkey key.pem -passout pass:MySecretPassword | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | cd ../testca/ | ||
| + | openssl ca -config openssl.cnf -in ../client/req.pem -out ../client/cert.pem -notext -batch -extensions client_ca_extensions | ||
| + | cd ../client/ | ||
| + | openssl pkcs12 -export -out keycert.p12 -in cert.pem -inkey key.pem -passout pass:MySecretPassword | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | cd | ||
| + | wget -P /etc/rabbitmq/ http://classroom.example.com/materials/rabbitmq.config | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | firewall-cmd --add-port=5672/tcp --permanent | ||
| + | firewall-cmd --add-port=5671/tcp --permanent | ||
| + | firewall-cmd --reload | ||
| + | systemctl restart rabbitmq-server | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | [root@server2-a ~]# netstat -nlp | grep 567 | ||
| + | tcp6 0 0 :::5671 :::* LISTEN 2745/beam.smp | ||
| + | tcp6 0 0 :::5672 :::* LISTEN 2745/beam.smp | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | systemctl enable rabbitmq-server | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 08:45, 28 April 2015
Install RabbitMQ Server
yum -y install rabbitmq-server
systemctl start rabbitmq-serverUser Management
rabbitmqctl delete_user guest
rabbitmqctl add_user rabbitmqauth redhat
rabbitmqctl set_permissions rabbitmqauth ".*" ".*" ".*"
rabbitmqctl set_user_tags rabbitmqauth administrator
rabbitmqctl list_usersSSL Certificate Stuff
mkdir /etc/rabbitmq/testca
cd /etc/rabbitmq/testca
mkdir certs private
chmod 700 private
echo 01 > serial
touch index.txtwget -P /etc/rabbitmq/testca/ http://classroom.example.com/materials/openssl.cnfopenssl req -x509 -config openssl.cnf -newkey rsa:2048 -days 365 -out cacert.pem -outform PEM -subj /CN=MyTestCA/ -nodes
openssl x509 -in cacert.pem -out cacert.cer -outform DERmkdir -p /etc/rabbitmq/server
cd /etc/rabbitmq/server
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out req.pem -outform PEM -subj /CN=$(hostname)/O=server= -nodesmkdir -p /etc/rabbitmq/client
cd /etc/rabbitmq/client
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out req.pem -outform PEM -subj /CN=$(hostname)/O=client/ -nodescd ../testca/
openssl ca -config openssl.cnf -in ../server/req.pem -out ../server/cert.pem -notext -batch -extensions client_ca_extensions
cd ../server
openssl pkcs12 -export -out keycert.p12 -in cert.pem -inkey key.pem -passout pass:MySecretPasswordcd ../testca/
openssl ca -config openssl.cnf -in ../client/req.pem -out ../client/cert.pem -notext -batch -extensions client_ca_extensions
cd ../client/
openssl pkcs12 -export -out keycert.p12 -in cert.pem -inkey key.pem -passout pass:MySecretPasswordcd
wget -P /etc/rabbitmq/ http://classroom.example.com/materials/rabbitmq.configfirewall-cmd --add-port=5672/tcp --permanent
firewall-cmd --add-port=5671/tcp --permanent
firewall-cmd --reload
systemctl restart rabbitmq-server[root@server2-a ~]# netstat -nlp | grep 567
tcp6 0 0 :::5671 :::* LISTEN 2745/beam.smp
tcp6 0 0 :::5672 :::* LISTEN 2745/beam.smpsystemctl enable rabbitmq-server