RocketMQ搭建二

搭建中win7环境安装VMware Workstation虚拟机、CentOS6

1.遇到内存不足问题
[[email protected] RocketMQ]$ Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000005c0000000, 8589934592, 0) failed; error='Cannot allocate   mory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8589934592 bytes for committing reserved memory.

RocketMQ搭建二

解决办法:

在bin目录中编辑runbroker.sh和runserver.sh的jvm大小,

vi runbroker.sh

设置-server -Xms128m -Xmx128m -Xmn128m

vi runserver.sh

设置-server -Xms128m -Xmx128m -Xmn128m

2.防火墙问题,iptables防火墙

这个很容易被忽视,或者是一不小心被打开,步骤依然如上

(1)先查看其状态

service iptables status

(2)如果开着将其关闭

service iptables stop                --临时关闭防火墙

3.开始mq服务

1).启动nameserver管理,需要在bin目录之上启动或者在bin直接sh mqnamesrv &也可以

sh bin/mqnamesrv &

2). 启动 Broker,需要在bin目录之上启动或者在bin直接 bin/mqbroker -n localhost:9876 &

sh bin/mqbroker -n localhost:9876 &

3)根据http://rocketmq.apache.org/docs/simple-example/快速上手

RocketMQ搭建二

RocketMQ搭建二

因为MQ的消息机制,消费者会定时pull消息,生产者生产消息,无特定顺序要求,亲自验证靠谱,希望可以帮助到有需要的人