在Windows10环境下安装RabbitMAQ、Erlang的坑
描述:本人学习Spring Boot过程中需要用到RabbitMAQ,所以就去安装了。途中踩了无数个坑,哎呦,疼死我了。花了一天多的时间才解决,所以想花点时间来记录下一自己踩的坑。这里啰嗦一下,也是帮老师宣传一下,想要学习spring boot 的同学,可以去看看这份资料:
说一下采坑主要的原因:我自己的主要是RabbitMAQ和Erlang之间版本的冲突问题。导致我无法访问http://localhost:15672。然后就浪费了很多时间去改其他的错误,结果也没能实现。
马上介绍RabbitMAQ和Erlang的安装过程
当初我也没能安装成功,在网上查找到了这位博主的教程(对我有了启发,也是问题的一个突破点):
https://blog.csdn.net/weixin_39735923/article/details/79288578
-
先下载安装Elrang(RabbitMQ服务端代码是使用并发式语言Erlang编写的,安装Rabbit MQ的前提是安装Erlang。)
-
安装地址:http://www.erlang.org/downloads
注意:我下载的Elrang的版本是20.2。原因后面会说。
-
点击进入
我是下载的windows 64 bit的
-
下载完之后,一路点击next即可,对应的安装目录因人而于,这里不罗嗦了。
-
接下来就是Elrang配置环境变量,windows 10 的环境变量的进入步骤我这里就不说了。
进入环境变量->添加系统变量->新建->确定
变量名:ERLANG_HOME
路径:D:\tool\Erlang\erl9.2(换成你的安装路径)
-
然后再Path中添加 %ERLANG_HOME%\bin
-
最后检测Elrang是否安装成功:打开命令行:windows+r,windows也就是键盘左下角的图标。打开如下,
成功
-
-
再下载安装RabbitMAQ
-
下载地址:http://www.rabbitmq.com/download.html
官网的版本比较新,不要下载最新版本的,点击进入。
我选择的3.7.3版本,后面会解释原因。
选择rabbitmq-server-3.7.3.exe进行安装。
-
和上面的Elrangd的一样,一路next的,安装完成后。
-
打开RabbitMAQ的安装目录到sbin
-
输入cmd,打开命令行
然后在后面输入rabbitmq-plugins enable rabbitmq_management命令进行安装
最后,回到RabbitMAQ的安装目录sbin中,点击
运行的结果这个
表示服务器启动成功
-
默认的用户名和密码都是:guest。
-
-
现在来说说为什么选择Elrang20.2版本和RabbitMAQ 3.7.3本版
原因:我之前都一直失败因为我选择了Elrang20.2版本,但是我选择了RabbitMAQ 3.7.7+以上的版本,在我运行到RabbitMAQ的安装目录sbin中的rabbitmq-server.bat时候,出现了这个问题:
bad “MBa” value: ageffcbfUsage: beam.smp.dll [flags] [ – [init_args] ]
The flags are:-a size suggested stack size in kilo words for threads
in the async-thread pool, valid range is [16-8192]
-A number set number of threads in async thread pool,
valid range is [0-1024]
-B[c|d|i] c to have Ctrl-c interrupt the Erlang shell,
d (or no extra option) to disable the break
handler, i to ignore break signals
-c bool enable or disable time correction
-C mode set time warp mode; valid modes are:
no_time_warp|single_time_warp|multi_time_warp
-d don’t write a crash dump for internally detected errors
(halt(String) will still produce a crash dump)
-fn[u|a|l] Control how filenames are interpreted
-hms size set minimum heap size in words (default 233)
-hmbs size set minimum binary virtual heap size in words (default 32768)
-hmax size set maximum heap size in words (default 0)
-hmaxk bool enable or disable kill at max heap size (default true)
-hmaxel bool enable or disable error_logger report at max heap size (default t
rue)
-hpds size initial process dictionary size (default 8)
-hmqd val set default message queue data flag for processes,
valid values are: off_heap | on_heap
-K boolean enable or disable kernel poll
-n[s|a|d] Control behavior of signals to ports
Note that this flag is deprecated!
-M memory allocator switches,
see the erts_alloc(3) documentation for more info.
-pc Control what characters are considered printable (default latin1)-P number set maximum number of processes on this node,
valid range is [1024-134217727]
-Q number set maximum number of ports on this node,
valid range is [1024-134217727]
-R number set compatibility release number,
valid range [18-20]
-r force ets memory block to be moved on realloc
-rg amount set reader groups limit
-sbt type set scheduler bind type, valid types are:
-stbt type u|ns|ts|ps|s|nnts|nnps|tnnps|db
-sbwt val set scheduler busy wait threshold, valid values are:
none|very_short|short|medium|long|very_long.
-scl bool enable/disable compaction of scheduler load,
see the erl(1) documentation for more info.
-sct cput set cpu topology,
see the erl(1) documentation for more info.
-secio bool enable/disable eager check I/O scheduling,
see the erl(1) documentation for more info.
-sub bool enable/disable scheduler utilization balancing,
see the erl(1) documentation for more info.
-sws val set scheduler wakeup strategy, valid values are:
default|legacy.
-swct val set scheduler wake cleanup threshold, valid values are:
very_lazy|lazy|medium|eager|very_eager.
-swt val set scheduler wakeup threshold, valid values are:
very_low|low|medium|high|very_high.
-sss size suggested stack size in kilo words for scheduler threads,
valid range is [20-8192] (default 128)
-sssdcpu size suggested stack size in kilo words for dirty CPU scheduler
threads, valid range is [20-8192] (default 40)
-sssdio size suggested stack size in kilo words for dirty IO scheduler
threads, valid range is [20-8192] (default 40)
-spp Bool set port parallelism scheduling hint
-S n1:n2 set number of schedulers (n1), and number of
schedulers online (n2), maximum for both
numbers is 1024
-SP p1:p2 specify schedulers (p1) and schedulers online (p2)
as percentages of logical processors configured and logical
processors available, respectively
-SDcpu n1:n2 set number of dirty CPU schedulers (n1), and number of
dirty CPU schedulers online (n2), valid range for both
numbers is [1-1024], and n2 must be less than or equal to n1
-SDPcpu p1:p2 specify dirty CPU schedulers (p1) and dirty CPU schedulers
online (p2) as percentages of logical processors configured
and logical processors available, respectively
-SDio n set number of dirty I/O schedulers, valid range is [0-1024]
-t size set the maximum number of atoms the emulator can handle
valid range is [8192-2147483647]
-T number set modified timing level, valid range is [0-9]
-V print Erlang version
-v turn on chatty mode (GCs will be reported etc)
-W<i|w|e> set error logger warnings mapping,
see error_logger documentation for details
-zdbbl size set the distribution buffer busy limit in kilobytes
valid range is [1-2097151]
-zdntgc time set delayed node table gc in seconds
valid values are infinity or intergers in the range [0-100000000]Note that if the emulator is started with erlexec (typically
from the erl script), these flags should be specified with +.
我去网上找了**bad “MBa” value: ageffcbfUsage: beam.smp.dll [flags] [ – [init_args] ]**类似的问题,也找到了相应的答案:
https://groups.google.com/forum/#!msg/rabbitmq-users/vtNMTzMw88I/S52tBIJ1AwAJ
好心的外国网友给出了这样的答案:
1.您的Erlang版本不支持某些运行时分配器标志3.7.6和更高版本
版本使用。但是,在Erlang <20.2.1上使用了一组不同的标志。
2.最简单的选择是卸载存在的所有Erlang版本,然后安装Erlang 20.3或21.0(对于3.7.7+)。
如果你选择了RabbitMAQ 3.7.7+以上的版本,那么请选择Erlang 20.3或21.0的版本。还有一个方法就是你选择我这个版本,因为其他版本我也没有试过,不知道其他版本能不能向适配。
更高版本
版本使用。但是,在Erlang <20.2.1上使用了一组不同的标志。
2.最简单的选择是卸载存在的所有Erlang版本,然后安装Erlang 20.3或21.0(对于3.7.7+)。
如果你选择了RabbitMAQ 3.7.7+以上的版本,那么请选择Erlang 20.3或21.0的版本。还有一个方法就是你选择我这个版本,因为其他版本我也没有试过,不知道其他版本能不能向适配。