Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

amazon ec2 - Rabbitmq /usr/local/etc/rabbitmq/rabbitmq-env.conf Missing

I just installed RabbitMQ on an AWS EC2-Instance (CentOS) using the following,

sudo yum install erlang

sudo yum install rabbitmq-server

I was then able to successfully turn it on using,

sudo chkconfig rabbitmq-server on

sudo /sbin/service rabbitmq-server start

...and

sudo /sbin/service rabbitmq-server stop

sudo sudo rabbitmq-server run in foreground;

But now I'm trying to modify the /usr/local/etc/rabbitmq/rabbitmq-env.conf file so I can change the NODE_IP_ADDRESS but the file is no where to be found.

No rabbitmq folder under,

[ec2-user@ip-0-0-0-0 sbin]$ ls /usr/local/etc
[ec2-user@ip-0-0-0-0 sbin]$

There's a rabbitmq folder under /etc but there's nothing in it,

[ec2-user@ip-0-0-0-0 rabbitmq]$ pwd
/etc/rabbitmq
[ec2-user@ip-0-0-0-0 rabbitmq]$ ls
[ec2-user@ip-0-0-0-0 rabbitmq]$

And the only thing in my environment variables for rabbitmq is this

[ec2-user@ip-0-0-0-0 rabbitmq]$ printenv | grep rabbit
PWD=/etc/rabbitmq

I was able to go to the location of the rabbitmq logs and find this information,

root@ip-0-0-0-0
[/var/log/rabbitmq]# pwd
/var/log/rabbitmq
root@ip-0-0-0-0
[/var/log/rabbitmq]# ls -al
total 20
drwxr-x---  2 rabbitmq rabbitmq 4096 Jun  7 17:28 .
drwxr-xr-x 10 root     root     4096 Jun  7 17:23 ..
-rw-r--r--  1 rabbitmq rabbitmq 3638 Jun  7 17:33 [email protected]
-rw-r--r--  1 rabbitmq rabbitmq    0 Jun  7 17:25 [email protected]
-rw-r--r--  1 root     root        0 Jun  7 17:28 shutdown_err
-rw-r--r--  1 root     root       65 Jun  7 17:28 shutdown_log
-rw-r--r--  1 root     root        0 Jun  7 17:25 startup_err
-rw-r--r--  1 root     root      385 Jun  7 17:28 startup_log


cat [email protected]

=INFO REPORT==== 7-Jun-2018::17:29:01 ===
node           : rabbit@ip-0-0-0-0
home dir       : /var/lib/rabbitmq
config file(s) : (none)
cookie hash    : W/uaA12+PF+KOIbCmdKTkw==
log            : /var/log/rabbitmq/[email protected]
sasl log       : /var/log/rabbitmq/[email protected]
database dir   : /var/lib/rabbitmq/mnesia/rabbit@ip-0-0-0-0

And /var/lib/rabbitmq contains this,

[/var/lib/rabbitmq/mnesia]# cd /var/lib/rabbitmq/
root@ip-0-0-0-0
[/var/lib/rabbitmq]# ls
mnesia

And

[/var/lib/rabbitmq/mnesia]# pwd
/var/lib/rabbitmq/mnesia
root@ip-0-0-0-0
[/var/lib/rabbitmq/mnesia]# ls -al
total 20
drwxr-xr-x 4 rabbitmq rabbitmq 4096 Jun  7 17:29 .
drwxr-x--- 3 rabbitmq rabbitmq 4096 Jun  7 17:25 ..
drwxr-xr-x 4 rabbitmq rabbitmq 4096 Jun  7 17:35 rabbit@ip-0-0-0-0
-rw-r--r-- 1 rabbitmq rabbitmq    5 Jun  7 17:28 [email protected]
drwxr-xr-x 2 rabbitmq rabbitmq 4096 Jun  7 17:29 rabbit@ip-0-0-0-0-plugins-expand
root@ip-0-0-0-0

And,

