Centos环境下部分中间件“rabbitmq、rocketmq、clickhouse”部署

部分中间件部署

docker部署rabbitmq

# 拉镜像
docker pull rabbitmq:3.8-management

# 启动
docker run \
-e RABBITMQ_DEFAULT_USER=guest \
-e RABBITMQ_DEFAULT_PASS=guest \
-v /data/rabbitmq/rabbitmq:/var/lib/rabbitmq \
--name rabbitmq \
--hostname rabbitmq \
-p 15672:15672 \
-p 5672:5672 \
-d \
rabbitmq:3.8-management

docker部署rocketmq

# 拉取镜像 
docker pull foxiswho/rocketmq:server-4.7.0
docker pull foxiswho/rocketmq:broker-4.7.0

# 创建目录
mkdir /data/rocketmq
mkdir -p /data/rocketmq/server/{logs,store}
mkdir -p /data/rocketmq/broker/{logs,store,conf}

# 准备配置文件
vim /data/rocketmq/broker/conf/broker.conf
namesrvAddr=192.168.1.81:9876
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 192.168.1.81
listenPort=10911
autoCreateTopicEnable=true


# 启动rocketmq-server容器
docker run -d \
--restart=always \
--name rmqnamesrv \
-p 9876:9876 \
-v /data/rocketmq/server/logs:/root/logs \
-v /data/rocketmq/server/store:/root/store \
-e "MAX_POSSIBLE_HEAP=100000000" \
foxiswho/rocketmq:4.7.0 \
sh mqnamesrv

# 启动rocketmq-broker容器
docker run -d  \
--restart=always \
--name rmqbroker \
--link rmqnamesrv:namesrv \
-p 10911:10911 \
-p 10909:10909 \
-v /data/rocketmq/broker/logs:/root/logs \
-v /data/rocketmq/broker/store:/root/store \
-v /data/rocketmq/broker/conf/broker.conf:/opt/rocketmq-4.7.0/conf/broker.conf \
-e "NAMESRV_ADDR=namesrv:9876" \
-e "MAX_POSSIBLE_HEAP=200000000" \
-e "autoCreateTopicEnable=true" \
foxiswho/rocketmq:4.7.0 \
sh mqbroker -c /opt/rocketmq-4.7.0/conf/broker.conf

# 启动RocketMQ的管理工具rocketmq-console容器
docker run -itd -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.1.81:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8082:8080 -t styletang/rocketmq-console-ng:latest

# 测试访问console控制台
浏览器输入:192.168.1.81:8082

单机部署clickhouse

# yum方式安装
yum install -y yum-utils
yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
yum install -y clickhouse-server clickhouse-client

# 启动
systemctl start clickhouse-server
systemctl enable clickhouse-server
systemctl status clickhouse-server

# 放开远程访问
## 开放之前
[root@localhost ~]# netstat -lntup|grep clickhouse
tcp        0      0 127.0.0.1:8123          0.0.0.0:*               LISTEN      9742/clickhouse-ser 
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      9742/clickhouse-ser 
tcp        0      0 127.0.0.1:9004          0.0.0.0:*               LISTEN      9742/clickhouse-ser 
tcp        0      0 127.0.0.1:9005          0.0.0.0:*               LISTEN      9742/clickhouse-ser 
tcp        0      0 127.0.0.1:9009          0.0.0.0:*               LISTEN      9742/clickhouse-ser 

## 修改配置并重启服务
vim /etc/clickhouse-server/config.xml
<listen_host>::</listen_host>	# 新增配置

systemctl restart clickhouse-server

## 开放之后
[root@localhost ~]# netstat -lntup|grep clickhouse
tcp6       0      0 :::8123                 :::*                    LISTEN      10515/clickhouse-se 
tcp6       0      0 :::9000                 :::*                    LISTEN      10515/clickhouse-se 
tcp6       0      0 :::9004                 :::*                    LISTEN      10515/clickhouse-se 
tcp6       0      0 :::9005                 :::*                    LISTEN      10515/clickhouse-se 
tcp6       0      0 :::9009                 :::*                    LISTEN      10515/clickhouse-se
posted @ 2023-05-11 09:31  AnOldSong  阅读(92)  评论(0编辑  收藏  举报