RabbitMQlinux-centos环境配置

^_^的我 5月前 ⋅ 562 阅读

安装erlang

yum install -y  openssl openssl-devel  ncurses-devel
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
#源码安装
wget http://erlang.org/download/otp_src_22.2.tar.gz
tar -zxvf otp_src_22.2.tar.gz
.configure --prefix=/usr/local/erlang --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac
make && make install

安装RabbitMQ

vim /etc/yum.repos.d/rabbitmq.repo

#写入以下内容
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/7/
gpgcheck=0
repo_gpgcheck=0
enabled=1

yum clean all
yum makecache
yum install rabbitmq-server-3.8.3-1.el7.noarch.rpm

配置RabbitMQ

#设置自启
chkconfig rabbitmq-server on
#启动
/sbin/service rabbitmq-server start
#停止
/sbin/service rabbitmq-server stop

#开启rabbitmq: 
rabbitmqctl start_app

#开启管理插件:
rabbitmq-plugins enable rabbitmq_management
#查看插件集合:
rabbitmq-plugins list
#创建账号
  rabbitmqctl add_user rabbitmq 123456
#设置用户角色
  rabbitmqctl  set_user_tags  rabbitmq administrator
#设置用户权限
  rabbitmqctl set_permissions -p "/" rabbitmq ".*" ".*" ".*"
#设置完成后可以查看当前用户和角色(需要开启服务)
  rabbitmqctl list_users

全部评论: 0

    我有话说: