转载https://www.cnblogs.com/hongdada/p/7203589.html

安装RabbitMQ

由于rabbitMq需要erlang语言的支持,在安装rabbitMq之前需要安装erlang,执行命令:

sudo apt-get install erlang-nox

安装rabbitMq命令:

2.$ sudo apt-get update
3.$ sudo apt-get install rabbitmq-server

启动、停止、重启、状态rabbitMq命令:

启动:sudo rabbitmq-server start
关闭: sudo rabbitmq-server stop
重启: sudo rabbitmq-server restart
查看状态:sudo rabbitmqctl status

安装好了以后可以使用 ps -ef|grep rabbit查看RabbitMQ的情况

hongdada@ubuntu:~$ ps -ef|grep rabbit
rabbitmq   7991      1  0 00:12 ?        00:00:00 /bin/sh /usr/sbin/rabbitmq-server
rabbitmq   7999   7991  0 00:12 ?        00:00:00 /bin/sh -e /usr/lib/rabbitmq/bin/rabbitmq-server
rabbitmq   8077      1  0 00:12 ?        00:00:00 /usr/lib/erlang/erts-7.3/bin/epmd -daemon
rabbitmq   8137   7999  0 00:12 ?        00:00:03 /usr/lib/erlang/erts-7.3/bin/beam.smp -W w -A 64 -P 1048576 -K true -B i -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.7/sbin/../ebin -noshell -noinput -s rabbit boot -sname rabbit@ubuntu -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@ubuntu.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@ubuntu-sasl.log"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.5.7/sbin/../plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@ubuntu-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@ubuntu" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672 rabbitmq 8256 8137 0 00:12 ? 00:00:00 inet_gethost 4 rabbitmq 8257 8256 0 00:12 ? 00:00:00 inet_gethost 4 hongdada 8631 6788 0 00:18 pts/18 00:00:00 grep --color=auto rabbit hongdada@ubuntu:~$ cd /usr/lib/rabbitmq/bin/

看起来没有问题,现在进入安装文件夹查看Rabbit的状态:

hongdada@ubuntu:~$ cd /usr/lib/rabbitmq/bin/
hongdada@ubuntu:/usr/lib/rabbitmq/bin$ sudo ./rabbitmqctl status
Status of node rabbit@ubuntu ...
Error: unable to connect to node rabbit@ubuntu: nodedownDIAGNOSTICS
===========attempted to contact: [rabbit@ubuntu]rabbit@ubuntu:* connected to epmd (port 4369) on ubuntu* epmd reports node 'rabbit' running on port 25672* TCP connection succeeded but Erlang distribution failed* suggestion: hostname mismatch?* suggestion: is the cookie set correctly?* suggestion: is the Erlang distribution using TLS? current node details: - node name: 'rabbitmq-cli-8673@ubuntu' - home dir: /home/hongdada - cookie hash: 0PRVafcTz6WKsC1GZlmK7Q==

有错误,要修改配置,先停止服务

hongdada@ubuntu:/usr/lib/rabbitmq/bin$ invoke-rc.d rabbitmq-server stop
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
需要通过认证才能停止“rabbitmq-server.service”。
Authenticating as: hongda,,, (hongdada)
Password:
==== AUTHENTICATION COMPLETE ===

进入安装文件夹/usr/lib/rabbitmq/bin

修改rabbitmqctl文件

添加一行Home配置:加红色的地方

#!/bin/sh -e
##  The contents of this file are subject to the Mozilla Public License
##  Version 1.1 (the "License"); you may not use this file except in
##  compliance with the License. You may obtain a copy of the License
##  at http://www.mozilla.org/MPL/ ## ## Software distributed under the License is distributed on an "AS IS" ## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See ## the License for the specific language governing rights and ## limitations under the License. ## ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. ## Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved. ## # Get default settings with user overrides for (RABBITMQ_)<var_name> # Non-empty defaults should be set in rabbitmq-env . `dirname $0`/rabbitmq-env # We specify Mnesia dir and sasl error logger since some actions # (e.g. forget_cluster_node --offline) require us to impersonate the # real node. RABBITMQ_USE_LONGNAME=${RABBITMQ_USE_LONGNAME} \ HOME=/var/lib/rabbitmq \ exec ${ERL_DIR}erl \ -pa "${RABBITMQ_HOME}/ebin" \ -noinput \ -hidden \ ${RABBITMQ_CTL_ERL_ARGS} \ -boot "${CLEAN_BOOT_FILE}" \ -sasl errlog_type error \ -mnesia dir "\"${RABBITMQ_MNESIA_DIR}\"" \ -s rabbit_control_main \ -nodename $RABBITMQ_NODENAME \ -extra "$@"

启用web管理台:

hongdada@ubuntu:/usr/lib/rabbitmq/bin$ sudo ./rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:mochiwebwebmachinerabbitmq_web_dispatchamqp_clientrabbitmq_management_agentrabbitmq_managementApplying plugin configuration to rabbit@ubuntu... failed.* Could not contact node rabbit@ubuntu.Changes will take effect at broker restart.* Options: --online  - fail if broker cannot be contacted.--offline - do not try to contact broker.

