yum安装RabbitMQ

安装RabbitMQ

RabbitMQ基于erlang开发,首先安装erlang,参考官方文档(erlang>>= 20.3)

1.安装erlang

参考链接:https://github.com/rabbitmq/erlang-rpm

# 添加源
vim /etc/yum.repos.d/rabbitmq_erlang.repo
# 写入以下 保存退出
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
yum install -y erlang

2.安装RabbigMQ

参考链接:https://www.rabbitmq.com/download.html

# 下载
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.15/rabbitmq-server-3.7.15-1.el7.noarch.rpm
# 安装
yum install rabbitmq-server-3.7.15-1.el7.noarch.rpm -y

3.测试

# 启动 rabbitmq (默认端口5672)
service rabbitmq-server start
# 查看端口(如果有这个命令)
lsof -i:5672
# 没有lsof命令
ps aux | grep rabbitmq
# 或者
rabbitmqctl status

4.命令

# rabbitmqctl(查看所有命令)
rebbitmqctl

5.启动后台管理

rabbitmq-plugins enable rabbitmq_management
# 使用浏览器登录,默认用户gust,guest。默认端口:15672,例如访问:http://192.168.180.4:15672/ 
# 修改配置
vim /etc/rabbitmq/rabbitmq.config
# 写入(允许guest在localhost以外登录)
[
    {rabbit, [{tcp_listeners, [5672]},{loopback_users,[guest]}]}
].
# 保存后重启
service rabbitmq-server restart

6.其他配置
参考官网:https://www.rabbitmq.com/configure.html

3条评论


  1. RabbitMQ installations running production workloads may need system limits and kernel parameters tuning in order to handle a decent number of concurrent connections and queues. The main setting that needs adjustment is the max number of open files, also known as ulimit -n. The default value on many operating systems is too low for a messaging broker ( 1024 on several Linux distributions). We recommend allowing for at least 65536 file descriptors for user rabbitmq in production environments. 4096 should be sufficient for many development workloads.

    回复

  2. I have been browsing online more than 3 hours today, but I by no
    means discovered any fascinating article like yours.
    It’s lovely worth enough for me. In my view, if all web owners and bloggers made excellent content material as you probably
    did, the net will likely be much more helpful
    than ever before.

    回复

  3. I’ve been surfing online more than three hours today,
    yet I never found any interesting article like yours. It’s pretty worth enough for me.
    Personally, if all site owners and bloggers made good content as you did, the web will be much more useful than ever before.

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注