ubuntu18.04安装rabbitmq

服务器运维 / 147人浏览 / 0人评论

在虚拟机Oracle VM VirtualBox中安装rabitmq,安装rabbitMq之前看下Ubuntu版本信息,安装rabbitMq需要erlang语言的支持,安装rabbitMq之前需要安装erlang。

sudo apt-get install erlang-nox

vagrant@homestead:~$ sudo apt-get install erlang-nox
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
erlang-asn1 erlang-base erlang-crypto erlang-diameter erlang-edoc
erlang-eldap erlang-erl-docgen erlang-eunit erlang-ftp erlang-inets
erlang-mnesia erlang-odbc erlang-os-mon erlang-parsetools erlang-public-key
erlang-runtime-tools erlang-snmp erlang-ssh erlang-ssl erlang-syntax-tools
erlang-tftp erlang-tools erlang-xmerl libsctp1
Suggested packages:
erlang erlang-manpages erlang-doc xsltproc fop lksctp-tools
The following NEW packages will be installed:
erlang-asn1 erlang-base erlang-crypto erlang-diameter erlang-edoc
erlang-eldap erlang-erl-docgen erlang-eunit erlang-ftp erlang-inets
erlang-mnesia erlang-nox erlang-odbc erlang-os-mon erlang-parsetools
erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssh erlang-ssl
erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl libsctp1
0 upgraded, 25 newly installed, 0 to remove and 18 not upgraded.
Need to get 17.9 MB of archives.
After this operation, 31.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-base amd64 1:22.2.7+dfsg-1 [8,063 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-asn1 amd64 1:22.2.7+dfsg-1 [712 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-crypto amd64 1:22.2.7+dfsg-1 [137 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-mnesia amd64 1:22.2.7+dfsg-1 [716 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-runtime-tools amd64 1:22.2.7+dfsg-1 [182 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-public-key amd64 1:22.2.7+dfsg-1 [567 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-ssl amd64 1:22.2.7+dfsg-1 [1,103 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-syntax-tools amd64 1:22.2.7+dfsg-1 [344 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 erlang-diameter amd64 1:22.2.7+dfsg-1 [649 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-ftp amd64 1:22.2.7+dfsg-1 [68.8 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-tftp amd64 1:22.2.7+dfsg-1 [84.6 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-inets amd64 1:22.2.7+dfsg-1 [577 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-xmerl amd64 1:22.2.7+dfsg-1 [1,113 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 erlang-edoc amd64 1:22.2.7+dfsg-1 [280 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-eldap amd64 1:22.2.7+dfsg-1 [99.7 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 erlang-erl-docgen amd64 1:22.2.7+dfsg-1 [120 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 erlang-eunit amd64 1:22.2.7+dfsg-1 [134 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 erlang-odbc amd64 1:22.2.7+dfsg-1 [48.6 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-snmp amd64 1:22.2.7+dfsg-1 [1,538 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-os-mon amd64 1:22.2.7+dfsg-1 [81.2 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-parsetools amd64 1:22.2.7+dfsg-1 [151 kB]
Get:22 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-ssh amd64 1:22.2.7+dfsg-1 [640 kB]
Get:23 http://us.archive.ubuntu.com/ubuntu focal/main amd64 erlang-tools amd64 1:22.2.7+dfsg-1 [499 kB]
Get:24 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 erlang-nox all 1:22.2.7+dfsg-1 [12.8 kB]
Get:25 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libsctp1 amd64 1.0.18+dfsg-1 [7,876 B]
Fetched 17.9 MB in 4min 6s (72.8 kB/s)
Selecting previously unselected package erlang-base.
(Reading database ... 94893 files and directories currently installed.)
Preparing to unpack .../00-erlang-base_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-base (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-asn1.
Preparing to unpack .../01-erlang-asn1_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-asn1 (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-crypto.
Preparing to unpack .../02-erlang-crypto_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-crypto (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-mnesia.
Preparing to unpack .../03-erlang-mnesia_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-mnesia (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-runtime-tools.
Preparing to unpack .../04-erlang-runtime-tools_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-runtime-tools (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-public-key.
Preparing to unpack .../05-erlang-public-key_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-public-key (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-ssl.
Preparing to unpack .../06-erlang-ssl_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-ssl (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-syntax-tools.
Preparing to unpack .../07-erlang-syntax-tools_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-syntax-tools (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-diameter.
Preparing to unpack .../08-erlang-diameter_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-diameter (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-ftp.
Preparing to unpack .../09-erlang-ftp_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-ftp (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-tftp.
Preparing to unpack .../10-erlang-tftp_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-tftp (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-inets.
Preparing to unpack .../11-erlang-inets_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-inets (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-xmerl.
Preparing to unpack .../12-erlang-xmerl_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-xmerl (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-edoc.
Preparing to unpack .../13-erlang-edoc_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-edoc (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-eldap.
Preparing to unpack .../14-erlang-eldap_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-eldap (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-erl-docgen.
Preparing to unpack .../15-erlang-erl-docgen_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-erl-docgen (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-eunit.
Preparing to unpack .../16-erlang-eunit_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-eunit (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-odbc.
Preparing to unpack .../17-erlang-odbc_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-odbc (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-snmp.
Preparing to unpack .../18-erlang-snmp_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-snmp (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-os-mon.
Preparing to unpack .../19-erlang-os-mon_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-os-mon (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-parsetools.
Preparing to unpack .../20-erlang-parsetools_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-parsetools (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-ssh.
Preparing to unpack .../21-erlang-ssh_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-ssh (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-tools.
Preparing to unpack .../22-erlang-tools_1%3a22.2.7+dfsg-1_amd64.deb ...
Unpacking erlang-tools (1:22.2.7+dfsg-1) ...
Selecting previously unselected package erlang-nox.
Preparing to unpack .../23-erlang-nox_1%3a22.2.7+dfsg-1_all.deb ...
Unpacking erlang-nox (1:22.2.7+dfsg-1) ...
Selecting previously unselected package libsctp1:amd64.
Preparing to unpack .../24-libsctp1_1.0.18+dfsg-1_amd64.deb ...
Unpacking libsctp1:amd64 (1.0.18+dfsg-1) ...
Setting up erlang-base (1:22.2.7+dfsg-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/epmd.service → /lib/systemd/system/epmd.service.
Created symlink /etc/systemd/system/sockets.target.wants/epmd.socket → /lib/systemd/system/epmd.socket.
Searching for services which depend on erlang and should be started... none found.
Setting up erlang-odbc (1:22.2.7+dfsg-1) ...
Setting up erlang-xmerl (1:22.2.7+dfsg-1) ...
Setting up erlang-syntax-tools (1:22.2.7+dfsg-1) ...
Setting up erlang-eunit (1:22.2.7+dfsg-1) ...
Setting up erlang-parsetools (1:22.2.7+dfsg-1) ...
Setting up erlang-asn1 (1:22.2.7+dfsg-1) ...
Setting up erlang-tftp (1:22.2.7+dfsg-1) ...
Setting up libsctp1:amd64 (1.0.18+dfsg-1) ...
Setting up erlang-mnesia (1:22.2.7+dfsg-1) ...
Setting up erlang-crypto (1:22.2.7+dfsg-1) ...
Setting up erlang-runtime-tools (1:22.2.7+dfsg-1) ...
Setting up erlang-tools (1:22.2.7+dfsg-1) ...
Setting up erlang-snmp (1:22.2.7+dfsg-1) ...
Setting up erlang-public-key (1:22.2.7+dfsg-1) ...
Setting up erlang-ssh (1:22.2.7+dfsg-1) ...
Setting up erlang-ssl (1:22.2.7+dfsg-1) ...
Setting up erlang-diameter (1:22.2.7+dfsg-1) ...
Setting up erlang-os-mon (1:22.2.7+dfsg-1) ...
Setting up erlang-eldap (1:22.2.7+dfsg-1) ...
Setting up erlang-ftp (1:22.2.7+dfsg-1) ...
Setting up erlang-inets (1:22.2.7+dfsg-1) ...
Setting up erlang-edoc (1:22.2.7+dfsg-1) ...
Setting up erlang-erl-docgen (1:22.2.7+dfsg-1) ...
Setting up erlang-nox (1:22.2.7+dfsg-1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...

sudo apt-get update

vagrant@homestead:~$ sudo apt-get update
Hit:1 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Hit:2 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu focal InRelease
Get:3 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Hit:5 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,400 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [283 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [616 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [88.1 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [884 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [193 kB]
Err:15 https://deb.nodesource.com/node_14.x focal InRelease
Could not connect to deb.nodesource.com:443 (23.215.101.82), connection timed out Could not connect to deb.nodesource.com:443 (23.215.100.154), connection timed out
Get:16 http://us.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,069 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu focal-security/main Translation-en [197 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [566 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [80.9 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [668 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu focal-security/universe Translation-en [112 kB]
Fetched 6,549 kB in 50s (130 kB/s)
Reading package lists... Done
W: Failed to fetch https://deb.nodesource.com/node_14.x/dists/focal/InRelease Could not connect to deb.nodesource.com:443 (23.215.101.82), connection timed out Could not connect to deb.nodesource.com:443 (23.215.100.154), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

sudo apt-get install rabbitmq-server

vagrant@homestead:~$ sudo apt-get install rabbitmq-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
locales-all socat
The following NEW packages will be installed:
locales-all rabbitmq-server socat
0 upgraded, 3 newly installed, 0 to remove and 19 not upgraded.
Need to get 22.4 MB of archives.
After this operation, 249 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 locales-all amd64 2.31-0ubuntu9.2 [10.6 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/main amd64 socat amd64 1.7.3.3-2 [323 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 rabbitmq-server all 3.8.2-0ubuntu1.3 [11.5 MB]
Fetched 22.4 MB in 2min 41s (139 kB/s)
Selecting previously unselected package locales-all.
(Reading database ... 96290 files and directories currently installed.)
Preparing to unpack .../locales-all_2.31-0ubuntu9.2_amd64.deb ...
Unpacking locales-all (2.31-0ubuntu9.2) ...
Selecting previously unselected package socat.
Preparing to unpack .../socat_1.7.3.3-2_amd64.deb ...
Unpacking socat (1.7.3.3-2) ...
Selecting previously unselected package rabbitmq-server.
Preparing to unpack .../rabbitmq-server_3.8.2-0ubuntu1.3_all.deb ...
Unpacking rabbitmq-server (3.8.2-0ubuntu1.3) ...
Setting up locales-all (2.31-0ubuntu9.2) ...
Setting up socat (1.7.3.3-2) ...
Setting up rabbitmq-server (3.8.2-0ubuntu1.3) ...
Adding group `rabbitmq' (GID 131) ...
Done.
Adding system user `rabbitmq' (UID 126) ...
Adding new user rabbitmq' (UID 126) with group rabbitmq' ...
Not creating home directory `/var/lib/rabbitmq'.
Created symlink /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service → /lib/systemd/system/rabbitmq-server.service.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.13) ...

sudo rabbitmqctl status

vagrant@homestead:/$ sudo rabbitmqctl status
Status of node rabbit@homestead ...
Runtime

OS PID: 37524
OS: Linux
Uptime (seconds): 1622
RabbitMQ version: 3.8.2
Node name: rabbit@homestead
Erlang configuration: Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:64]
Erlang processes: 259 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

Plugins

Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:

Data directory

Node data directory: /var/lib/rabbitmq/mnesia/rabbit@homestead

Config files

Log file(s)

  • /var/log/rabbitmq/rabbit@homestead.log
  • /var/log/rabbitmq/rabbit@homestead_upgrade.log

Alarms

(none)

Memory

Calculation strategy: rss
Memory high watermark setting: 0.4 of available memory, computed to: 1.6508 gb
code: 0.0268 gb (30.76 %)
other_proc: 0.0232 gb (26.71 %)
allocated_unused: 0.02 gb (22.95 %)
other_system: 0.0126 gb (14.53 %)
other_ets: 0.0027 gb (3.09 %)
atom: 0.0012 gb (1.41 %)
metrics: 0.0002 gb (0.22 %)
binary: 0.0001 gb (0.13 %)
mnesia: 0.0001 gb (0.09 %)
quorum_ets: 0.0 gb (0.05 %)
msg_index: 0.0 gb (0.03 %)
plugins: 0.0 gb (0.01 %)
connection_channels: 0.0 gb (0.0 %)
connection_other: 0.0 gb (0.0 %)
connection_readers: 0.0 gb (0.0 %)
connection_writers: 0.0 gb (0.0 %)
mgmt_db: 0.0 gb (0.0 %)
queue_procs: 0.0 gb (0.0 %)
queue_slave_procs: 0.0 gb (0.0 %)
quorum_queue_procs: 0.0 gb (0.0 %)
reserved_unallocated: 0.0 gb (0.0 %)

File Descriptors

Total: 2, limit: 65439
Sockets: 0, limit: 58893

Free Disk Space

Low free disk space watermark: 0.05 gb
Free disk space: 189.3785 gb

Totals

Connection count: 0
Queue count: 0
Virtual host count: 1

Listeners

Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0

sudo rabbitmqctl stop

vagrant@homestead:/$ sudo rabbitmqctl stop
Stopping and halting node rabbit@homestead ...

sudo rabbitmq-server start

vagrant@homestead:/$ sudo rabbitmq-server start

## ## RabbitMQ 3.8.2
## ##
########## Copyright (c) 2007-2019 Pivotal Software, Inc.
###### ##
########## Licensed under the MPL 1.1. Website: https://rabbitmq.com

Doc guides: https://rabbitmq.com/documentation.html
Support: https://rabbitmq.com/contact.html
Tutorials: https://rabbitmq.com/getstarted.html
Monitoring: https://rabbitmq.com/monitoring.html

Logs: /var/log/rabbitmq/rabbit@homestead.log
/var/log/rabbitmq/rabbit@homestead_upgrade.log

Config file(s): (none)

Starting broker... completed with 0 plugins.
^C
Session terminated, killing shell...Stopping and halting node rabbit@homestead ...
Gracefully halting Erlang VM
...killed.

sudo rabbitmqctl add_user admin admin

vagrant@homestead:/$ sudo rabbitmqctl add_user admin admin
Adding user "admin" ...

sudo rabbitmqctl set_user_tags admin administrator

vagrant@homestead:/$ sudo rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...

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

vagrant@homestead:/$ sudo rabbitmqctl set_permissions -p / admin '.' '.' '.*'
Setting permissions for user "admin" in vhost "/" ...

sudo rabbitmq-plugins enable rabbitmq_management

vagrant@homestead:/$ sudo rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@homestead:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@homestead...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch

started 3 plugins.

浏览器:http://localhost:15672

登录账号:admin 登录密码:admin

rabbitmq_management

rabbitmq_management

转载注明:

扩展查找

0 条评论

还没有人发表评论

发表评论 取消回复

记住我的信息,方便下次评论
有人回复时邮件通知我