查看web管理器

127.0.0.1:15672

http://blog.csdn.net/sharetop/article/details/50523081

转载于:https://www.cnblogs.com/hao987/p/10194701.html

Ubuntu16.04 安装RabbitMQ相关推荐

  1. ubuntu16.04安装opencv3.4.1教程

    最近opencv3.4.1发布了,想换个新的试试鲜,于是把配置的过程通过博文的方式记录下来,方便查阅.  本教程原为3.3.0,但经过博主亲测,3.4.0.3.4.1皆适用 1.去官网下载opencv ...

  2. Ubuntu16.04 安装ftp

    2019独角兽企业重金招聘Python工程师标准>>> Ubuntu16.04 安装ftp,根据依赖安装. 安装vsftpd. sudo apt-get install vsftpd ...

  3. ubuntu16.04 安装CAJViewer 以及 安装wine /deepin-wine 图标异常的解决

    ubuntu16.04 安装CAJViewer 以及 安装wine /deepin-wine 图标异常的解决 通过deepin-wine 安装 cajviewer 之前装过deepin-wine 所以 ...

  4. ubuntu16.04 安装微信和qq

    ubuntu16.04 安装微信和qq Ubuntu系统没有qq和微信很难受,所以前几天装了一下qq和微信,在此记录下来,以防忘记. 通过 https://github.com/wszqkzqk/de ...

  5. Ubuntu16.04安装Chrome浏览器及解决root不能打开的问题

    Ubuntu16.04安装Chrome浏览器及解决root不能打开的问题 参考文章: (1)Ubuntu16.04安装Chrome浏览器及解决root不能打开的问题 (2)https://www.cn ...

  6. Linux入门(7)——Ubuntu16.04安装wps并解决系统缺失字体问题

    Linux入门(7)--Ubuntu16.04安装wps并解决系统缺失字体问题 参考文章: (1)Linux入门(7)--Ubuntu16.04安装wps并解决系统缺失字体问题 (2)https:// ...

  7. ubuntu16.04安装CUDA 8.0(很详尽,包括一些坑的解决方法)

    ubuntu16.04安装CUDA 8.0(很详尽,包括一些坑的解决方法) 参考文章: (1)ubuntu16.04安装CUDA 8.0(很详尽,包括一些坑的解决方法) (2)https://www. ...

  8. ubuntu16.04安装英伟达(NVIDIA)驱动——run文件安装

    ubuntu16.04安装英伟达(NVIDIA)驱动--run文件安装 去官网http://www.nvidia.com/Download/index.aspx?lang=en-us选择显卡驱动 中文 ...

  9. ubuntu16.04安装torch

    ubuntu16.04安装torch 第一步:从git上获取安装LuaJIT(C语言编写的Lua的解释器)和Torch所必需的依赖包: 在终端执行:git clone https://github.c ...

最新文章

  1. php 图片透明,PHP怎么把一张图片透明化
  2. 踩坑记录:请求接口status返回0
  3. check attribute active - how to check if SAP CRM WebClient UI property is read only
  4. html js点击字图片下拉,JavaScript实现文字与图片拖拽效果的方法
  5. 文章读后感--社会文明分析总结
  6. [iOS]深入浅出 iOS 之多线程 NSThread
  7. 学习笔记 Tianmao 篇 使用简单封装后的自定义OkHttp 获取json被GSON解析后的数据
  8. 服务器多开虚拟,个人服务器多开虚拟主机
  9. CTF线下攻防赛总结
  10. 网站死链接检测工具 Xenu 汉化版
  11. 织梦首页php打开慢,DEDECMS网站打开速度慢解决方法
  12. leetcode剑指Offer2
  13. CORBA 架构体系指南(通用对象请求代理体系架构)
  14. 快递公司不是服务商,企业微信也能寄件
  15. 推荐一款优秀的简历模板
  16. dijkstra迪杰斯特拉算法(邻接表法)
  17. 怎么学计算机知识竞赛,计算机基础学习知识竞赛题目答案解析.docx
  18. [mmc subsystem] mmc core(第一章)——概述
  19. 微博全量开放IP属地功能;“月薪三千能买什么样的手机”上热搜,苹果第一;​华为轮值董事长胡厚崑:没有自建芯片厂计划 | EA周报...
  20. 自动寻路算法python_关于Dijkstra算法和其他的一些图算法(Johnson, Floyd-Warshall, A*)解决最短路径问题的方法的Python实现。...

热门文章

  1. 修正memcache.php中的错误示例
  2. 企业管理 为什么老板再难,也不会放弃?而员工做得不顺,就想逃走?
  3. Tomcat 内存与优化篇
  4. MyBatis知多少(22)MyBatis删除操作
  5. 通过php extension使disable_function支持通配符
  6. 知识产权创业的比赛结果
  7. internship weekly task update
  8. CSSE*PTC student tutoring program student lecturers of 2018-2019 Academic Year.
  9. 啊,我南非时间上午10点看成了。。
  10. 妈妈再也不怕我不会画漂亮的图了!