专栏首页做不甩锅的后端rabbitmq-3.7.7安装过程

rabbitmq-3.7.7安装过程

rabbtmq 依赖于erlang,rabbitmq 3.7.7 版本对erlang的依赖关系参见:http://www.rabbitmq.com/which-erlang.html erlang版本为21.0.x,因此,需要首先安装21.0.x。考虑到服务器环境可能无法直接与外网环境互通,因此决定采用下载源码自行编译erlang。(基础的yum repo运维是支持的)

1.编译安装erlang

cd /opt/soft
wget http://erlang.org/download/otp_src_21.0.tar.gz

cd /opt
tar - zxvf  otp_src_21.0.tar.gz

在下载完源码之后,进行编译,注意,erlang需要依赖的包有 ncurses-devel 、openssl-devel、unixODBC-devel、gcc-c++。

#--prefix 指定编译后安装的目录  --without-javac 采用非java编译
 ./configure --prefix=/opt/erlang --without-javac

可以看到提示部分:

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************

configure: error: No curses library functions found
configure: error: /bin/sh '/opt/otp_src_21.0/erts/configure' failed for erts

*********************************************************************
*********************************************************************
**********************  APPLICATIONS INFORMATION  *******************
*********************************************************************

wx             : wxWidgets not found, wx will NOT be usable

*********************************************************************
*********************************************************************
**********************  DOCUMENTATION INFORMATION  ******************
*********************************************************************

documentation  : 
                 fop is missing.
                 Using fakefop to generate placeholder PDF files.
*********************************************************************

需要安装ncurses-devel

yum -y install ncurses-devel

./configure --prefix=/opt/erlang --without-javac

提示:

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************
crypto         : No usable OpenSSL found
jinterface     : Java compiler disabled by user
odbc           : ODBC library - link check failed
orber          : No C++ compiler found
ssh            : No usable OpenSSL found
ssl            : No usable OpenSSL found

需要安装openssl-devel

yum -y install openssl-devel

./configure --prefix=/opt/erlang --without-javac

提示:

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************
jinterface     : Java compiler disabled by user
orber          : No C++ compiler found
*********************************************************************

需要安装gcc-c++

yum -y install gcc-c++

./configure --prefix=/opt/erlang --without-javac

最终提示:

config.status: creating include/x86_64-unknown-linux-gnu/erl_int_sizes_config.h
*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************

jinterface     : Java compiler disabled by user

*********************************************************************
*********************************************************************
**********************  APPLICATIONS INFORMATION  *******************
*********************************************************************

wx             : wxWidgets not found, wx will NOT be usable

*********************************************************************
*********************************************************************
**********************  DOCUMENTATION INFORMATION  ******************
*********************************************************************

documentation  : 
                 fop is missing.
                 Using fakefop to generate placeholder PDF files.

*********************************************************************

注意 APPLICATIONS DISABLED 部分的提示,其他两部分是不影响编译的。 No Java compiler found ,我们可以选择用gcc等其他方式来编译erlang,如果你安装了gcc,这里就用不上java编译了,因此可以在configure时增加 –disable-javac 避免该错误。

make
make install

稍等片刻即可安装成功,此外,为了使用方便,还可使用一个软连接:

ln  -s /opt/erlang/bin/erl /usr/local/bin/erl

测试:

erl
Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Eshell V10.0  (abort with ^G)
1> 

erl安装成功。

2.安装rabbitmq

下载通用安装包

wget https://akamai.bintray.com/64/640fc5d0b10705f838419191bbf917e66f3ff5eb35f07fc51c2f197fda0aa170?__gda__=exp=1530957710~hmac=6af54ca017b6fae8e04b64c984bc017959e07afdbdc8d3879866b139a33d9292&response-content-disposition=attachment%3Bfilename%3D%22rabbitmq-server-generic-unix-3.7.7.tar.xz%22&response-content-type=application%2Fx-xz&requestInfo=U2FsdGVkX1_eFHEzyK3D7PXVMbDHIPfdzVdK4Q_LLLngjq1JJJl_5tlhcw6ktmi5IW8D6hha51CqLD-KaDhKxUpLEPF3FOJLyMsr2mclgrvQvldL4f6X25oqy17aOWcB8w0eBZxjWLWM4ImCKkBGq71SGPN7mu72F8JT9gDiMXX1z6sBCDXtSdec5CJJP1je&response-X-Checksum-Sha1=a3aa29d46218899cbf597a913493a5c9abc1a6ba&response-X-Checksum-Sha2=640fc5d0b10705f838419191bbf917e66f3ff5eb35f07fc51c2f197fda0aa170

