35 lines
1.0 KiB
Bash
35 lines
1.0 KiB
Bash
#!/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
|