[/var/lib/rabbitmq/mnesia/rabbit@ip-0-0-0-0]# pwd
/var/lib/rabbitmq/mnesia/rabbit@ip-0-0-0-0
root@ip-0-0-0-0
[/var/lib/rabbitmq/mnesia/rabbit@ip-0-0-0-0]# ls -al
total 100
drwxr-xr-x 4 rabbitmq rabbitmq  4096 Jun  7 17:35 .
drwxr-xr-x 4 rabbitmq rabbitmq  4096 Jun  7 17:29 ..
-rw-r--r-- 1 rabbitmq rabbitmq    59 Jun  7 17:29 cluster_nodes.config
-rw-r--r-- 1 rabbitmq rabbitmq   160 Jun  7 17:35 DECISION_TAB.LOG
-rw-r--r-- 1 rabbitmq rabbitmq    99 Jun  7 17:35 LATEST.LOG
drwxr-xr-x 2 rabbitmq rabbitmq  4096 Jun  7 17:29 msg_store_persistent
drwxr-xr-x 2 rabbitmq rabbitmq  4096 Jun  7 17:29 msg_store_transient
-rw-r--r-- 1 rabbitmq rabbitmq    29 Jun  7 17:29 nodes_running_at_shutdown
-rw-r--r-- 1 rabbitmq rabbitmq  1123 Jun  7 17:29 rabbit_durable_exchange.DCD
-rw-r--r-- 1 rabbitmq rabbitmq  2422 Jun  7 17:32 rabbit_durable_exchange.DCL
-rw-r--r-- 1 rabbitmq rabbitmq     8 Jun  7 17:25 rabbit_durable_queue.DCD
-rw-r--r-- 1 rabbitmq rabbitmq     8 Jun  7 17:25 rabbit_durable_route.DCD
-rw-r--r-- 1 rabbitmq rabbitmq     8 Jun  7 17:25 rabbit_runtime_parameters.DCD
-rw-r--r-- 1 rabbitmq rabbitmq     3 Jun  7 17:29 rabbit_serial
-rw-r--r-- 1 rabbitmq rabbitmq   344 Jun  7 17:35 rabbit_user.DCD
-rw-r--r-- 1 rabbitmq rabbitmq   193 Jun  7 17:29 rabbit_user_permission.DCD
-rw-r--r-- 1 rabbitmq rabbitmq   461 Jun  7 17:35 rabbit_user_permission.DCL
-rw-r--r-- 1 rabbitmq rabbitmq   134 Jun  7 17:29 rabbit_vhost.DCD
-rw-r--r-- 1 rabbitmq rabbitmq   289 Jun  7 17:32 rabbit_vhost.DCL
-rw-r--r-- 1 rabbitmq rabbitmq 19108 Jun  7 17:25 schema.DAT
-rw-r--r-- 1 rabbitmq rabbitmq   233 Jun  7 17:25 schema_version

And last but not least apparently the logs say there isn't a config file,

[/var/log/rabbitmq]# cat [email protected] | grep config
config file(s) : (none)
config file(s) : (none)

RabbitMQ Version: {rabbit,"RabbitMQ","3.1.5"}

Does anyone know what's going on here? I'm surprised I didn't see any errors when I started the rabbitmq-server. Do I just create the config files myself?

UPDATE:

I was setting up a cluster environment for my Apache Airflow and so I was configuring it with the CeleryExecutor and setting up the Queue to be RabbitMQ. Turns out I'm running my EC2-Instance with Amazon Linux 1 which doesn't include systemd so I wasn't able to get RabbitMQ properly installed. Had I made my server using Amazon Linux 2 or Ubuntu, or any other Linux that doesn't suck I could have potentially gotten further in installing RabbitMQ and getting it to work with Airflow. So I went on to using AWS SQS for my queue and then I ran into this error. So by now I've wasted over two and a half days trying to just get a queue to work with Celery and Airflow and I read this article which says that Airbnb (the creators of Airflow) are using Celery with Redis as their Queue. So I tried it out and it literally took me three minutes to do and it's working flawlessly.... All I did was download Redis using sudo yum install redis then bam I had Redis installed. I started Redis using redis-server. Then I changed my airflow.cfg broker_url field to broker_url = redis://, ran airflow initdb, restarted the scheduler airflow scheduler, then started a worker airflow worker and BAM my DAGs started running using the Redis queue and CeleryExecutor. HALLELUJAH just use Redis as your queue....

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.


You should be using the latest version of RabbitMQ (3.7.5) and Erlang 19.3 or later. Version 3.1.5 is very, very, very old. Please see this document for instructions on how to install a recent RMQ on an rpm-based distro.

After that, you will create rabbitmq-env.conf yourself.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...