标签:msi webapps profile 压缩 tomcat cer 新网卡 效率 ble
RocketMQ:
支持集群,效率高,同时支持上万队列,支持消息持久化,重试机制等等;
RocketMQ包含的组件
NameServer:单点,供Producer和Consumer获取Broker地址
Producer:产生并发送消息
Consumer:接受并消费消息
Broker:消息暂存,消息转发
RocketMQ优点
强调集群无单点,可扩展
任意一点高可用,水平可扩展
海量消息堆积能力,消息堆积后,写入低延迟。
支持上万个队列
消息失败重试机制
消息可查询
开源社区活跃
成熟度
安装JDK
检查当前虚拟机环境有没有JDK rpm -qa|grep java
卸载 rpm -e --nodeps xxxxxx
安装JDK
在/usr/local新建一个java文件夹,然后将tar包上传到文件夹下
切换到/usr/local/java 使用tar -zxvf xxx解压
配置/etc/profile文件,加入JDK环境变量
export JAVA_HOME=/usr/local/java/jdk1.8.0_121 替换自己路径
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
应用文件 source /etc/profile
使用java -version查看版本
安装RocketMQ
配置/etc/hosts文件
192.168.7.11 rocketmq-nameserver1
192.168.7.11 rocketmq-master1
192.168.7.22 rocketmq-nameserver2
192.168.7.22 rocketmq-master2
重新网卡 service network restart
上传rocketmq压缩包,上传到/usr/local下
切换到/usr/local下解压rocketmq压缩包 tar -zxvf xxxxxx
更改解压文件夹名称
mv alibaba-rocketmq alibaba-rocketmq-3.2.6
创建软连接
ln -s alibaba-rocketmq-3.2.6 rocketmq
mkdir /usr/local/rocketmq/store
mkdir /usr/local/rocketmq/store/commitlog
mkdir /usr/local/rocketmq/store/consumequeue
mkdir /usr/local/rocketmq/store/index
把borker-a.properties 和borker-b.properties 上传到/usr/local/recketmq/conf/2m-noslave
master01配置borker-a.properties
brokerName=broker-a 对应文件名称
namesrvAddr=rocketmq-nameserver1:9876;rocketmq-nameserver2:9876
master02配置borker-b.properties
brokerName=broker-b 对应文件名称
namesrvAddr=rocketmq-nameserver1:9876;rocketmq-nameserver2:9876
修改日志
mkdir -p /usr/local/rocketmq/logs
cd /usr/local/rocketmq/conf && sed -i ‘s#${user.home}#/usr/local/rocketmq#g‘ *.xml
配置JVM参数
vi /usr/local/rocketmq/bin/runbroker.sh
JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g -Xmn512m -XX:PermSize=128m -XX:MaxPermSize=320m"
vi /usr/local/rocketmq/bin/runserver.sh
启动NameServer
cd /usr/local/rocketmq/bin
启动:nohup sh mqnamesrv &
jps查看JDK进程是否有NamesrvStartup
启动BrokerServer
cd /usr/local/rocketmq/bin
master01启动:nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-noslave/broker-a.properties >/dev/null 2>&1 &
master01启动:nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-noslave/broker-b.properties >/dev/null 2>&1 &
jps查看JDK进程是否有BrokerStartup
通过console控制台监控rocketmq状态
将Tomcat压缩包上传到虚拟机进行解压 /usr/local tar -zxvf xxxx解压
将rocketmq-web-console.war上传到Tomcat解压目录的webapps下
启动Tomcat
切换到/usr/local/apache-tomcat-7.0.65/bin
./startup.sh 启动 ./shutdown.sh 停止
修改解压后的rocketmq-web-console
/usr/local/apache-tomcat-7.0.65/webapps/rocketmq-web-console/WEB-INF/classes/config.properties配置文件
配置:
rocketmq.namesrv.addr=192.168.7.11:9876;192.168.7.22:9876
throwDone=true
两台机器防火墙关闭
systemctl stop firewalld.service
systemctl disable firewalld.service
标签:msi webapps profile 压缩 tomcat cer 新网卡 效率 ble
原文地址:https://www.cnblogs.com/whtt/p/12322557.html