【RabbitMQ】安裝
RabbitMQ可以安裝在很多作業系統上,我的系統:
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@localhost ~]#
安裝erlang
RabbitMQ依賴於erlang,所以在安裝RabbitMQ前,我們先安裝erlang,yum源參考:erlang yum(我使用Erlang 20.x on CentOS 7)
Erlang 20.x on CentOS 7:
# In /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
[root@localhost ~]# vi /etc/yum.repos.d/rabbitmq-erlang.repo # 新增erlang repos,填入以上內容
[root@localhost ~]# yum update
[root@localhost ~]# yum install -y erlang
等待安裝完成即可
安裝其他依賴
除了erlang外,rabbitmq還依賴於“socat”,使用以下命令即可安裝完成
[root@localhost ~]# yum install -y socat
安裝rabbitmq
從rabbitmq-server-3.7.6-1.el7.noarch.rpm下載rabbitmq的rpm包
[root@localhost ~]# wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.6/rabbitmq-server-3.7.6-1.el7.noarch.rpm
[root@localhost ~]# rpm -ivh rabbitmq-server-3.7.6-1.el7.noarch.rpm
rabbitmq安裝完成
如果你是其他作業系統,請參考官網:Downloading and Installing RabbitMQ
啟動rabbitmq
[root@localhost ~]# systemctl start rabbitmq-server.service
[root@localhost ~]# systemctl status rabbitmq-server.service
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2018-06-30 20:22:03 PDT; 6min ago
Process: 85394 ExecStop=/usr/sbin/rabbitmqctl shutdown (code=exited, status=0/SUCCESS)
Main PID: 85518 (beam.smp)
Status: "Initialized"
Tasks: 83
CGroup: /system.slice/rabbitmq-server.service
├─85518 /usr/lib64/erlang/erts-9.3.3/bin/beam.smp -W w -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db...
├─85859 erl_child_setup 1024
├─85873 inet_gethost 4
└─85874 inet_gethost 4
Jun 30 20:22:01 localhost.localdomain rabbitmq-server[85518]: ## ##
Jun 30 20:22:01 localhost.localdomain rabbitmq-server[85518]: ## ## RabbitMQ 3.7.6. Copyright (C) 2007-2018 Pivotal Software, Inc.
Jun 30 20:22:01 localhost.localdomain rabbitmq-server[85518]: ########## Licensed under the MPL. See http://www.rabbitmq.com/
Jun 30 20:22:01 localhost.localdomain rabbitmq-server[85518]: ###### ##
Jun 30 20:22:01 localhost.localdomain rabbitmq-server[85518]: ########## Logs: /var/log/rabbitmq/rabbit@localhost.log
Jun 30 20:22:01 localhost.localdomain rabbitmq-server[85518]: /var/log/rabbitmq/rabbit@localhost_upgrade.log
Jun 30 20:22:01 localhost.localdomain rabbitmq-server[85518]: Starting broker...
Jun 30 20:22:03 localhost.localdomain rabbitmq-server[85518]: systemd unit for activation check: "rabbitmq-server.service"
Jun 30 20:22:03 localhost.localdomain systemd[1]: Started RabbitMQ broker.
Jun 30 20:22:04 localhost.localdomain rabbitmq-server[85518]: completed with 0 plugins.
[root@localhost ~]#
啟動成功之後,我們為了後續測試方便,先建立一個使用者
[root@localhost ~]# rabbitmqctl add_user <username> <password>
[root@localhost ~]# rabbitmqctl set_permissions -p / <username> ".*" ".*" ".*"
說明:
- rabbitmq預設建立了guest使用者,但只允許通過localhost訪問
- 每個使用者訪問rabbitmq都需要使用vhost(許可權控制)
- rabbitmq預設建立了
/
vhost,需要給新建的使用者設定許可權,不然會報錯:no access to this vhost
防火牆
rabbitmq預設使用5672埠,如果rabbitmq不是安裝在本機,記得開放tcp/5672,centos 7開放tcp/5672的命令:
[root@localhost anys]# firewall-cmd --zone=public --add-port=5672/tcp --permanent
[root@localhost anys]# firewall-cmd --reload
相關文章
- 安裝RabbitMQMQ
- mac安裝rabbitmqMacMQ
- Mac 安裝 RabbitMQMacMQ
- Docker安裝RabbitmqDockerMQ
- Ubuntu 安裝 RabbitMQUbuntuMQ
- centOS安裝rabbitMQCentOSMQ
- docker 安裝 RabbitMQDockerMQ
- Ubantu 安裝 rabbitMQMQ
- 如何安裝RabbitMQMQ
- Windows RabbitMQ安裝WindowsMQ
- rabbitMq急速安裝教程MQ
- Linux如何安裝RabbitMQLinuxMQ
- centos 7 安裝 rabbitMqCentOSMQ
- Docker Compose 安裝 RabbitMQDockerMQ
- Rabbitmq安裝與配置MQ
- Linux下安裝RabbitMQLinuxMQ
- CentOS7安裝rabbitmqCentOSMQ
- RabbitMQ安裝配置(CentOS)MQCentOS
- Linux中如何安裝RabbitMQ?在linux系統中安裝Rabbitmq的方法LinuxMQ
- centos7.8 安裝RabbitmqCentOSMQ
- RabbitMQ簡介及安裝MQ
- Ubuntu20.04安裝RabbitMQUbuntuMQ
- Centos7安裝RabbitMQCentOSMQ
- RabbitMQ 安裝與介面管理MQ
- 安裝RabbitMQ Server服務MQServer
- 在 windows下安裝rabbitmqWindowsMQ
- RabbitMQ入門 -- 阿里雲伺服器安裝RabbitMQMQ阿里伺服器
- CentOS6.x安裝RabbitMQCentOSMQ
- Windows環境下安裝RabbitMQWindowsMQ
- RabbitMQ安裝過程詳解MQ
- RabbitMQ學習筆記-安裝MQ筆記
- docker 安裝mysql redis activemq rabbitmqDockerMySqlRedisMQ
- RabbitMQ學習系列一:windows下安裝RabbitMQ服務MQWindows
- RabbitMQ 安裝部署與配置總結MQ
- rabbitmq安裝使用問題彙總MQ
- RabbitMQ超詳細安裝教程(Linux)MQLinux
- laradock安裝rabbitmq無法啟動MQ
- RabbitMQ 使用場景、安裝、工作模式MQ模式