RocketMQ集群搭建
参考文章
搭建部署流程:
graph LR
创建日志保存目录-->启动mqnamesrv
启动mqnamesrv-->启动mqbroker
启动mqbroker-->启动控制台
配置修改:
- 修改broker-a.properties配置
- 修改控制台启动配置
mkdir -p /data/logs/rocketmqlogs
cd /app/mid/rocketmq/bin/
nohup sh mqnamesrv > /data/logs/rocketmqlogs/mqnamesrv.log 2>&1 &
ps -ef|grep mqnamesrv
cd /app/mid/rocketmq/bin/
nohup sh mqbroker -c ../conf/2m-2s-sync/broker-a.properties > /data/logs/rocketmqlogs/broker-a.log 2>&1 &
nohup sh mqbroker -c ../conf/2m-2s-sync/broker-b.properties > /data/logs/rocketmqlogs/broker-b.log 2>&1 &
nohup sh mqbroker -c ../conf/2m-2s-sync/broker-a-s.properties > /data/logs/rocketmqlogs/broker-a-s.log 2>&1 &
nohup sh mqbroker -c ../conf/2m-2s-sync/broker-b-s.properties > /data/logs/rocketmqlogs/broker-b-s.log 2>&1 &
ps -ef|grep mqbroker
# mkdir -p /data/logs/rocketmqlogs
# sed -i 's#${user.home}/logs/#/data/logs/#g' conf/logback_broker.xml
# sed -i 's#${user.home}/logs/#/data/logs/#g' conf/logback_namesrv.xml
# sed -i 's#${user.home}/logs/#/data/logs/#g' conf/logback_tools.xm
l
# vim bin/runbroker.sh
// 根据机器实际内存调整,这里演示的机器内存比较小,配置的值比较小
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m"
# vim bin/runserver.sh
// 根据机器实际内存调整,这里演示的机器内存比较小,配置的值比较小
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
# vim bin/tools.sh
// 根据机器实际内存调整,这里演示的机器内存比较小,配置的值比较小
JAVA_OPT="${JAVA_OPT} -server -Xms128m -Xmx128m -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=128m"
redis集群部署
1.启动节点
/app/mid/redis-cluster/redis-8002/bin/redis-server /app/mid/redis-cluster/redis-8002/bin/redis.conf
2.集群配置
现在redis集群部署可以直接使用 redis-cli
./redis-cli --cluster create --cluster-replicas 1 10.2.92.92:8001 10.2.92.92:8002 10.2.92.106:8003 10.2.92.106:8004 10.2.92.184:8005 10.2.92.184:8006
3.验证
./redis-cli -c -h 10.2.92.92 -p 8001
注意点:
部署要细心