rabbitmq推荐的安装方式:
1、首先让我们的系统信任我们要增加的源:
wget -O - 'https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc' | sudo apt-key add -
2、增加erlang和rabbitmq源:
echo "deb https://dl.bintray.com/rabbitmq/debian bionic main erlang" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
3、源更新过后要运行:
apt-get update
4、卸载erlang rabbitmq(如果之前安装过的话):
apt-get remove rabbitmq
apt-get purge erlang
apt-get autoremove
5、重新安装erlang 和 rabbitmq:
apt-get install erlang
apt-get install rabbitmq-server
6、再检查rabbitmq的版本:
已经是最新版本的3.7.8
root@imhqq-Lenovo-H5050:/etc/yum/repos.d# rabbitmqctl status
Status of node rabbit@imhqq-Lenovo-H5050 ...
[{pid,9186},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.7.8"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.7.8"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.7.8"},
{rabbit,"RabbitMQ","3.7.8"},
{amqp_client,"RabbitMQ AMQP Client","3.7.8"},
{rabbit_common,
"Modules shared by rabbitmq-server and rabbitmq-erlang-client",
"3.7.8"},
{xmerl,"XML parser","1.3.18"},
{cowboy,"Small, fast, modern HTTP server.","2.2.2"},
{ranch_proxy_protocol,"Ranch Proxy Protocol Transport","1.5.0"},
{ranch,"Socket acceptor pool for TCP protocols.","1.5.0"},
{ssl,"Erlang/OTP SSL application","9.0.2"},
{cowlib,"Support library for manipulating Web protocols.","2.1.0"},
{public_key,"Public key infrastructure","1.6.2"},
{crypto,"CRYPTO","4.3.3"},
{os_mon,"CPO CXC 138 46","2.4.6"},
{asn1,"The Erlang ASN1 compiler version 5.0.7","5.0.7"},
{inets,"INETS CXC 138 49","7.0.2"},
{mnesia,"MNESIA CXC 138 12","4.15.5"},
{recon,"Diagnostic tools for production use","2.3.2"},
{jsx,"a streaming, evented json parsing toolkit","2.8.2"},
{lager,"Erlang logging framework","3.6.3"},
{goldrush,"Erlang event stream processor","0.1.9"},
{compiler,"ERTS CXC 138 10","7.2.5"},
{syntax_tools,"Syntax tools","2.1.6"},
{syslog,"An RFC 3164 and RFC 5424 compliant logging framework.","3.4.3"},
{sasl,"SASL CXC 138 11","3.2.1"},
{stdlib,"ERTS CXC 138 10","3.6"},
{kernel,"ERTS CXC 138 10","6.1"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:64]\n"},
{memory,
[{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,2732},
{queue_procs,0},
{queue_slave_procs,0},
{plugins,884420},
{other_proc,25424228},
{metrics,195156},
{mgmt_db,153568},
{mnesia,73296},
{other_ets,2777528},
{binary,82360},
{msg_index,29248},
{code,23232739},
{atom,1131721},
{other_system,11410132},
{allocated_unused,11017848},
{reserved_unallocated,184320},
{strategy,rss},
{total,[{erlang,65397128},{rss,76599296},{allocated,76414976}]}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{http,15672,"::"}]},
{vm_memory_calculation_strategy,rss},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,1621490073},
{disk_free_limit,50000000},
{disk_free,918664015872},
{file_descriptors,
[{total_limit,924},{total_used,2},{sockets_limit,829},{sockets_used,0}]},
{processes,[{limit,1048576},{used,381}]},
{run_queue,1},
{uptime,238},
{kernel,{net_ticktime,60}}]
root@imhqq-Lenovo-H5050:/etc/yum/repos.d#
7、查看rabbitmq-server status
(myshop) root@imhqq-Lenovo-H5050:/home/imhqq/mysite/chap_7/myshop/myshop# service rabbitmq-server status
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: active (running) since 日 2018-11-11 13:36:46 CST; 9min ago
Process: 10366 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl shutdown (code=exited, status=0/SUCCESS)
Main PID: 10512 (beam.smp)
Status: "Initialized"
CGroup: /system.slice/rabbitmq-server.service
├─10512 /usr/lib/erlang/erts-10.1/bin/beam.smp -W w -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P
├─10610 /usr/lib/erlang/erts-10.1/bin/epmd -daemon
├─10772 erl_child_setup 32768
├─10795 inet_gethost 4
└─10796 inet_gethost 4
11月 11 13:36:45 imhqq-Lenovo-H5050 rabbitmq-server[10512]: ## ## RabbitMQ 3.7.8. Copyright (C) 2007-2018 Pivotal Software, Inc.
11月 11 13:36:45 imhqq-Lenovo-H5050 rabbitmq-server[10512]: ########## Licensed under the MPL. See http://www.rabbitmq.com/
11月 11 13:36:45 imhqq-Lenovo-H5050 rabbitmq-server[10512]: ###### ##
11月 11 13:36:45 imhqq-Lenovo-H5050 rabbitmq-server[10512]: ########## Logs: /var/log/rabbitmq/rabbit@imhqq-Lenovo-H5050.log
11月 11 13:36:45 imhqq-Lenovo-H5050 rabbitmq-server[10512]: /var/log/rabbitmq/rabbit@imhqq-Lenovo-H5050_upgrade.log
11月 11 13:36:45 imhqq-Lenovo-H5050 rabbitmq-server[10512]: Starting broker...
11月 11 13:36:46 imhqq-Lenovo-H5050 rabbitmq-server[10512]: systemd unit for activation check: "rabbitmq-server.service"
11月 11 13:36:46 imhqq-Lenovo-H5050 systemd[1]: Started RabbitMQ broker.
11月 11 13:36:46 imhqq-Lenovo-H5050 rabbitmq-server[10512]: completed with 3 plugins.