RABBITMQ installation and configuration under Ubuntu 16.04

Source: Internet
Author: User
Tags rabbitmq

Installing RABBITMQ

Since RABBITMQ requires the support of the Erlang language, you need to install Erlang before installing RABBITMQ to execute the command:

sudo apt-get install Erlang-nox
To install the RABBITMQ command:

2.$ sudo apt-get update
3.$ sudo apt-get install Rabbitmq-server
Start, stop, restart, status RABBITMQ command:

Start: sudo rabbitmq-server start
Off: sudo rabbitmq-server stop
Restart: sudo rabbitmq-server restart
View status: sudo rabbitmqctl status
You can use Ps-ef|grep rabbit to view the RABBITMQ after you have installed it.

Copy Code
[Email protected]:~$ 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 [email protected]-boot Start_sasl-kernel inet_default_connect_option s [{nodelay,true}]-sasl errlog_type error-sasl sasl_error_logger false-rabbit error_logger {file, "/var/log/rabbitmq/[ Email protected] "}-rabbit sasl_error_logger {file,"/var/log/rabbitmq/[email protected] "}-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/[email protected] "-os_mon start_cpu_sup false- Os_mon start_disksup false-os_mon start_memsup false-mnesia dir "/var/lib/rabbitmq/mnesia/[email protected]"- 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
[Email protected]:~$ cd/usr/lib/rabbitmq/bin/
Copy Code
Look no problem, now go to the installation folder to see the status of Rabbit:

Copy Code
[Email protected]:~$ cd/usr/lib/rabbitmq/bin/
[Email protected]:/usr/lib/rabbitmq/bin$ sudo./rabbitmqctl status
Status of node [email protected] ...
Error:unable to connect to node [email protected]: Nodedown

Diagnostics

Attempted to contact: [[email protected]]

[Email protected]:

    • 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: ' [email protected] '
    • Home dir:/home/hongdada
    • Cookie hash:0prvafctz6wksc1gzlmk7q==
      Copy Code
      There is an error, to modify the configuration, first stop the service

Copy Code
[Email protected]:/usr/lib/rabbitmq/bin$ invoke-rc.d rabbitmq-server Stop
= = = Authenticating for org.freedesktop.systemd1.manage-units = = =
Authentication is required to stop "Rabbitmq-server.service".
Authenticating As:hongda,,, (Hongdada)
Password:
= = = Authentication Complete = =
Copy Code
Go to the installation folder/usr/lib/rabbitmq/bin

Modify the Rabbitmqctl file

Add a line home configuration: Add red places

Copy Code
#!/bin/sh-e

The contents of this file is subject to the Mozilla public Licenseversion 1.1 (the "License"); Except incompliance with the License. May obtain a copy of the Licenseat http://www.mozilla.org/MPL/

##

Software distributed under the License is distributed on a "as is" basis, without WARRANTY of any KIND, either express or Implied. Seethe License for the specific language governing rights andlimitations 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 the user overrides for (rabbitmq_) <var_name>non-empty defaults should is 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 Impersona Te thereal 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 "[Email protected]"
Copy Code
To enable the Web Management console:

Copy Code
[Email protected]:/usr/lib/rabbitmq/bin$ sudo./rabbitmq-plugins Enable Rabbitmq_management
The following plugins has been enabled:
Mochiweb
Webmachine
Rabbitmq_web_dispatch
Amqp_client
Rabbitmq_management_agent
Rabbitmq_management

Applying plugin configuration to [email protected] failed.

    • Could not contact node [email protected]
      Changes would take the effect at broker restart.
    • Options:--online-fail If broker cannot be contacted.
      --offline-do not a try to contact broker.
      Copy Code
      View Web Manager

127.0.0.1:15672

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

Open Administration page
sudo rabbitmq-plugins enable rabbitmq_management

To view installed plugins
sudo rabbitmqctl list_users

View User
sudo rabbitmqctl list_users

New Admin user
sudo rabbitmqctl add_user admin admin
sudo rabbitmqctl set_user_tags admin Administrator

Log in to the admin page with the account you just set up

http://127.0.0.1:15672

Map Big Data Cloud Platform www.favxu.com

Three-dimensional Earth cloud platform 3d.favxu.com

Map Cloud Platform Exchange Cooperation qq:63747667

Email: [Email protected]

RABBITMQ installation and configuration under Ubuntu 16.04

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.