rabbitmq搭建

rabbitmq搭建,第1张

rabbitmq搭建 1.安装依赖包
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel openssl-dev socat unixODBC-devel unixODBC ncurses-devel

2.添加epel源
yum install epel-release

或者
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
3. 更新erlang仓库
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm && rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
rpm --import http://binaries.erlang-solutions.com/debian/erlang_solutions.asc 
安装 rpmfusion
rpm -ivh    https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
4.安装erlang (20.1版本)
wget http://erlang.org/download/otp_src_20.1.tar.gz
tar -zxvf otp_src_20.1.tar.gz 
cd otp_src_20.1 && ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll --without-javac
make && make install (耗时较长)
ln -s /usr/local/erlang/bin/erl /usr/local/bin/
环境变量:vim /etc/profile


#erlang path
ERL_HOME=/usr/local/erlang
export PATH=$ERL_HOME/bin:$PATH
5.安装并且启动rabbitmq
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_14/rabbitmq-server-3.6.14-1.el7.noarch.rpm
rpm -ivh --nodeps rabbitmq-server-3.6.14-1.el7.noarch.rpm
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
rabbitmq-plugins enable rabbitmq_management #启动管理插件
6.添加rabbitmq配置
vim /etc/rabbitmq/rabbitmq.config 
[
{ rabbit, [
{ loopback_users, [ ] },
{log_levels, [{connection, error}]},
{vm_memory_high_watermark, 0.7},
{vm_memory_high_watermark_paging_ratio, 0.8},
{cluster_partition_handling, ignore},
{ tcp_listeners, [ 5672 ] },
{ ssl_listeners, [ ] },
{ default_pass, <<"hualalaadmin">> },
{ default_user, <<"admin">> },
{ default_vhost, <<"/">> },
{ hipe_compile, false }
] },
{ rabbitmq_management, [ { listener, [
{ port, 15672 },
{ ssl, false }
] } ] }
].
7.参数调优
vim /etc/security/limits.conf

添加

* soft nofile 655360
* hard nofile 655360

参数调优

 vim /usr/lib/systemd/system/rabbitmq-server.service 

添加

 LimitNOFILE = 655360

重启rabbitmq服务

systemctl daemon-reload 

systemctl restart rabbitmq-server.service 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5679179.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存