rabbitmq-server fails to start after hostname has changed for first time

后端 未结 13 1991
予麋鹿
予麋鹿 2021-02-01 12:43

I am using django-celery for my django project. Last day I have changed my computer\'s hostname (I am using Ubuntu 12.04, edited file \'/etc/hostname\'), and after next restart

相关标签:
13条回答
  • 2021-02-01 13:05

    The only solution which work for me: install erlang & rabbitmq from deb, so:

    First remove:

    apt-get purge rabbitmq-server
    apt-get purge erlang
    apt-get autoremove
    reboot
    

    After install wget:

    sudo apt-get -y install socat logrotate init-system-helpers adduser
    sudo apt-get -y install wget
    

    Install erlang:

    wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
    sudo dpkg -i erlang-solutions_1.0_all.deb
    sudo apt-get update
    sudo apt-get install erlang
    

    Install rabbitmq:

    sudo apt-get update
    wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.17/rabbitmq-server_3.7.17-1_all.deb
    sudo dpkg -i rabbitmq-server_3.7.17-1_all.deb
    rm rabbitmq-server_3.7.17-1_all.deb
    
    0 讨论(0)
  • 2021-02-01 13:06

    Thanks to Richard H Fung.

    His steps helped me to solve this issue.

    But I did not have to re-install the rabbitmq.

    When I opened my /etc/hosts file I found that IP assigned to my hostname is different than the actual ip(192.168.1.200 [static]).

    #/etc/hosts  
    127.0.0.1       localhost  
    192.168.1.115   HOSTNAME
    

    so I just changed IP address to 192.168.1.200 in my /etc/hosts file and it worked fine.

    0 讨论(0)
  • 2021-02-01 13:06

    In my case I did not have a following entry in /etc/hosts:

    127.0.0.1 <hostname>
    

    where <hostname> is the hostname of my machine (as given by the hostname command). After adding that line, RabbitMQ started successfully. I did not have any earlier installations of RabbitMQ.

    0 讨论(0)
  • 2021-02-01 13:06

    I had the same problem and doing the steps Richard H Fung provided didn't helped me. I also had to uninstall these packages: erlang erlang-epmd rabbitmq-server

    zypper remove erlang erlang-epmd rabbitmq-server
    rm -rf /var/lib/rabbitmq/*
    zypper install erlang erlang-epmd rabbitmq-server
    systemctl enable rabbitmq-server.service
    systemctl start rabbitmq-server.service
    

    If you have another OS than openSUSE just use your package manager to remove these packages (e.g. apt-get)

    0 讨论(0)
  • 2021-02-01 13:09

    Remove RabbitMQ database: rm -rf /var/lib/rabbitmq/*

    This action solves the problem. I believe somewhere in dumps stored a record with correspondence of nodes host names and ips. This fact causes contradiction if some hosts changed unexpectedly.

    0 讨论(0)
  • 2021-02-01 13:09

    To solve this problem, I changed my /etc/hostname file with the new hostname then restarted the machine. After that, I ran rm -rf /var/lib/rabbitmq/mnesia/*

    Then restarted the service : sudo service rabbitmq-server restart

    At this point, it worked for me. If it still don't work, modify the file /etc/rabbitmq/rabbitmq-env.conf by adding those informations :

    NODENAME=rabbit@YOUR_NEW_HOSTNAME
    NODE_IP_ADDRESS=127.0.0.1
    NODE_PORT=5672
    

    Then restart the service : sudo service rabbitmq-server restart

    Hope it helps.

    0 讨论(0)
提交回复
热议问题