建用户

useradd rabbitmq -d /opt/rabbitmq

修改limit.conf

vim /etc/security/limit.conf

增加如下内容:

rabbitmq soft nproc 16384
rabbitmq hard nproc 16384
rabbitmq soft nofile 65535
rabbitmq hard nofile 65536

切换到rabbitmq

sudo su - rabbitmq 

xz -d ./rabbitmq-server-generic-unix-3.7.7.tar.xz 
tar -xvf ./rabbitmq-server-generic-unix-3.7.7.tar 
ln -s /opt/rabbitmq/rabbitmq_server-3.7.7 /opt/rabbitmq/rabbitmq

启动rabbitmq

cd  rabbitmq/sbin 
./rabbitmq-server start

开启管理界面

./rabbitmq-plugins  list
./rabbitmq-plugins enable rabbitmq_management
./rabbitmqctl add_user rabbitmq rabbitmq
./rabbitmqctl set_user_tags rabbitmq administrator

执行过程:

[rabbitmq@m162p239 sbin]$ ./rabbitmq-plugins  list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@m162p239
 |/
[  ] rabbitmq_amqp1_0                  3.7.7
[  ] rabbitmq_auth_backend_cache       3.7.7
[  ] rabbitmq_auth_backend_http        3.7.7
[  ] rabbitmq_auth_backend_ldap        3.7.7
[  ] rabbitmq_auth_mechanism_ssl       3.7.7
[  ] rabbitmq_consistent_hash_exchange 3.7.7
[  ] rabbitmq_event_exchange           3.7.7
[  ] rabbitmq_federation               3.7.7
[  ] rabbitmq_federation_management    3.7.7
[  ] rabbitmq_jms_topic_exchange       3.7.7
[  ] rabbitmq_management               3.7.7
[  ] rabbitmq_management_agent         3.7.7
[  ] rabbitmq_mqtt                     3.7.7
[  ] rabbitmq_peer_discovery_aws       3.7.7
[  ] rabbitmq_peer_discovery_common    3.7.7
[  ] rabbitmq_peer_discovery_consul    3.7.7
[  ] rabbitmq_peer_discovery_etcd      3.7.7
[  ] rabbitmq_peer_discovery_k8s       3.7.7
[  ] rabbitmq_random_exchange          3.7.7
[  ] rabbitmq_recent_history_exchange  3.7.7
[  ] rabbitmq_sharding                 3.7.7
[  ] rabbitmq_shovel                   3.7.7
[  ] rabbitmq_shovel_management        3.7.7
[  ] rabbitmq_stomp                    3.7.7
[  ] rabbitmq_top                      3.7.7
[  ] rabbitmq_tracing                  3.7.7
[  ] rabbitmq_trust_store              3.7.7
[  ] rabbitmq_web_dispatch             3.7.7
[  ] rabbitmq_web_mqtt                 3.7.7
[  ] rabbitmq_web_mqtt_examples        3.7.7
[  ] rabbitmq_web_stomp                3.7.7
[  ] rabbitmq_web_stomp_examples       3.7.7
[rabbitmq@m162p239 sbin]$ ./rabbitmq-plugins enable rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@m162p239...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

started 3 plugins.
[rabbitmq@m162p239 sbin]$ ./rabbitmqctl add_user rabbitmq rabbitmq
Adding user "rabbitmq" ...
[rabbitmq@m162p239 sbin]$ ./rabbitmqctl set_user_tags rabbitmq administrator
Setting tags for user "rabbitmq" to [administrator] ...
[rabbitmq@m162p239 sbin]$ ./rabbitmq-plugins  list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@m162p239
 |/
