系统版本:CentOS 6.6 x64
软件包:
rabbitmq-server-generic-unix-3.6.5.tar
otp_src_R16B03.tar.gz
安装必要软件:
# yum -y install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel tk tc
添加环境变量:
# tail -3 /etc/profile export PATH=$PATH:/usr/local/erlang/bin RABBITMQ_HOME=/usr/local/rabbitmq export PATH=$PATH:$RABBITMQ_HOME/sbin # source /etc/profile
RabbitMQ是由Erlang语言开发,因此要先安装Erlang:
# pwd /opt/software # tar -zxvf otp_src_R16B03.tar.gz # cd otp_src_R16B03 # vim /opt/software/otp_src_R16B03/lib/crypto/c_src/crypto.c
在第80行位置添加&& !defined(OPENSSL_NO_EC2M),如图1。
图1
# mkdir -p /usr/local/product/erlang # ./configure --prefix=/usr/local/product/erlang
图2
# ln -s /usr/local/product/erlang/ /usr/local/erlang # make # make install
接下来开始安装RabbitMQ:
# mkdir /usr/local/product/rabbitmq_server-3.6.5 # cd /opt/software # tar -xvf rabbitmq-server-generic-unix-3.6.5.tar -C /usr/local/product/rabbitmq_server-3.6.5 # ln -s /usr/local/product/rabbitmq_server-3.6.5/rabbitmq_server-3.6.5 /usr/local/rabbitmq
--启动RabbitMQ # rabbitmq-server -d & [1] 41593 # RabbitMQ 3.6.5. Copyright (C) 2007-2016 Pivotal Software, Inc. ## ## Licensed under the MPL. See http://www.rabbitmq.com/ ## ## ########## Logs: /usr/local/rabbitmq/var/log/rabbitmq/rabbit@centos01.log ###### ## /usr/local/rabbitmq/var/log/rabbitmq/rabbit@centos01-sasl.log ########## Starting broker... completed with 0 plugins. # rabbitmq-plugins enable rabbitmq_management The following plugins have been enabled: mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_management_agent rabbitmq_management Applying plugin configuration to rabbit@centos01... started 6 plugins.
配置用户:
--添加用户
# rabbitmqctl add_user admin admin Creating user "admin" ...
--将该用户设置为管理员 # rabbitmqctl set_user_tags admin administrator Setting tags for user "admin" to [administrator] ...
# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" Setting permissions for user "admin" in vhost "/" ...
登录验证:
在浏览器中输入192.168.1.10:15672
图3
Username:admin
Password:admin
图4
-The End-
Tank
20180131