目录
一、准备环境
1.下载Erlang
2.安装RabbitMQ
3.RabbitMQ安装时出现的问题
RabbitMQ的介绍:http://t.csdn.cn/6mSSu
一、准备环境
RabbitMQ是由Erlang语言开发的,所以需要安装Erlang环境以及配置对应的环境变量
1.下载Erlang
1.Erlang下载
官网下载地址:https://www.erlang.org/downloads
这里如果嫌官网下载麻烦,我这里提供了一个20.2的版本:
链接:https://pan.baidu.com/s/13c8brCA39gDJ8FnGdF3m1A
提取码:4vx4
2.安装Erlang
安装过程直接Next,安装路径选择自己需要安装的路径
3.配置环境变量
新建一个 变量名为 ERLNAG_HOME ,变量值为 对应的安装路径
然后找到 path 环境变量,将 %ERLANG_HOME%\bin 加到path环境变量中
4.验证安装是否成功
win+r 进入命令提示符中,输入 erl ,显示你对应的安装版本即为安装成功
2.安装RabbitMQ
1.RabbitMQ 下载
官方下载地址:RabbitMQ Project Announcements — RabbitMQ,下载的RabbitMQ版本要和对应的Erlang版本对应
同样的,这里也提供了一个对应的3.7.4的版本:
链接:https://pan.baidu.com/s/1PFUWTs3vMXldp09Eiymc2g
提取码:plit
2.配置
使用RabbitMQ管理插件RabbitMQ's Management Plugin,可以更好的可视化方式查看RabbitMQ服务器的状态。
win + r进入命令提示符,进入到RabbitMQ安装目录下的sbin目录下,进行RabbitMQ管理插件的安装,安装命令为:
rabbitmq-plugins enable rabbitmq_management
3.查看RabbitMQ是否安装是否成功
rabbitmqctl status
文末会附有RabbitMQ管理插件的常用命令
安装成功,cmd会出现如下场景:
Status of node rabbit@DESKTOP-UHFE6T9 ...
[{pid,6740},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.7.4"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.7.4"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.7.4"},
{amqp_client,"RabbitMQ AMQP Client","3.7.4"},
{rabbit,"RabbitMQ","3.7.4"},
{rabbit_common,
"Modules shared by rabbitmq-server and rabbitmq-erlang-client",
"3.7.4"},
{cowboy,"Small, fast, modern HTTP server.","2.2.2"},
{ranch_proxy_protocol,"Ranch Proxy Protocol Transport","1.4.4"},
{ranch,"Socket acceptor pool for TCP protocols.","1.4.0"},
{ssl,"Erlang/OTP SSL application","8.2.3"},
{public_key,"Public key infrastructure","1.5.2"},
{asn1,"The Erlang ASN1 compiler version 5.0.4","5.0.4"},
{cowlib,"Support library for manipulating Web protocols.","2.1.0"},
{crypto,"CRYPTO","4.2"},
{mnesia,"MNESIA CXC 138 12","4.15.2"},
{inets,"INETS CXC 138 49","6.4.5"},
{jsx,"a streaming, evented json parsing toolkit","2.8.2"},
{recon,"Diagnostic tools for production use","2.3.2"},
{xmerl,"XML parser","1.3.16"},
{os_mon,"CPO CXC 138 46","2.4.4"},
{lager,"Erlang logging framework","3.5.1"},
{goldrush,"Erlang event stream processor","0.1.9"},
{compiler,"ERTS CXC 138 10","7.1.4"},
{syntax_tools,"Syntax tools","2.1.4"},
{sasl,"SASL CXC 138 11","3.1.1"},
{stdlib,"ERTS CXC 138 10","3.4.3"},
{kernel,"ERTS CXC 138 10","5.4.1"}]},
{os,{win32,nt}},
{erlang_version,
"Erlang/OTP 20 [erts-9.2] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:64]\n"},
{memory,
[{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,2744},
{queue_procs,22832},
{queue_slave_procs,0},
{plugins,1092544},
{other_proc,28873160},
{metrics,198232},
{mgmt_db,182256},
{mnesia,76672},
{other_ets,2229952},
{binary,691456},
{msg_index,29616},
{code,28399402},
{atom,1123529},
{other_system,12419317},
{allocated_unused,16343152},
{reserved_unallocated,0},
{strategy,rss},
{total,[{erlang,75341712},{rss,91684864},{allocated,91684864}]}]},
{alarms,[]},
{listeners,
[{clustering,25672,"::"},
{amqp,5672,"::"},
{amqp,5672,"0.0.0.0"},
{http,15672,"::"},
{http,15672,"0.0.0.0"}]},
{vm_memory_calculation_strategy,rss},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,8524858982},
{disk_free_limit,50000000},
{disk_free,63748395008},
{file_descriptors,
[{total_limit,8092},
{total_used,3},
{sockets_limit,7280},
{sockets_used,0}]},
{processes,[{limit,1048576},{used,391}]},
{run_queue,0},
{uptime,8991},
{kernel,{net_ticktime,60}}]
没有出现这个,就说明安装失败,下面会附一些错误以及解决办法
4.进入RabbitMQ的管理页面:
地址为:http://localhost:15672/
默认用户名和密码都是 guest
这样RabbitMQ就成功安装成功了!
3.RabbitMQ安装时出现的问题
1.问题描述
命令提示符在输入
rabbitmqctl status
出现
Authentication failed(rejected by the remove node),please check the Erlang cookie
出现这个错误的原因就是 两个文件下的.erlang.cookie文件内容不一致
2.解决办法
分别找到这两个文件夹,对应的位置是
C:\Windows\System32\config\systemprofile\.erlang.cookie
C:\User\自己设置的电脑用户名\.erlang.cookie
这里会有一个问题:就是第一个路径下的文件夹无法打开,右键文件夹 ,点击属性,将该文件的只读取消掉,就可以查看;或者通过管理员运行命令提示符 找到对应的路径,就会自动在记事本中打开对应的文件文章来源:https://www.toymoban.com/news/detail-478407.html
修改两个文件中的内容为一致,再次执行,就成功啦!
附RabbitMQ管理插件的一些命令:文章来源地址https://www.toymoban.com/news/detail-478407.html
rabbitmqctl 的常用命令
# 查看服务器的状态
rabbitmqctl status
# 查看环境变量
rabbitmqctl environment
# 停止rabbitmq的应用
rabbitmqctl stop_app
# 启动rabbitmq的应用
rabbitmqctl start_app
# 添加用户
rabbitmqctl add_user <username> <password>
rabbitmqctl add_user uplooking 123456
# 列出所有的用户
rabbitmqctl list_users
# 将用户设置为管理员用户
rabbitmqctl set_user_tags uplooking administrator
# 查看虚拟主机
rabbitmqctl list_vhosts
# 添加虚拟主机
rabbitmqctl add_vhost /uplooking
rabbitmqctl add_vhost /uplooking/ops
rabbitmqctl add_vhost /uplooking/java
# 删除虚拟主机
rabbitmqctl delete_vhost /uplooking/java
# 查看默认虚拟主机的权限
rabbitmqctl list_permissions
# 设置用户的权限,.* 表示分别对 组件的配置文件、读权限、写权限
rabbitmqctl set_permissions -p /uplooking uplooking ".*" ".*" ".*"
# 查看虚拟主机的权限
rabbitmqctl list_permissions -p /uplooking
# 组件查看
rabbitmqctl list_queues -p /uplooking
到了这里,关于Windows环境下RabbitMQ的安装(安装过程以及解决安装过程的问题)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!