Установка RabbitMQ + расширение к php

yum install epel-release erlang librabbitmq-devel
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
yum install https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_5_4/rabbitmq-server-3.5.4-1.noarch.rpm

cat > /etc/rabbitmq/rabbitmq-env.conf << EOF
export RABBITMQ_NODENAME=rabbit@localhost
export RABBITMQ_NODE_IP_ADDRESS=127.0.0.1
export ERL_EPMD_ADDRESS=127.0.0.1
EOF

/usr/local/bin/pecl install amqp
echo "extension=amqp.so" > /usr/local/etc/php-fpm.d/amqp.ini

# Разрешим FQDN для hostname
echo "export RABBITMQ_USE_LONGNAME=true" >> /etc/rabbitmq/rabbitmq-env.conf

service rabbitmq-server restart

rabbitmq-plugins enable --offline rabbitmq_priority_queue
rabbitmq-plugins enable --offline rabbitmq_management

# создадим пользователя user с паролем pass
rabbitmqctl add_user user pass
rabbitmqctl set_user_tags user administrator
rabbitmqctl set_permissions -p / user ".*" ".*" ".*"

В браузере будет доступен по адресу:
http://<ip_хоста>:15672/
Логин-пароль: user / pass

Если вдруг отказывается стартовать, прибьем:

rm -rf /var/lib/rabbitmq/*

Comments powered by CComment

Designed by san © 2018