以下是RabbitMQ单机版部署安装过程的完整攻略,包含两个示例说明。
示例1:Ubuntu系统下的安装
步骤1:安装Erlang
RabbitMQ是使用Erlang编写的,因此您需要先安装Erlang。在Ubuntu系统下,您可以使用以下命令安装:
sudo apt-get update
sudo apt-get install erlang
步骤2:安装RabbitMQ
在Ubuntu系统下,您可以使用以下命令安装RabbitMQ:
sudo apt-get install rabbitmq-server
步骤3:启动RabbitMQ
使用以下命令启动RabbitMQ:
sudo systemctl start rabbitmq-server
步骤4:检查RabbitMQ状态
使用以下命令检查RabbitMQ状态:
sudo systemctl status rabbitmq-server
如果RabbitMQ正在运行,您将看到以下输出:
● rabbitmq-server.service - RabbitMQ Messaging Server
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-08-23 14:22:22 UTC; 1min 30s ago
Main PID: 1234 (beam.smp)
Tasks: 89 (limit: 1137)
CGroup: /system.slice/rabbitmq-server.service
├─1234 /usr/lib/erlang/erts-10.3.5.6/bin/beam.smp -W w -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 32000 -K true -B i -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.8.2/sbin/../ebin /usr/lib/rabbitmq/lib/rabbitmq_server-3.8.2/sbin/../deps -noshell -noinput -s rabbit boot -sname rabbit@localhost -boot start_sasl -config /etc/rabbitmq/rabbitmq -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@localhost.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@localhost-sasl.log"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.8.2/sbin/../plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@localhost-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@localhost"
├─1393 /usr/lib/erlang/erts-10.3.5.6/bin/epmd -daemon
├─1477 erl_child_setup 65536
├─1509 inet_gethost 4
└─1510 inet_gethost 4
步骤5:访问RabbitMQ管理界面
RabbitMQ提供了一个Web管理界面,您可以使用它来管理RabbitMQ。默认情况下,该界面在端口15672上运行。在浏览器中输入以下URL以访问该界面:
http://localhost:15672/
您将看到一个登录页面。使用默认的用户名和密码(guest/guest)登录即可。
示例2:Windows系统下的安装
步骤1:下载安装程序
在Windows系统下,您可以从RabbitMQ官网下载适合您系统的安装程序进行安装。
步骤2:安装RabbitMQ
运行下载的安装程序,按照提示进行安装。
步骤3:启动RabbitMQ
在Windows系统下,您可以使用以下命令启动RabbitMQ:
net start RabbitMQ
步骤4:检查RabbitMQ状态
使用以下命令检查RabbitMQ状态:
rabbitmqctl status
如果RabbitMQ正在运行,您将看到以下输出:
Status of node rabbit@localhost ...
[{pid,1234},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.8.2"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.8.2"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.8.2"},
{rabbit,"RabbitMQ","3.8.2"},
{rabbit_common,[],"3.8.2"},
{cowboy,"Small, fast, modern HTTP server.","2.7.0"},
{cowlib,"Support library for manipulating Web protocols.","2.8.0"},
{jsx,"a streaming, evented json parsing toolkit","2.9.3"},
{ranch,"Socket acceptor pool for TCP protocols.","1.7.1"},
{ssl,"Erlang/OTP SSL application","10.3.5.6"},
{public_key,"Public key infrastructure","1.7.4"},
{asn1,"The Erlang ASN1 compiler version 5.0.8","5.0.8"},
{os_mon,"CPO CXC 138 46","2.4.7"},
{recon,"Diagnostic tools for production use","2.5.1"},
{crypto,"CRYPTO","4.6.5"},
{lager,"Erlang logging framework","3.8.0"},
{goldrush,"Erlang event stream processor","0.2.0"},
{compiler,"ERTS CXC 138 10","7.4.7"},
{syntax_tools,"Syntax tools","2.3.2"},
{sasl,"SASL CXC 138 11","3.4.2"},
{stdlib,"ERTS CXC 138 10","3.11.3"},
{kernel,"ERTS CXC 138 10","6.5.3"}]},
{os,{win32,nt}},
{erlang_version,
"Erlang/OTP 22 [erts-10.3.5.6] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:64] [hipe]\n"},
{memory,
[{total,1048576},
{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,0},
{queue_procs,0},
{queue_slave_procs,0},
{plugins,0},
{other_proc,0},
{mnesia,0},
{mgmt_db,0},
{msg_index,0},
{other_ets,0},
{binary,0},
{code,0},
{atom,0},
{other_system,0}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,2147483648},
{disk_free_limit,50000000},
{disk_free,100000000000},
{file_descriptors,
[{total_limit,1048576},
{total_used,2},
{sockets_limit,943626},
{sockets_used,0}]},
{processes,[{limit,1048576},{used,38}]},
{run_queue,0},
{uptime,10}]
步骤5:访问RabbitMQ管理界面
同示例1。
以上就是RabbitMQ单机版部署安装过程的完整攻略,包含两个示例说明。
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:RabbitMQ单机版部署安装过程 - Python技术站