一、rabbitMq与Erlang 版本选择
查看支持的Erlang版本
二、安装依赖
yum install -y gcc gcc-c++ cmake ncurses-devel openssl-devel
三、erlang 安装
拉取Erlang包并且解压指向路径
wget http://erlang.org/download/otp_src_24.2.tar.gz
tar -xvf otp_src_24.2.tar.gz -C /mnt/application/erlang/otp_src_24.2
预编译
cd /mnt/application/erlang/otp_src_24.2
./configure --prefix=/mnt/application/erlang/otp_src_24.2
执行编译和安装
make && make install
配置 /etc/profile
export ERLANG_HOME=/mnt/application/erlang/otp_src_24.2
export PATH=${ERLANG_HOME}/bin:${PATH}source /etc/profile
四、如果提示缺少socat
yum install -y socat
五、rabbitmq 安装
拉取源码包
wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.9.11/rabbitmq-server-generic-unix-3.9.1.tar.xz
解压指定路径
xz -d rabbitmq-server-generic-unix-3.9.1.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.9.1.tar -C /mnt/application/rabbitmq_server-3.9.11
配置 /etc/profile
export RABBITMQ_HOME=/mnt/application/rabbitmq_server-3.9.11
export PATH=${RABBITMQ_HOME}/sbin:${PATH}source /etc/profile
自定义log和mnesia路径 在 /mnt/application/rabbitmq_server-3.9.11/etc/rabbitmq 添加rabbitmq.conf
RABBITMQ_MNESIA_base=/mnt/applicationdata/rabbitmq/mnesia
RABBITMQ_LOG_base=/mnt/applicationdata/rabbitmq/log
启动WEB控制台插件(如果不执行此命令,则web控制台访问不了)
./rabbitmq-plugins enable rabbitmq_management
启动rabbitmq服务
cd /usr/local/soft/rabbitmq_server-3.9.11/sbin
./rabbitmq-server -detached
或者:
./rabbitmq-server start
service rabbitmq-server start
关闭服务
./rabbitmqctl stop
添加用户
rabbitmqctl add_user admin admin
rabbitmqctl set_user_tags admin administrator
rabbitmqctl add_vhost /test
./rabbitmqctl set_permissions -p / admin “." ".” “.*”
六、配置内存
rabbitmqctl set_vm_memory_high_watermark
rabbitmqctl set_vm_memory_high_watermark absolute
例子:
rabbitmqctl set_vm_memory_high_watermark 0.6
rabbitmqctl set_vm_memory_high_watermark absolute “4G”
内存相关配置链接:RabbitMQ的告警之一:内存告警_技术与复利的博客-CSDN博客_set_vm_memory_high_watermark
注意:如果程序链接不上,估计是账号没有授权
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)