RabbitMQ搭建過程-基於Ubuntu16.04

安裝參考:官方文檔 http://www.rabbitmq.com/install-debian.html#apt

Installing Erlang Packages

Signing Key

In order to use the repository, add a key used to sign RabbitMQ releases to apt-key:html

wget -O - 'https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc' | sudo apt-key add -

This will instruct apt to trust packages signed by that key.ubuntu

Source List Filespa

As with all 3rd party Apt (Debian) repositories, a file describing the repository must be placed under the /etc/apt/sources.list.d/ directory. /etc/apt/sources.list.d/bintray.erlang.list is the recommended location. The file should have a source (repository) definition line that uses the following pattern:.net

# See below for supported distribution and component values
deb https://dl.bintray.com/rabbitmq/debian $distribution $component

The next couple of sections discuss what distribution and component values are supported.rest

deb http://dl.bintray.com/rabbitmq/debian xenial erlang-21.x

Installing Erlang Packages

After updating the list of apt sources it is necessary to run apt-get update:component

sudo apt-get update

Then packages can be installed just like with the standard Debian repositories:server

# or "erlang"
sudo apt-get install erlang-nox

避免版本更新:htm

Package pinning is configured with a file placed under the /etc/apt/preferences.d/ directory, e.g. /etc/apt/preferences.d/erlang. After updating apt preferences it is necessary to run apt-get update:blog

sudo apt-get update

The following preference file example will configure apt to install erlang-* packages from Bintray and not standard Debian or Ubuntu repository:rabbitmq

# /etc/apt/preferences.d/erlang
Package: erlang*
Pin: release o=Bintray
Pin-Priority: 1000

This apt preference configuration is recommended when the erlang repository component is used.

Effective package pinning policy can be verified with

sudo apt-cache policy

The following preference file example will pin all erlang-* packages to 20.3.8.2 (assuming package epoch for the package is 1):

# /etc/apt/preferences.d/erlang
Package: erlang*
Pin: version 1:20.3.8.2-1
Pin-Priority: 1000

 

RabbitMQ 安裝

2.1 添加簽名

wget -O - 'https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc' | sudo apt-key add -

在/etc/apt/sources.list.d/目錄下建立文件bintray.rabbitmq.list

# See below for supported distribution and component values
deb https://dl.bintray.com/rabbitmq/debian $distribution main

示例:

deb https://dl.bintray.com/rabbitmq/debian xenial main

下載安裝包:

sudo apt-get update

安裝

sudo apt-get install rabbitmq-server

啓動

root@ubuntu:/usr/lib/rabbitmq/bin# rabbitmq-server start

中止

root@ubuntu:/usr/lib/rabbitmq/bin# rabbitmq-server stop

啓動:sudo rabbitmq-server start
關閉: sudo rabbitmq-server stop
重啓: sudo rabbitmq-server restart
查看狀態:sudo rabbitmqctl status
相關文章
相關標籤/搜索