Centos7安装RabbitMQ3.6.X:
一、JDK安装:
0 1 2 3 4 |
$ tar zxf jdk-8u191-linux-x64.tar.gz $ mv jdk1.8.0_191/ /opt/ $ ln -s /opt/jdk1.8.0_191/ /usr/local/jdk $ export JAVA_HOME=/usr/local/jdk $ export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH |
二、ERLANG安装:
0 1 2 3 4 5 6 7 8 9 10 |
#### 安装erlang支持,3.7.x版本的RabbitMQ请安装19.2以上的erlang #### $ yum install make gcc gcc-c++ m4 ncurses-devel openssl-devel unixODBC unixODBC-devel wget vim lrzsz net-tools $ mkdir /byrd/tools -p $ cd /byrd/tools/ $ wget http://erlang.org/download/otp_src_19.2.tar.gz $ tar zxf otp_src_19.2.tar.gz $ cd otp_src_19.2 $ ./configure --prefix=/opt/otp_src_19.2 --enable-smp-support --enable-threads --enable-sctp --enable-kernel-poll --enable-hipe --with-ssl --with-javac $ make && make install $ ln -s /opt/otp_src_19.2/ /usr/local/erlang $ export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:/usr/local/erlang/bin:$PATH |
三、RabbitMQ启动:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#### RabbitMQ3.6.x启动 #### $ cd .. $ wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix-3.6.1.tar.xz $ xz -d rabbitmq-server-generic-unix-3.6.1.tar.xz $ tar vxf rabbitmq-server-generic-unix-3.6.1.tar $ mv rabbitmq_server-3.6.1/ /opt/ $ ln -s /opt/rabbitmq_server-3.6.1/ /usr/local/rabbitmq $ export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:/usr/local/erlang/bin:/usr/local/rabbitmq/sbin:$PATH $ tail -1 /etc/profile export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:/usr/local/erlang/bin:/usr/local/rabbitmq/sbin:$PATH $ source /etc/profile $ rabbitmq-server -detached #启动 $ rabbitmqctl status $ rabbitmqctl stop $ rabbitmqctl list_users $ mkdir /etc/rabbitmq $ netstat -tunlp|grep 5672 tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 67280/beam tcp6 0 0 :::5672 :::* LISTEN 67280/beam |
四、启用插件:
0 1 2 3 4 5 6 7 8 9 |
#### 启动WEB支持 #### $ rabbitmq-plugins enable rabbitmq_management The following plugins have been enabled: mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_management_agent rabbitmq_management Applying plugin configuration to rabbit@localhost... started 6 plugins. |
五、用户建立:
0 1 2 3 4 5 6 |
#### 建立超级管理员用户 #### $ rabbitmqctl add_user byrd admin Creating user "byrd" ... $ rabbitmqctl set_permissions -p / byrd ".*" ".*" ".*" Setting permissions for user "byrd" in vhost "/" ... $ rabbitmqctl set_user_tags byrd administrator Setting tags for user "byrd" to [administrator] ... |
ERROR:SourceByrd's Weblog-https://note.t4x.org/basic/rabbitmq-generic-unix-install/
SourceByrd's Weblog-https://note.t4x.org/basic/rabbitmq-generic-unix-install/
012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 [root@localhost tools]# rabbitmqctl statusStatus of node rabbit@localhost ...Error: unable to perform an operation on node 'rabbit@localhost'. Please see diagnostics information and suggestions below.Most common reasons for this are:* Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)* CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)* Target node is not runningIn addition to the diagnostics info below:* See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more* Consult server logs on node rabbit@localhostDIAGNOSTICS===========attempted to contact: [rabbit@localhost]rabbit@localhost:* connected to epmd (port 4369) on localhost* epmd reports: node 'rabbit' not running at allno other nodes on localhost* suggestion: start the nodeCurrent node details:* node name: rabbitmqcli88@localhost* effective user's home directory: /root* Erlang cookie hash: s0WjMpqrrSRacU2P3coVNg==[root@localhost tools]# echo $RABBITMQ_HOME[root@localhost tools]# rabbitmq-serverError: This RabbitMQ version cannot run on Erlang 19.2 (erts 8.2): minimum required version is 19.3 (erts 8.3){"Kernel pid terminated",application_controller,"{application_start_failure,rabbit,{{erlang_version_too_old,\"Erlang 19.3 or later is required, started on 19.2\"},{rabbit,start,[normal,[]]}}}"}Kernel pid terminated (application_controller) ({application_start_failure,rabbit,{{erlang_version_too_old,"Erlang 19.3 or later is required, started on 19.2"},{rabbit,start,[normal,[]]}}})Crash dump is being written to: /usr/local/rabbitmq/var/log/rabbitmq/erl_crash.dump...done[root@localhost tools]# rabbitmq-server## #### ## RabbitMQ 3.7.8. Copyright (C) 2007-2018 Pivotal Software, Inc.########## Licensed under the MPL. See http://www.rabbitmq.com/###### ############ Logs: /usr/local/rabbitmq/var/log/rabbitmq/rabbit@localhost.log/usr/local/rabbitmq/var/log/rabbitmq/rabbit@localhost_upgrade.logStarting broker...completed with 3 plugins.
参考文档:
1:https://blog.csdn.net/yin767833376/article/details/81223491
2:https://github.com/rabbitmq/rabbitmq-server/blob/v3.7.x/docs/rabbitmq.conf.example
3:https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/rabbitmq.config.example
4:https://www.cnblogs.com/AloneSword/p/4200051.html
4:http://www.rabbitmq.com/install-generic-unix.htmlSourceByrd's Weblog-https://note.t4x.org/basic/rabbitmq-generic-unix-install/
SourceByrd's Weblog-https://note.t4x.org/basic/rabbitmq-generic-unix-install/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!