作者:英萍维玟9856 | 来源:互联网 | 2023-07-08 20:26
一、安装Erlang1、安装依赖库viewsourceprint?yum-yinstallmakegccgcc-c++kernel-develm4ncursesn
一、安装 Erlang
1、安装依赖库
view sourceprint?
|
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses ncurses-devel openssl-devel zlib zlin-devel zlib zlib-devel openssl openssl-devel unixODBC unixODBC-devel libxslt simplejson erlang-jinterface erlang-doc
yum install erlang 剩下的到rabbitMQ安装之前的都不用管,直接这个就好了 |
2、下载 Erlang 源码
view sourceprint?
2 |
wget -c http://www.erlang.org/download/otp_src_R16B03. tar .gz |
3、编译安装
view sourceprint?
1 |
tar -xzvf ./otp_src_R16B03. tar .gz |
3 |
./configure --prefix=/usr/ local /erlang --with-ssl - enable -threads - enable -smmp-support - enable -kernel-poll -- enable -hipe --without-javac |
4、配置环境变量
view sourceprint?
3 |
export PATH=$PATH:/usr/ local /erlang/bin |
二、安装 RabbitMQ
1、安装依赖库
view sourceprint?
2、下载 RabbitMQ 源码
view sourceprint?
2 |
wget -c http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.3/rabbitmq-server-3.4.3. tar .gz |
3、编译安装
view sourceprint?
1 |
tar -xzvf ./rabbitmq-server-3.4.3. tar .gz |
2 |
cd ./rabbitmq-server-3.4.3 |
4 |
make install TARGET_DIR=/usr/ local /rabbitmq SBIN_DIR=/usr/ local /rabbitmq/sbin MAN_DIR=/usr/ local /rabbitmq/ man DOC_INSTALL_DIR=/usr/ local /rabbitmq/doc |
4、配置RabbitMQ
#设置日志与消息持久化目录:
view sourceprint?
1 |
mkdir /var/log/rabbitmq |
2 |
mkdir /var/lib/rabbitmq |
4 |
ln -s /usr/ local /rabbitmq/sbin/rabbitmq-server /usr/bin/rabbitmq-server |
5 |
ln -s /usr/ local /rabbitmq/sbin/rabbitmq- env /usr/bin/rabbitmq- env |
#启动 RabbitMQ
view sourceprint?
RabbitMQ 3.4.3. Copyright (C) 2007-2014 GoPivotal, Inc.
## ## Licensed under the MPL. See http://www.rabbitmq.com/
## ##
########## Logs: /var/log/rabbitmq/rabbit@localhost.log
###### ## /var/log/rabbitmq/rabbit@localhost-sasl.log
##########
Starting broker... completed with 0 plugins.
5、安装Web插件管理界面
view sourceprint?
1 |
cd /usr/ local /rabbitmq/sbin |
3 |
./rabbitmq-plugins enable rabbitmq_management |
#查看插件列表
view sourceprint?
1 |
./rabbitmq-plugins list |
6、常用命令
#先进入命令工具目录
view sourceprint?
1 |
cd /usr/ local /rabbitmq/sbins |
#启动 RabbitMQ
view sourceprint?
1 |
./rabbitmq-server start |
在浏览器上输入 http://127.0.0.1:15672 进入管理界面,用户名和密码默认都是 guest
随后在浏览器里访问:http://10.75.10.66:15672
输入用户名密码 guest/guest 发现不能登录
原来从 rabbitmq 3.3.0 之后不能以 guest/guest 登录了(本机可以)
要新增用户及权限:
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
创建了用户名/密码:test/test
最后成功登录
#关闭 RabbitMQ