91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

kafka配置

發布時間:2020-07-13 06:24:26 來源:網絡 閱讀:210 作者:春秋小記 欄目:大數據

1.三節點主機環境:
#Red Hat Enterprise Linux Server release 7.5
192.168.154.128   my1.db.com   my1
192.168.154.129   my2.db.com   my2
192.168.154.130   my3.db.com   my3

2.配置jdk:
tar xvzf jdk-8u201-linux-x64.tar.gz
mv jdk1.8.0_201 /usr/local/jdk
vi .bash_profile
JAVA_HOME=/usr/local/jdk
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
source .bash_profile

3.下載zookeeper:
http://zookeeper.apache.org/releases.html
tar xvzf zookeeper-3.4.13.tar.gz
mv zookeeper-3.4.13 /usr/local/zookeeper

4.配置zookeeper:

編輯配置文件:
vi /usr/local/zookeeper/conf/zoo.cfg
tickTime=2000
dataDir=/usr/local/zookeeper/data
clientPort=2181
initLimit=5
syncLimit=2
dataLogDir=/usr/local/zookeeper/log
server.1=my1:2888:3888
server.2=my2:2888:3888
server.3=my3:2888:3888

創建目錄:
mkdir -p /usr/local/zookeeper/data/
mkdir -p /usr/local/zookeeper/log/

echo 1 > /usr/local/zookeeper/data/myid
echo 2 > /usr/local/zookeeper/data/myid
echo 3 > /usr/local/zookeeper/data/myid

5.啟動zookeeper:
/usr/local/zookeeper/bin/zkServer.sh start /usr/local/zookeeper/conf/zoo.cfg

查看狀態:
/usr/local/zookeeper/bin/zkServer.sh status /usr/local/zookeeper/conf/zoo.cfg


6.下載kafka:
http://kafka.apache.org/downloads
tar xvzf kafka_2.12-2.0.0.tgz
mv kafka_2.12-2.0.0 /usr/local/kafka

mkdir -p /usr/local/kafka/data

編輯配置文件:
vi /usr/local/kafka/config/server.properties
broker.id=1
listeners=PLAINTEXT://my1:9092
zookeeper.connect=192.168.154.128:2181,192.168.154.129:2181,192.168.154.130:2181
delete.topic.enable=true

啟動kafka:
/usr/local/kafka/bin/kafka-server-start.sh -daemon /usr/local/kafka/config/server.properties

查看確認:
jps

7.測試kafka:
創建一個測試topic:
/usr/local/kafka/bin/kafka-topics.sh --zookeeper 192.168.154.128:2181,192.168.154.129:2181,192.168.154.130:2181 --create --topic test-topic --partitions 3 --replication-factor 3
查看topic:
/usr/local/kafka/bin/kafka-topics.sh --zookeeper 192.168.154.128:2181,192.168.154.129:2181,192.168.154.130:2181 --list
/usr/local/kafka/bin/kafka-topics.sh --zookeeper 192.168.154.128:2181,192.168.154.129:2181,192.168.154.130:2181 --describe --topic test-topic

刪除topic:
/usr/local/kafka/bin/kafka-topics.sh --zookeeper 192.168.154.128:2181,192.168.154.129:2181,192.168.154.130:2181 --delete --topic test-topic

producer發送消息:
/usr/local/kafka/bin/kafka-console-producer.sh --broker-list my1:9092,my2:9092,my3:9092 --topic test-topic

consumer消費消息:
/usr/local/kafka/bin/kafka-console-consumer.sh --bootstrap-server my1:9092,my2:9092,my3:9092 --topic test-topic --from-beginning

生產者吞吐量測試:
/usr/local/kafka/bin/kafka-producer-perf-test.sh --topic test-topic --num-records 500000 --record-size 200 --throughput -1 --producer-props bootstrap.servers=192.168.154.128:9092,192.168.154.129:9092,192.168.154.130:9092 acks=1

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

运城市| 滨海县| 河池市| 四平市| 潜山县| 山丹县| 泸西县| 南皮县| 桂阳县| 察隅县| 金昌市| 马边| 彰化市| 阳江市| 葫芦岛市| 平利县| 霞浦县| 通渭县| 微山县| 太谷县| 滨海县| 南通市| 临夏市| 潜山县| 乐业县| 东阿县| 文化| 河源市| 白水县| 阳高县| 民县| 驻马店市| 河北省| 抚州市| 和平县| 南部县| 安岳县| 道孚县| 甘孜县| 方城县| 额尔古纳市|