[  ] rabbitmq_amqp1_0                  3.7.7
[  ] rabbitmq_auth_backend_cache       3.7.7
[  ] rabbitmq_auth_backend_http        3.7.7
[  ] rabbitmq_auth_backend_ldap        3.7.7
[  ] rabbitmq_auth_mechanism_ssl       3.7.7
[  ] rabbitmq_consistent_hash_exchange 3.7.7
[  ] rabbitmq_event_exchange           3.7.7
[  ] rabbitmq_federation               3.7.7
[  ] rabbitmq_federation_management    3.7.7
[  ] rabbitmq_jms_topic_exchange       3.7.7
[E*] rabbitmq_management               3.7.7
[e*] rabbitmq_management_agent         3.7.7
[  ] rabbitmq_mqtt                     3.7.7
[  ] rabbitmq_peer_discovery_aws       3.7.7
[  ] rabbitmq_peer_discovery_common    3.7.7
[  ] rabbitmq_peer_discovery_consul    3.7.7
[  ] rabbitmq_peer_discovery_etcd      3.7.7
[  ] rabbitmq_peer_discovery_k8s       3.7.7
[  ] rabbitmq_random_exchange          3.7.7
[  ] rabbitmq_recent_history_exchange  3.7.7
[  ] rabbitmq_sharding                 3.7.7
[  ] rabbitmq_shovel                   3.7.7
[  ] rabbitmq_shovel_management        3.7.7
[  ] rabbitmq_stomp                    3.7.7
[  ] rabbitmq_top                      3.7.7
[  ] rabbitmq_tracing                  3.7.7
[  ] rabbitmq_trust_store              3.7.7
[e*] rabbitmq_web_dispatch             3.7.7
[  ] rabbitmq_web_mqtt                 3.7.7
[  ] rabbitmq_web_mqtt_examples        3.7.7
[  ] rabbitmq_web_stomp                3.7.7
[  ] rabbitmq_web_stomp_examples       3.7.7
[rabbitmq@m162p239 sbin]$ 

然后访问后台 http://192.168.162.239:15672 用 rabbitmq rabbitmq 登陆即可

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 多线程基础(四):volatile和可见性问题及happens-before原则

    有两个线程,一个线程写入,另外一个线程读取,那么写入线程的结果,每次都能被读取线程读到吗?我们执行上述代码:

    冬天里的懒猫
  • 什么?面试官让我用ArrayList实现一个阻塞队列?

    在准备开始详细分析java多线程源码时,发现了这样一个问题,也就是说,在面试的时候经常要求,手写阻塞队列,或者手写一个程序,交替打印1-10000。于是,看到这...

    冬天里的懒猫
  • 一次系统扩容引起的elasticsearch故障及恢复

    由于m21p22服务器配置比较老旧,而且上面还有其他人部署的其他应用。硬盘写入性能比较差,因此考虑吧elasticsearch部署在另外两台配置高的服务器,而将...

    冬天里的懒猫
  • ​Linux下安装RabbitMQ

    java之旅
  • centos6.9 rabbitmq设置SSL

     由于安全团队要求,需要给rabbitmq加上SSL,java代码使用ssl秘钥进行连接。

    py3study
  • CentOs7.3 搭建 RabbitMQ 3.6 单机多实例服务

    老七Linux
  • 安装rabbitMQ

    1、先在www.erlang.org/downloads下载erlang的源码 2、http://www.rabbitmq.com/download.html下...

    HUC思梦
  • rabbitmq学习第一步win10下安装rabbitmq

    rabbitmq是目前比较流行的中间件,接下来要好好学学如何使用rabbitmq。首先呢学会win10安装rabbitmq。

    用户1956326
  • rabbitmq-server的 prometheus监控

    下载 rabbitmq_exporter-0.29.0.linux-amd64.tar.gz 这个包, 下载地址: https://github.com/kbu...

    二狗不要跑
  • RabbitMQ消息队列部署与配置基础

    “每个理性的IT人士都置顶了吴柯的运维笔记” RabbitMQ简介 AMQP,即Advanced Message Queuing Protocol,高级消息队列...

    吴柯

扫码关注云+社区

领取腾讯云代金券