将rabbitmq-server数据库还原到其他主机

时间:2018-05-07 11:37:00

标签: rabbitmq centos7

我在CentOS 7.4.1708服务器上运行rabbitmq-server-3.6.6-1.el7.noarch。 ext4 lvm分区上的/ var / lib /目录存储问题不足,需要我们在线扩展lvm,以便腾出更多空间。

这似乎解决了当时的问题,但需要重启rabbitmq-server服务,当尝试挂起时。 该服务从未启动过。 为了让rabbitmq再次运行,我们备份了旧的mnesia目录,并创建了一个新目录。

为了恢复破损服务中的消息,我已将旧的mnesia移动到新服务器,在新服务器上添加NODENAME=rabbit@oldserver/etc/rabbitmq/rabbitmq-env.conf并尝试启动它,但它保持不变未能开始。

请问如何在新主机上启动旧的rabbitmq数据库?

    [root@newserver]# cat /etc/rabbitmq/rabbitmq-env.conf 
    NODENAME=rabbit@oldserver

当我尝试在新服务器上启动服务时:

    [root@newserver rabbitmq]# systemctl status rabbitmq-server.service -l
    ? rabbitmq-server.service - RabbitMQ broker
       Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Mon 2018-05-07 16:25:23 WAT; 1h 32min ago
      Process: 6484 ExecStop=/usr/sbin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
      Process: 5997 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
     Main PID: 5997 (code=exited, status=1/FAILURE)
       Status: "Exited."

    May 07 16:25:23 newserver.dom.local rabbitmqctl[6484]: * epmd reports: node 'rabbit' not running at all
    May 07 16:25:23 newserver.dom.local rabbitmqctl[6484]: other nodes on oldserver: ['rabbitmq-cli-20']
    May 07 16:25:23 newserver.dom.local rabbitmqctl[6484]: * suggestion: start the node
    May 07 16:25:23 newserver.dom.local rabbitmqctl[6484]: current node details:
    May 07 16:25:23 newserver.dom.local rabbitmqctl[6484]: - node name: 'rabbitmq-cli-20@newserver'
    May 07 16:25:23 newserver.dom.local rabbitmqctl[6484]: - home dir: .
    May 07 16:25:23 newserver.dom.local rabbitmqctl[6484]: - cookie hash: edMXQlaNlKXH72ZvAXFhbw==
    May 07 16:25:23 newserver.dom.local systemd[1]: Failed to start RabbitMQ broker.
    May 07 16:25:23 newserver.dom.local systemd[1]: Unit rabbitmq-server.service entered failed state.
    May 07 16:25:23 newserver.dom.local systemd[1]: rabbitmq-server.service failed.


    =ERROR REPORT==== 7-May-2018::16:16:43 ===
    ** Generic server <0.145.0> terminating
    ** Last message in was {'$gen_cast',
                               {submit_async,
                                   #Fun<rabbit_queue_index.32.103862237>}}
    ** When Server state == undefined
    ** Reason for termination == 
    ** {function_clause,
           [{rabbit_queue_index,parse_segment_entries,
                [<<1,23,0,255,54,241,95,251,201,20,69,202,0,0,0,0,0,0,0,0,0,0,0,
                   240,0,0,1,176,131,104,6,100,0,13,98,97,115,105,99,95,109,101,
                   115,115,97,103,101,104,4,100,0,8,114,101,115,111,117,114,99,101,
                   109,0,0,0,8,47,98,105,108,108,105,110,103,100,0,8,101,120,99,
                   104,97,110,103,101,109,0,0,0,7,98,105,108,108,105,110,103,108,0,
                   0,0,1,109,0,0,0,13,98,105,108,108,105,110,103,95,113,117,101,
                   117,101,106,104,6,100,0,7,99,111,110,116,101,110,116,97,60,100,
                   0,4,110,111,110,101,109,0,0,0,7,48,0,0,0,0,0,2,100,0,25,114,97,
                   98,98,105,116,95,102,114,97,109,105,110,103,95,97,109,113,112,
                   95,48,95,57,95,49,108,0,0,0,1,109,0,0,0,240,123,34,115,104,111,
                   114,116,67,111,100,101,34,58,34,52,50,54,95,109,101,110,117,115,
                   34,44,34,116,105,109,101,115,116,97,109,112,34,58,34,50,48,49,
                   56,45,48,52,45,49,56,84,49,48,58,53,57,58,50,55,46,57,51,53,90,
                   34,44,34,109,115,105,115,100,110,34,58,34,50,51,52,57,48,57,51,
                   52,52,57,50,57,51,34,44,34,105,100,34,58,34,50,55,50,49,56,95,
                   50,51,52,57,48,57,51,52,52,57,50,57,51,95,49,53,50,52,48,52,57,
                   48,52>>,
            ------snip-------goes-on-forever----

                                  100,0,4,116,114,117,101>>},
                            no_del,no_ack},
                           undefined,undefined,undefined,undefined,undefined,
                           undefined,undefined,undefined},
                          10,10,10,10},
                         100,100,100,100,100},
                        1000,1000,1000,1000,1000,1000,1000},
                       10000,10000,10000,10000,10000,10000,10000,10000,10000}},
                  8988}],
                [{file,"src/rabbit_queue_index.erl"},{line,1067}]},
            {rabbit_queue_index,'-recover_journal/1-fun-0-',1,
                [{file,"src/rabbit_queue_index.erl"},{line,863}]},
            {lists,map,2,[{file,"lists.erl"},{line,1224}]},
            {rabbit_queue_index,segment_map,2,
                [{file,"src/rabbit_queue_index.erl"},{line,989}]},
            {rabbit_queue_index,recover_journal,1,
                [{file,"src/rabbit_queue_index.erl"},{line,856}]},
            {rabbit_queue_index,scan_segments,3,
                [{file,"src/rabbit_queue_index.erl"},{line,676}]},
            {rabbit_queue_index,queue_index_walker_reader,2,
                [{file,"src/rabbit_queue_index.erl"},{line,664}]},
            {rabbit_queue_index,'-queue_index_walker/1-fun-0-',2,
                [{file,"src/rabbit_queue_index.erl"},{line,645}]}]}

0 个答案:

没有答案