rabbitmq cannot start after change config file - rabbitmq

rabbitmq runs well, but cannot start after I change its config file according to the official doc.
I install openstack on opensuse13.2, following this doc:
http://docs.openstack.org/juno/install-guide/install/zypper/content/index.html
When reaching at 'Messaging server' section of 'Chapter 2. Basic environment`':
http://docs.openstack.org/juno/install-guide/install/zypper/content/ch_basic_environment.html#basics-messaging-server
Right here,some quote of this doc:
3. For RabbitMQ version 3.3.0 or newer, you must enable remote access for the guest account.
Check the RabbitMQ version:
A. # rabbitmqctl status | grep rabbit
Status of node 'rabbit#controller' ...
{running_applications,[{rabbit,"RabbitMQ","3.4.2"},
B. If necessary, edit the /etc/rabbitmq/rabbitmq.config file and configure loopback_users to reference an empty list:
[{rabbit, [{loopback_users, []}]}].
C. Restart the message broker service:
On openSUSE:
# systemctl restart rabbitmq-server.service
And I proceed like this:
a. controller:~ # rabbitmqctl status | grep rabbit
Status of node rabbit#controller ...
{running_applications,[{rabbit,"RabbitMQ","3.3.5"},
b.change config file:/etc/rabbitmq/rabbitmq.config,i.e. uncomment this line
%% {loopback_users, []},
c.controller:~ # systemctl start rabbitmq-server.service
Job for rabbitmq-server.service failed. See "systemctl status rabbitmq-server.service" and "journalctl -xn" for details.
d.controller:~ # systemctl status rabbitmq-server.service
rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled)
Active: failed (Result: exit-code) since 二 2015-04-14 14:27:59 CST; 30s ago
Process: 7387 ExecStopPost=/usr/bin/rm /var/run/rabbitmq/pid (code=exited, status=0/SUCCESS)
Process: 7345 ExecStop=/usr/sbin/rabbitmqctl stop (code=exited, status=2)
Process: 7219 ExecStartPost=/usr/sbin/rabbitmqctl wait /var/run/rabbitmq/pid (code=exited, status=2)
Process: 7218 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
Main PID: 7218 (code=exited, status=1/FAILURE)
4月 14 14:27:59 controller rabbitmqctl[7345]: attempted to contact: [rabbit#controller]
4月 14 14:27:59 controller rabbitmqctl[7345]: rabbit#controller:
4月 14 14:27:59 controller rabbitmqctl[7345]: * connected to epmd (port 4369) on controller
4月 14 14:27:59 controller rabbitmqctl[7345]: * epmd reports: node 'rabbit' not running at all
4月 14 14:27:59 controller rabbitmqctl[7345]: no other nodes on controller
4月 14 14:27:59 controller rabbitmqctl[7345]: * suggestion: start the node
4月 14 14:27:59 controller rabbitmqctl[7345]: current node details:
4月 14 14:27:59 controller rabbitmqctl[7345]: - node name: rabbitmqctl7354#controller
4月 14 14:27:59 controller rabbitmqctl[7345]: - home dir: /var/lib/rabbitmq
4月 14 14:27:59 controller rabbitmqctl[7345]: - cookie hash: kBnKPRMCXBnfQlB8kipSdA==

Related

How to restart redis server with authentication?

I am trying to restart a redis server using the following command:
service redis-server restart
And I am getting the error:
Failed to restart redis-server.service: Interactive authentication required.
See system logs and 'systemctl status redis-server.service' for details.
I know the redis password but I am not sure how to pass it in in the line of code that I mentioned.
The recommended logs are like this and not very helpful:
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-04-05 13:31:23 UTC; 12min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 358704 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)

Apache2 crash on boot, but not when started manually

I got a wired problem that I don't understand at all:
I have a home server with an Apache2 installation on Ubuntu 18.04. My problem is that Apache2 keeps crashing on system reboot.
systemctl status apache2 gives me:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Sat 2020-05-23 13:42:31 CEST; 3min 52s ago
Process: 1183 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 1224 (code=exited, status=1/FAILURE)
mai 23 13:42:30 potato-server systemd[1]: Starting The Apache HTTP Server...
mai 23 13:42:30 potato-server systemd[1]: Started The Apache HTTP Server.
mai 23 13:42:31 potato-server systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
mai 23 13:42:31 potato-server systemd[1]: apache2.service: Failed with result 'exit-code'.
What's super weird is that when I do a manual sudo systemctl start apache2, the server starts. And apache2ctl configtest gives me:
Syntax OK
Any idea of where the problem can come from?
I got some updates:
It seems that my bug is due to that fact I changed the group and user of Apache2 in /etc/apache2/envvar, according to this post: https://www.simplified.guide/apache/change-user-and-group
If I change back user and user group to www-data, it works again. However I would like to run Apache2 from an other user than www-data. Is this possible ?

How to use Rabbitmq to communicate with SSL?

I installed rabbitmq on Ubuntu and would like to communicate with ssl. There is no /etc/rabbitmq/rabbitmq.conf file, what should I write to the file when I create it myself? What are the operation steps?
I would suggest to follow the relevant docs TLS Support
thanks, I created the rabbitmq.conf file in the / etc / rabbitmq directory. I used https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/rabbitmq.conf.example inside the file. I wrote the certificates I created with TLS-GEN but failed when I restarted them. Error message:
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2019-10-25 06:51:01 PDT; 6s ago
Process: 73072 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=64)
Main PID: 73072 (code=exited, status=64)
Oct 25 06:51:01 ubuntu systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
Oct 25 06:51:01 ubuntu systemd[1]: Failed to start RabbitMQ broker.
Inside the RabbitMQ.conf file
listeners.tcp.local = 127.0.0.1:5672
listeners.ssl.default = 5671
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = false
ssl_options.cacertfile= /home/ekrem/tls-gen/basic/result/ca_certificate.pem
ssl_options.certfile= /home/ekrem/tls-gen/basic/result/server_certificate.pem
ssl_options.keyfile= /home/ekrem/tls-gen/basic/result/server_key.pem

Restoring rabbitmq-server database to a different host

Im running rabbitmq-server-3.6.6-1.el7.noarch on a CentOS 7.4.1708 server.
The /var/lib/ directory, on an ext4 lvm partition, had insufficient storage issues which required us to extend the lvm online, in order to make more space.
This seemed to fix the problems at the time, but a rabbitmq-server service restart was needed, which, when attempted, hung.
The service never started up anymore.
In order to get rabbitmq working again, the old mnesia directory was backed up, and a new one was created.
In order to recover the messages in the broken service, I have moved the old mnesia to a new server, added NODENAME=rabbit#oldserver to /etc/rabbitmq/rabbitmq-env.conf on the new server and tried to start it, but it keeps failing to start.
Please how can I start the old rabbitmq database on the new host?
[root#newserver]# cat /etc/rabbitmq/rabbitmq-env.conf
NODENAME=rabbit#oldserver
When I try to start the service on the new server:
[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}]}]}

