安装 JDK
JDK地址
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
安装 zookeeper
zookeeper地址
[root@localhost ~]
anaconda-ks.cfg apache-zookeeper-3.8.0-bin-bin.tar.gz kafka_2.12-3.0.1.tgz
[root@localhost ~]
[root@localhost local]
apache-zookeeper-3.8.0-bin-bin bin etc games include lib lib64 libexec sbin share src
[root@localhost local]
[root@localhost local]
[root@localhost local]
bin etc games include lib lib64 libexec sbin share src zookeeper
//配置环境变量
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
/usr/local/zookeeper/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
//修改配置文件
[root@localhost ~]
[root@localhost ~]
dataDir=/usr/local/zookeeper/data
dataLogDir=/usr/local/zookeeper/log
pidfile=/var/run/zookeeper.pid
[root@localhost ~]
[root@localhost ~]
//启动
[root@localhost ~]
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@localhost ~]
LISTEN 0 50 *:2181 *:*
//设置自启动
[root@localhost ~]
[Unit]
Description=The zookeeper Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/zookeeper/bin/zkServer.sh start
ExecStop=/usr/local/zookeeper/bin/zkServer.sh stop
[Install]
WantedBy=multi-user.target
EOF
[root@localhost ~]
[root@localhost ~]
安装 kafka
kafka地址
[root@localhost ~]
[root@localhost ~]
[root@localhost local]
bin etc games include kafka_2.12-3.0.1 lib lib64 libexec sbin share src zookeeper
[root@localhost local]
[root@localhost ~]
broker.id=0
listeners=PLAINTEXT://192.168.129.250:9092
zookeeper.connect=localhost:2181/kafka
[root@localhost ~]
[Unit]
Description=The kafka Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/kafka/bin/kafka-server-start.sh -daemon /usr/local/kafka/config/server.properties
ExecStop=/usr/local/kafka/bin/kafka-server-stop.sh -daemon /usr/local/kafka/config/server.properties
ExecReload=/bin/kill -HUP
[Install]
WantedBy=multi-user.target
EOF
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
|