这次装Rabbitmq真实一波三折,linux版本 erlang版本以及Rabbitmq的匹配弄的问题层出,写下来希望帮助碰上困难的你。
软件准备:
以下均在centos6.5环境下进行操作:
erlang包:otp_src_19.1.tar.gz
rabbit包: rabbitmq-server-generic-unix-3.6.14.tar.xz
百度盘提供链接:https://pan.baidu.com/s/1n_1ATH794CQhqkFz7cTY7g 提取码:i3ye
安装erlang:
上传: otp_src_19.1.tar.gz 到/opt
解压: tar -zxvf otp_src_19.1.tar.gz
创建文件夹: mkdir /usr/local/erlang
移动解压的erlang: mv ./otp_src_19.1 /usr/local/erlang
erlang需要的环境安装:
[root@localhost usr]# yum install ncurses ncurses-base ncurses-devel ncurses-libs ncurses-static ncurses-term ocaml-curses ocaml-curses-devel -y
[root@localhost usr]# yum install openssl-devel zlib-devel –y
[root@localhost usr]# yum -y install make ncurses-devel gcc gcc-c++ unixODBC unixODBC-devel openssl openssl-devel
[root@localhost home]# cd /home/lmy/opt
[root@localhost opt]# ls
otp_src_20.0 otp_src_20.0.tar.gz
[root@localhost opt]# cd otp_src_20.0
[root@localhost otp_src_20.0]# ./configure --prefix=/opt/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac
make:
[root@localhost otp_src_20.0]# make&&make install
到make这一步需要大约10分钟左右。。。
配置环境变量:
vi /etc/profile
增加:
ERLANG_HOME=opt/erlang
PATH=$ERLANG_HOME/bin:$PATH
export ERLANG_HOME
export PATH
rabbitmq安装:
yum -y install xz
[root@localhost opt]# xz -d rabbitmq-server-generic-unix-3.6.10.tar.xz
[root@localhost opt]# tar -xvf rabbitmq-server-generic-unix-3.6.10.tar
[root@localhost opt]# mv rabbitmq_server-3.6.10 /opt/
启动:
[root@localhost opt]# cd /opt/rabbitmq_server-3.6.10/
[root@localhost rabbitmq_server-3.6.10]# cd sbin
[root@localhost sbin]# ./rabbitmq-server
RabbitMQ 3.6.10. Copyright (C) 2007-2017 Pivotal Software, Inc.
## ## Licensed under the MPL. See http://www.rabbitmq.com/
## ##
########## Logs: /opt/rabbitmq_server-3.6.10/var/log/rabbitmq/rabbit@localhost.log
###### ## /opt/rabbitmq_server-3.6.10/var/log/rabbitmq/rabbit@localhost-sasl.log
##########
Starting broker...
completed with 0 plugins.
常用命令:
直接启动 ./rabbitmq-server
后台启动 ./rabbitmq-server -detached
开启插件管理页面 ./rabbitmq-plugins enable rabbitmq_management
关闭服务 ./rabbitmqctl stop
管理页面:
创建用户root 密码111111
[root@localhost sbin]# ./rabbitmqctl add_user root 111111
Creating user "root"
[root@localhost sbin]# ./rabbitmqctl set_user_tags root administrator
Setting tags for user "root" to [administrator]
[root@localhost sbin]#
[root@localhost sbin]# ./rabbitmqctl set_permissions -p / root ".*" ".*" ".*"
Setting permissions for user "root" in vhost "/"
开启管理平台:
./rabbitmq-plugins enable rabbitmq_management
访问管理平台页面:
http://localhost:15672/#/
注意:如果页面无法访问,看防火墙是否关闭
来源:oschina
链接:https://my.oschina.net/u/3391192/blog/4262432