Why not start rabbitmq-server?

Good evening. Faced with the problem: at some point the message broker "floating" (stopped updating the web interface and make the connection). When you try to restart rabbitmq-server start command process stops responding after the message output:
RabbitMQ 3.6.6. Copyright (C) 2007-2016 Pivotal Software, Inc.
Licensed under the MPL. See www.rabbitmq.com
Logs: /var/log/rabbitmq/rabbit#dbserver.log
/var/log/rabbitmq/rabbit#dbserver-sasl.log
Starting broker...
Prompt, as fixed a?
P.S. Command systemctl status rabbitmq-server.service printed:
● rabbitmq-server.service - RabbitMQ broker.
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2016-12-11 15:11:24 UTC; 15s ago
Process: 2872 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
Process: 2795 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=73)
Main PID: 2795 (code=exited, status=73)
Status: "Processing port mapping requests..."
Dec 11 15:11:24 dbserver rabbitmqctl[2872]: * epmd reports: node 'rabbit' not running at all
Dec 11 15:11:24 dbserver rabbitmqctl[2872]: no other nodes on dbserver
Dec 11 15:11:24 dbserver rabbitmqctl[2872]: * suggestion: start the node
Dec 11 15:11:24 dbserver rabbitmqctl[2872]: current node details:
Dec 11 15:11:24 dbserver rabbitmqctl[2872]: - node name: 'rabbitmq-cli-41#dbserver'
Dec 11 15:11:24 dbserver rabbitmqctl[2872]: - home dir: /var/lib/rabbitmq
Dec 11 15:11:24 dbserver rabbitmqctl[2872]: - cookie hash: /637Yxskpg6/iDHKRZfS8g==
Dec 11 15:11:24 dbserver systemd[1]: Failed to start RabbitMQ broker.
Dec 11 15:11:24 dbserver systemd[1]: rabbitmq-server.service: Unit entered failed state.
Dec 11 15:11:24 dbserver systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
Although I couldn't verify if exit code status=73 means exactly this, for me this issue turned out to be running out of disk space. If you check the rabbitmq logs (/var/log/rabbitmq/), it should give you more context if this is a different error.