当前位置:   article > 正文

Centos 7 下安装RabbitMQ,并通过web访问_failed to start socat error:enoent

failed to start socat error:enoent

一、安装Erlang

1、下载esl-erlang_21.0-1~centos~7_amd64.rpm

wget https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_21.0-1~centos~7_amd64.rpm

2、安装

rpm -ivh esl-erlang_21.0-1~centos~7_amd64.rpm --force --nodeps

3、查看安装

  [root@localhost opt]# yum list|grep erlang
  esl-erlang.x86_64                           21.0-1                     installed

二、安装RabbitMQ

1、下载rabbitmq-server-3.7.7-1

wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.7/rabbitmq-server-3.7.7-1.el7.noarch.rpm

2、安装

rpm -ivh rabbitmq-server-3.7.7-1.el7.noarch.rpm --force --nodeps

3、查看安装

  [root@localhost opt]# yum list|grep rabbit
  rabbitmq-server.noarch                      3.7.7-1.el7                installed
  librabbitmq.i686                            0.8.0-2.el7                base     
  librabbitmq.x86_64                          0.8.0-2.el7                base     
  librabbitmq-devel.i686                      0.8.0-2.el7                base     
  librabbitmq-devel.x86_64                    0.8.0-2.el7                base     
  librabbitmq-examples.x86_64                 0.8.0-2.el7                base                            21.0-1                     installed

3、配置远程用户访问

1、新建配置文件

 vi /etc/rabbitmq/rabbitmq.conf
  #默认用户名
  default_user = guest
  #默认密码
  default_pass = guest
  #远程用户访问
  loopback_users = none

2、启动rabbitmq服务

/sbin/service rabbitmq-server start

3、查看运行

  [root@localhost opt]# /sbin/service rabbitmq-server status
  Redirecting to /bin/systemctl status rabbitmq-server.service
  ● rabbitmq-server.service - RabbitMQ broker
     Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
     Active: activating (start) since Fri 2018-07-06 01:06:31 EDT; 1min 15s ago
   Main PID: 2948 (beam.smp)
     CGroup: /system.slice/rabbitmq-server.service
             ├─2948 /usr/lib/erlang/erts-10.0/bin/beam.smp -W w -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs...
             ├─3121 /usr/lib/erlang/erts-10.0/bin/epmd -daemon
             ├─3259 erl_child_setup 1024
             ├─3296 inet_gethost 4
             └─3297 inet_gethost 4
  ​
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: ##  ##      RabbitMQ 3.7.7. Copyright (C) 2007-2018 Pi...Inc.
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: ##########  Licensed under the MPL.  See http://www.ra...com/
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: ######  ##
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: ##########  Logs: /var/log/rabbitmq/rabbit@localhost.log
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: /var/log/rabbitmq/rabbit@localhost_upgrade.log
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: Starting broker...
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: systemd unit for activation check: "rabbitmq-server.service"
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: Failed to start socat error:enoent
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: systemd READY notification failed, beware of timeouts
  Jul 06 01:06:36 localhost.localdomain rabbitmq-server[2948]: completed with 0 plugins.
  Hint: Some lines were ellipsized, use -l to show in full.

4、开启RabbitMQ web访问

  rabbitmq-plugins enable rabbitmq_management
  /sbin/service rabbitmq-server stop
  /sbin/service rabbitmq-server start

5、开启端口15672,5672

  [root@localhost opt]# firewall-cmd --permanent --add-port=15672/tcp
  success
  [root@localhost opt]# firewall-cmd --permanent --add-port=5672/tcp 
  success
  [root@localhost opt]# service network restart
  Restarting network (via systemctl):                        [  OK  ]
  [root@localhost opt]# 

6、设置开机启动

chkconfig rabbitmq-server on

7、添加admin,并赋予administrator权限

添加admin用户,密码设置为admin。

sudo rabbitmqctl add_user  admin  admin  

赋予权限

sudo rabbitmqctl set_user_tags admin administrator

赋予virtual host中所有资源的配置、写、读权限以便管理其中的资源

sudo rabbitmqctl  set_permissions -p / admin '.*' '.*' '.*'

安装完毕web访问

浏览器输入

192.168.x.x:15672

默认账号密码

guest

guest

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/558184
推荐阅读
相关标签
  

闽ICP备14008679号