0
votes

I'm trying to install offline RabbitMQ on Oracle Linux 7 (cause by server machine not allow internet connection) Here is what I did :

  1. Download install package necessary and copy to server (erlang-22.3.4.12-1.el6.x86_64.rpm, socat-1.7.3.2-2.el7.aarch64.rpm, logrotate-3.8.6-19.el7.x86_64.rpm, rabbitmq-server-3.6.15-1.el7.noarch.rpm, rabbitmq-release-signing-key, firewalld-0.6.3-8.el7_8.1.noarch.rpm)
  2. Write a shell script to install offline as below :
yum repolist

#Install Erlang
sudo rpm -Uvh erlang-22.3.4.12-1.el6.x86_64.rpm
sudo yum install erlang
echo $(erl -version)

# Install socat
sudo yum install socat-1.7.3.2-2.el7.aarch64.rpm

#Install logrotate
sudo yum install logrotate-3.8.6-19.el7.x86_64.rpm

#Install RabbitMQ
sudo rpm --import rabbitmq-release-signing-key
sudo yum -y install rabbitmq-server-3.6.15-1.el7.noarch.rpm

# install firewall
sudo yum -y install firewalld-0.6.3-8.el7_8.1.noarch.rpm
sudo systemctl start firewalld
sudo systemctl enable firewalld

#config firewall
sudo firewall-cmd --zone=public --permanent --add-port=4369/tcp --add-port=25672/tcp --add-port=1521/tcp --add-port=5500/tcp --add-port=8080/tcp --add-port=5671-5672/tcp --add-port=15672/tcp  --add-port=61613-61614/tcp --add-port=1883/tcp --add-port=8883/tcp
sudo firewall-cmd --reload

# Start service
sudo systemctl start rabbitmq-server.service
sudo systemctl enable rabbitmq-server.service
sudo rabbitmq-plugins enable rabbitmq_management
sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

# add users
sudo rabbitmqctl add_user mqadmin mqadminpassword
sudo rabbitmqctl set_user_tags mqadmin administrator
sudo rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*"

RabbitMQ be installed on server but can not start Rabbit service. I got error

 * Could not contact node rabbit@ip-172-31-6-180.
   Changes will take effect at broker restart.
 * Options: --online  - fail if broker cannot be contacted.
            --offline - do not try to contact broker.
Error: unable to connect to node 'rabbit@ip-172-31-6-180': nodedown

DIAGNOSTICS
===========

attempted to contact: ['rabbit@ip-172-31-6-180']

rabbit@ip-172-31-6-180:
  * connected to epmd (port 4369) on ip-172-31-6-180
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on ip-172-31-6-180
  * suggestion: start the node

current node details:
- node name: 'rabbitmq-cli-72@ip-172-31-6-180'
- home dir: /var/lib/rabbitmq
- cookie hash: S2XLDmtwBa8t9RmQxEF3Xg==

Error: unable to connect to node 'rabbit@ip-172-31-6-180': nodedown

DIAGNOSTICS
===========

attempted to contact: ['rabbit@ip-172-31-6-180']

rabbit@ip-172-31-6-180:
  * connected to epmd (port 4369) on ip-172-31-6-180
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on ip-172-31-6-180
  * suggestion: start the node

current node details:
- node name: 'rabbitmq-cli-09@ip-172-31-6-180'
- home dir: /var/lib/rabbitmq
- cookie hash: S2XLDmtwBa8t9RmQxEF3Xg==

Error: unable to connect to node 'rabbit@ip-172-31-6-180': nodedown

DIAGNOSTICS
===========

attempted to contact: ['rabbit@ip-172-31-6-180']

rabbit@ip-172-31-6-180:
  * connected to epmd (port 4369) on ip-172-31-6-180
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on ip-172-31-6-180
  * suggestion: start the node

current node details:
- node name: 'rabbitmq-cli-74@ip-172-31-6-180'
- home dir: /var/lib/rabbitmq
- cookie hash: S2XLDmtwBa8t9RmQxEF3Xg==

And status of RabbitMQ service

   Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2020-11-04 02:07:45 UTC; 4s ago
  Process: 18953 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
 Main PID: 18953 (code=exited, status=1/FAILURE)

Nov 04 02:07:45 ip-172-31-6-180.ap-southeast-1.compute.internal systemd[1]: Failed to start RabbitMQ broker.
Nov 04 02:07:45 ip-172-31-6-180.ap-southeast-1.compute.internal systemd[1]: Unit rabbitmq-server.service entered failed state.
Nov 04 02:07:45 ip-172-31-6-180.ap-southeast-1.compute.internal systemd[1]: rabbitmq-server.service failed.

How can I fix this problems. Thanks

2

2 Answers

0
votes

I've figured out problems. It caused by not compatible between erlang and rabbitmq-server version. I check out and use compatiable version. The problems be resolved Thanks

0
votes

This seems to work for me.

  1. Downloaded the rpm.
  2. install rabbitmq-server-3.6.2-1.noarch.rpm
  3. rabbitmq-plugins enable rabbitmq_management
  4. rabbitmqctl add_user admin password
  5. rabbitmq-plugins enable rabbitmq_federation
  6. rabbitmq-plugins enable rabbitmq_federation_management
  7. systemctl restart rabbitmq-server
  8. chown -R root:rabbitmq /etc/rabbitmq