Centos 6.8安装erlang&rabbitmq的方法
1. 安装 erlang1.1 准备工作,先安装依赖库和应用工具yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel rsync perl-net-snmp wx fop net-snmp unixODBC unixODBC-devel vim make lrzsz bc sysstat lsof wget xz1.2 下载erlang源码wget http://www.erlang.org/download/otp_src_20.0.tar.gz
cd /root/nht
tar zxvf otp_src_20.0.tar.gz1.3 编译安装cd otp_src_20.0
./configure --prefix=/usr/local/erlang --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac //不用java编译,故去掉java避免错误 make && make install //编译后安装 1.4 配置环境变量vi /etc/profile ERL_HOME=/usr/local/erlang export PATH=$ERL_HOME/bin:$PATH 2 安装rabbitmq2.1 下载
Cd /root/nht
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10.tar.xzxz -d rabbitmq-server-3.6.10.tar.xztar xvf rabbitmq-server-3.6.10.tar2.2 安装依赖库yum -y install xmlto否则会编译不通过:/bin/sh: line 1: xmlto: command not found2.3 编译cd rabbitmq-server-3.6.10
编辑Makefile,修改如下:
makemake install TARGET_DIR=/usr/local/rabbitmq-server SBIN_DIR=/usr/local/rabbitmq/sbin MAN_DIR=/usr/local/rabbitmq/man
//将rabbitmq编译到/usr/local/rabbitmq-server目录2.4 安装web插件管理界面cd /usr/local/rabbitmq/sbinmkdir /etc/rabbitmq/./rabbitmq-plugins enable rabbitmq_management查看插件列表./rabbitmq-plugins list2.5 常用命令启动rabbitmq./rabbitmq-server -detached
使用命令添加用户并授权
一、添加配置文件
在/etc/rabbitmq/rabbitmq.config配置文件下(如果不存在就自行创建)
添加用户
./rabbitmqctl add_user admin zhxg@2017!
设置permissions
./rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
设置用户角色
./rabbitmqctl set_user_tags admin administrator
查看新添加的admin
./rabbitmqctl list_users
删除用户:
./rabbitmqctl delete_user admin在浏览器上输入http://192.168.185.72:15672/登录管理界面了使用登录的名户名和密码默认都算admin/xxxxxx!
关闭rabbitmq./rabbitmqctl stop