在Ubuntu 16.04 LTS上安装Rabbitmq 3.7.4

前端之家收集整理的这篇文章主要介绍了在Ubuntu 16.04 LTS上安装Rabbitmq 3.7.4前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1 安装依赖

1.1 Adding repository entry

lwk@ubuntu:~$ wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
lwk@ubuntu:~$ sudo dpkg -i erlang-solutions_1.0_all.deb

1.2 手动添加软件源

创建文件/etc/apt/sources.list/erlang.list

lwk@ubuntu:~$ sudo vim /etc/apt/sources.list/erlang.list

填写如下内容

deb https://packages.erlang-solutions.com/ubuntu trusty contrib
deb https://packages.erlang-solutions.com/ubuntu saucy contrib
deb https://packages.erlang-solutions.com/ubuntu precise contrib

保存。

1.3 添加key

lwk@ubuntu:~$ wget https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
lwk@ubuntu:~$ sudo apt-key add erlang_solutions.asc

1.4 更新

lwk@ubuntu:~$ apt update

1.5 安装

lwk@ubuntu:~$ apt install esl-erlang -y

2 安装

2.1 添加软件源

lwk@ubuntu:~$ echo "deb https://dl.bintray.com/rabbitmq/debian xenial main" | sudo tee etc/apt/sources.list.d/bintray.rabbitmq.list

2.2 添加key

lwk@ubuntu:~$ wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -

2.3 更新

lwk@ubuntu:~$ apt update

2.4 安装

lwk@ubuntu:~$ apt install rabbitmq-server -y
[sudo] password for lwk: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  socat
The following NEW packages will be installed:
  rabbitmq-server socat
0 upgraded,2 newly installed,0 to remove and 0 not upgraded.
Need to get 11.9 MB of archives.
After this operation,14.3 MB of additional disk space will be used.
Get:1 https://mirrors.ustc.edu.cn/ubuntu xenial/universe amd64 socat amd64 1.7.3.1-1 [321 kB]
Get:2 https://dl.bintray.com/rabbitmq/debian xenial/main amd64 rabbitmq-server all 3.7.4-1 [11.6 MB]
Fetched 11.9 MB in 6s (1937 kB/s)                                                                                                                                                                                                            
perl: warning: Setting locale Failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),LC_ALL = (unset),LC_MONETARY = "zh_CN.UTF-8",LC_ADDRESS = "zh_CN.UTF-8",LC_TELEPHONE = "zh_CN.UTF-8",LC_NAME = "zh_CN.UTF-8",LC_MEASUREMENT = "zh_CN.UTF-8",LC_IDENTIFICATION = "zh_CN.UTF-8",LC_NUMERIC = "zh_CN.UTF-8",LC_PAPER = "zh_CN.UTF-8",LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting prevIoUsly unselected package socat.
(Reading database ... 80374 files and directories currently installed.)
Preparing to unpack .../socat_1.7.3.1-1_amd64.deb ...
Unpacking socat (1.7.3.1-1) ...
Selecting prevIoUsly unselected package rabbitmq-server.
Preparing to unpack .../rabbitmq-server_3.7.4-1_all.deb ...
Unpacking rabbitmq-server (3.7.4-1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up socat (1.7.3.1-1) ...
Setting up rabbitmq-server (3.7.4-1) ...
Adding group `rabbitmq' (GID 119) ...
Done.
Adding system user `rabbitmq' (UID 112) ... Adding new user `rabbitmq' (UID 112) with group `rabbitmq' ...
Not creating home directory `/var/lib/rabbitmq'. Processing triggers for systemd (229-4ubuntu21.2) ... Processing triggers for ureadahead (0.100.0-19) ... lwk@ubuntu:~$ sudo service --status-all |grep rabbitmq [ + ] rabbitmq-server lwk@ubuntu:~$ 

4 配置

4.1 添加用户

lwk@ubuntu:~$ sudo rabbitmqctl add_user admin admin
[sudo] password for lwk: 
Adding user "admin" ...
lwk@ubuntu:~$ sudo rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
lwk@ubuntu:~$ sudo rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
Setting permissions for user "admin" in vhost "/" ...
lwk@ubuntu:~$

4.2 配置Web管理控制台

lwk@ubuntu:~$ sudo rabbitmq-plugins enable rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@ubuntu...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

started 3 plugins.
lwk@ubuntu:~$ 

5 管理

参考文献
-Installation erlang using repository
-How to Install RabbitMQ Server on Ubuntu 16.04 & 14.04

猜你在找的Ubuntu相关文章