2020年10月16日10:40:39

 

EL是Red Hat Enterprise Linux(EL)的缩写。
EL5是Red Hat 5.x,CentOS 5.x
EL6是Red Hat 6.x,CentOS 6.x
EL7是Red Hat 7.x,CentOS 7.x
EL8是Red Hat 8.x,CentOS 8.x
下载地址 : https://www.rabbitmq.com/install-rpm.html

https://packagecloud.io/rabbitmq/rabbitmq-server/
选择对应的版本

yum install erlang
获取yum包
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
这个源比较慢
yum search rabbitmq-server
yum install rabbitmq-server
另一种方法获取rpm包,选择对应版本下载
https://bintray.com/rabbitmq/rpm/rabbitmq-server/

systemctl start rabbitmq-server.service

systemctl enable rabbitmq-server.service

systemctl status rabbitmq-server.service
rabbitmqctl status

rabbitmq-plugins enable rabbitmq_management
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

rabbitmqctl add_user admin zx
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

账号 admin 密码是zx
也可以去管理界面里面修改
RabbitMQ 默认端口号
4369 (epmd), 25672 (Erlang distribution) 5672, 5671 (AMQP 0-9-1 without and with TLS) 15672 (if management plugin is enabled) 61613, 61614 (if STOMP is enabled) 1883, 8883 (if MQTT is enabled) RabbitMQ_Management界面学习 https://www.cnblogs.com/toutou/p/RabbitMQ_Management.html 中文文档 https://www.kancloud.cn/yunxifd/rabbitmq/94125 https://xiaoxiami.gitbook.io/rabbitmq_into_chinese_php/ying-yong-jiao-cheng/php-ban/3-publish_subscribe.md

安装rabbitmq_delayed_message_exchange插件

插件地址:https://www.rabbitmq.com/community-plugins.html

wget https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/v3.8.0/rabbitmq_delayed_message_exchange-3.8.0.ez
到github的发行包地址.ez的文件到
/usr/lib/rabbitmq/lib/rabbitmq_server-3.8.9/plugins
然后运行
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
其他的插件都是同一个方法安装
 rabbitmq-plugins list
查看安装是否成功

2021年8月19日14:12:00
这里有个常见的问题就是rabbitmq和erlang的版本不匹配,导致无法yum安装的问题
rabbitmq官方有维护相关匹配版本

https://packagecloud.io/rabbitmq

所以你先选择
erlang https://packagecloud.io/rabbitmq/erlang

然后选择你对应的版本,
yum search rabbitmq-server查看提示最低版本,然后找对应的版本
比如 erlang-23.3.4-1.el7.x86_64.rpm
点击进去

centos8安装rabbitmq,Kafka

 


 然后有冲突的组件直接删除,然后执行

curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
在执行
sudo yum install erlang-23.3.4-1.el7.x86_64

就基本OK了
 

 

官方网站 http://kafka.apache.org/downloads.html
https://github.com/apache/kafka
Scala 是jvm上运行,需要先安装jre,java版本1.8
wget https://mirror.bit.edu.cn/apache/kafka/2.6.0/kafka_2.13-2.6.0.tgz
运行kafka需要使用Zookeeper,所以你需要先启动Zookeeper,如果你没有Zookeeper,你可以使用kafka自带打包和配置好的Zookeeper bin目录下

https://blog.csdn.net/panchang199266/article/details/82113453
中文文档 http://ifeve.com/kafka-1/
https://www.orchome.com/189

mv kafka_2.13-2.6.0 /usr/local/kafka

vi /etc/systemd/system/zookeeper.service

[Unit]
Description=Apache Zookeeper server
Documentation=http://zookeeper.apache.org
Requires=network.target remote-fs.target
After=network.target remote-fs.target
 
[Service]
Type=simple
ExecStart=/usr/local/kafka/bin/zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties
ExecStop=/usr/local/kafka/bin/zookeeper-server-stop.sh
Restart=on-abnormal
User=root
Group=root
 
[Install]
WantedBy=multi-user.target


vi /etc/systemd/system/kafka.service
 
[Unit]
Description=Apache Kafka Server
Documentation=http://kafka.apache.org/documentation.html
Requires=zookeeper.service
 
[Service]
Type=simple
ExecStart=/usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties
ExecStop=/usr/local/kafka/bin/kafka-server-stop.sh
Restart=on-abnormal
 
[Install]
WantedBy=multi-user.target

创建一个topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testTopic
查看创建了多少个topic
bin/kafka-topics.sh --list --zookeeper localhost:2181
终端生产者进行发送消息
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic testTopic
另一个终端创建一个消费者来进行接收消息
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic testTopic --from-beginning

这里配置的是kafka单机 jps查看是否启动
9173 Kafka
9462 Jps
8589 QuorumPeerMain


kafka配置文件
# broker的全局唯一编号,不能重复
broker.id=0
# 监听
listeners=PLAINTEXT://IP:9092 外网的访问的时候
listeners=PLAINTEXT://:9092 
# 日志目录
log.dirs=/home/hadoop/kafka-logs
# 配置zookeeper的连接(如果不是本机,需要该为ip或主机名)
zookeeper.connect=localhost:2181
#删除主题
delete.topic.enable=true
 

zookeeper配置文件

maxClientCnxns=0

admin.enableServer=true
admin.serverPort=8888

 

相关文章:

  • 2021-11-16
  • 2021-07-12
  • 2021-07-17
  • 2022-12-23
  • 2021-11-19
  • 2022-01-01
  • 2021-10-21
  • 2021-05-16
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2021-10-23
相关资源
相似解决方案