Task: Add rabbitmq server setup script for ubuntu 20

This commit is contained in:
Sambo Chea 2021-08-09 09:34:23 +07:00
parent 67e29d34bc
commit 77cf7b25bb

34
rabbitmq-setup.sh Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash -e
sudo apt install apt-transport-https -y
wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add -
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
echo "deb https://dl.bintray.com/rabbitmq-erlang/debian focal erlang-22.x" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
sudo apt install rabbitmq-server -y
sudo systemctl enable rabbitmq-server.service
sudo systemctl is-enabled rabbitmq-server.service
# Enable Management and WebMQTT
sudo rabbitmq-plugins enable rabbitmq_management
sudo rabbitmq-plugins enable rabbitmq_web_mqtt
: '
loopback_users.guest = false
listeners.tcp.default = 5672
management.tcp.port = 15672
mqtt.default_user = demo
mqtt.default_pass = demo
mqtt.vhost = /
mqtt.exchange = amq.topic
# 24 hours by default
mqtt.subscription_ttl = 86400000
mqtt.prefetch = 10
'
# sudo nano /etc/rabbitmq/rabbitmq.conf
sudo systemctl restart rabbitmq-server.service
sudo systemctl status rabbitmq-server.service