最新要闻
- 20万能买到?极氪003最新预告:3米级加速秒杀百万超跑
- 滚导和盘托出未来规划 超人新片定档2025年
- 全球观察:12.4万买下保时捷帕纳梅拉 涉事博主:无成本新车营销成功案例
- 3层果肉 层层爆浆 榴莲西施榴莲千层蛋糕6寸:两盒69.9元
- 环球最资讯丨博主怒斥极氪汽车站不起来 居然致敬燃油车奥迪Q3
- 一劳永逸打一地名是什么?一劳永逸和一蹴而就的区别是什么?
- 怒晴湘西讲的是什么故事?怒晴湘西大结局是什么?
- 阳光大道是什么意思?阳光大道打一个生肖是什么?
- 萝卜喝醉了会变成什么?脑筋急转弯大全
- 南国新川是什么意思?南国新川在哪里?
- 可测水温、室温、体温 一机多用:可孚红外电子体温枪29.9元发车
- 全球热点评!投入一亿建立优化实验室:一加Ace 2《原神》表现稳了
- 李一男造车“破梦重圆”?自游家NV现身奇瑞商用车总部
- 天天动态:男孩撸猫后发烧12天:腋下长鸡蛋大肿块
- 环球热推荐:知名车评人侮辱特斯拉被判赔10万 车评人上诉
- 国内首家!奇瑞霸气官宣:旗下四大品牌全系车型终身质保
手机
iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?
警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案
- iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?
- 警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案
- 男子被关545天申国赔:获赔18万多 驳回精神抚慰金
- 3天内26名本土感染者,辽宁确诊人数已超安徽
- 广西柳州一男子因纠纷杀害三人后自首
- 洱海坠机4名机组人员被批准为烈士 数千干部群众悼念
家电
基于k8s的zookeeper搭建
1.官方文档
https://kubernetes.io/zh-cn/docs/tutorials/stateful-application/zookeeper/
(资料图片)
2.k8s部署
2.1.部署文件
zookeeper.yaml
apiVersion: v1kind: Servicemetadata: name: zk-hs labels: app: zkspec: ports: - port: 2888 name: server - port: 3888 name: leader-election clusterIP: None selector: app: zk---apiVersion: v1kind: Servicemetadata: name: zk-cs labels: app: zkspec: ports: - port: 2181 name: client selector: app: zk---apiVersion: policy/v1kind: PodDisruptionBudgetmetadata: name: zk-pdbspec: selector: matchLabels: app: zk maxUnavailable: 1---apiVersion: apps/v1kind: StatefulSetmetadata: name: zkspec: selector: matchLabels: app: zk serviceName: zk-hs replicas: 3 updateStrategy: type: RollingUpdate podManagementPolicy: OrderedReady template: metadata: labels: app: zk spec: securityContext: runAsUser: 1000 fsGroup: 1000 affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: "app" operator: In values: - zk topologyKey: "kubernetes.io/hostname" containers: - name: kubernetes-zookeeper imagePullPolicy: Always image: "registry.k8s.io/kubernetes-zookeeper:1.0-3.4.10" resources: requests: memory: "200Mi" cpu: "0.1" ports: - containerPort: 2181 name: client - containerPort: 2888 name: server - containerPort: 3888 name: leader-election command: - sh - -c - "start-zookeeper \ --servers=3 \ --data_dir=/var/lib/zookeeper/data \ --data_log_dir=/var/lib/zookeeper/data/log \ --conf_dir=/opt/zookeeper/conf \ --client_port=2181 \ --election_port=3888 \ --server_port=2888 \ --tick_time=2000 \ --init_limit=10 \ --sync_limit=5 \ --heap=512M \ --max_client_cnxns=60 \ --snap_retain_count=3 \ --purge_interval=12 \ --max_session_timeout=40000 \ --min_session_timeout=4000 \ --log_level=INFO" readinessProbe: exec: command: - sh - -c - "zookeeper-ready 2181" initialDelaySeconds: 10 timeoutSeconds: 5 livenessProbe: exec: command: - sh - -c - "zookeeper-ready 2181" initialDelaySeconds: 10 timeoutSeconds: 5 volumeMounts: - name: datadir mountPath: /var/lib/zookeeper volumeClaimTemplates: - metadata: name: datadir spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 200Mi
2.2. 部署说明
2.2.1. PersistentVolume配置:
zookeeper 依赖与PersistentVolume, 需要优先创建3个PersistentVolume
volumeClaimTemplates: - metadata: name: datadir spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 200Mi
2.2.2. PersistentVolume部署:
PersistentVolume.yaml
---apiVersion: v1kind: PersistentVolumemetadata: name: kafka-pv1 labels: type: zookeeperspec: capacity: storage: 200Mi accessModes: - ReadWriteOnce hostPath: path: "/opt/kafka_data1"---apiVersion: v1kind: PersistentVolumemetadata: name: kafka-pv2 labels: type: zookeeperspec: capacity: storage: 200Mi accessModes: - ReadWriteOnce hostPath: path: "/opt/kafka_data2"---apiVersion: v1kind: PersistentVolumemetadata: name: kafka-pv3 labels: type: zookeeperspec: capacity: storage: 200Mi accessModes: - ReadWriteOnce hostPath: path: "/opt/kafka_data3"
3个PersistentVolume的hostPath必须是不同路径,如果部署在不同机器上面可以相同路径。
sudo kubectl apply -f PersistentVolume.yaml
2.2.3. 用户配置:
zookeeper默认启动的用户是容器内部的zookeeper,用户id为1000, 用户组id为1000
securityContext: runAsUser: 1000 fsGroup: 1000
启动用户需要确保给予PersistentVolume的硬盘路径访问权限:
sudo chown -R 1000:1000 /opt/kafka_data1sudo chown -R 1000:1000 /opt/kafka_data2sudo chown -R 1000:1000 /opt/kafka_data3
2.2.4. 亲和性配置:
affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: "app" operator: In values: - zk topologyKey: "kubernetes.io/hostname"
zookeeper默认配置podAntiAffinity反亲和力配置,一个节点只能部署1个pod
如果只有1台机器的话,就把它去除,我是就2个节点,所以部署的时候就把亲和性删除了。
2.3.部署
sudo kubectl apply -f zookeeper.yaml
3.验证基本功能
3.1.查看某个pod的配置文件
sudo kubectl exec -it zk-0 -- cat /opt/zookeeper/conf/zoo.cfg
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl exec -it zk-0 -- cat /opt/zookeeper/conf/zoo.cfg #This file was autogenerated DO NOT EDIT clientPort=2181 dataDir=/var/lib/zookeeper/data dataLogDir=/var/lib/zookeeper/data/log tickTime=2000 initLimit=10 syncLimit=5 maxClientCnxns=60 minSessionTimeout=4000 maxSessionTimeout=40000 autopurge.snapRetainCount=3 autopurge.purgeInteval=12 server.1=zk-0.zk-hs.default.svc.cluster.local:2888:3888 server.2=zk-1.zk-hs.default.svc.cluster.local:2888:3888 server.3=zk-2.zk-hs.default.svc.cluster.local:2888:3888
3.2.获取zookeeper的完整主机名
for i in 0 1 2; do kubectl exec zk-$i -- hostname -f; done
qiteck@server:~/program/docker_service/zookeeper$ for i in 0 1 2; do kubectl exec zk-$i -- hostname -f; done zk-0.zk-hs.default.svc.cluster.local zk-1.zk-hs.default.svc.cluster.local zk-2.zk-hs.default.svc.cluster.local
3.3.查看集群状态--3个节点的角色
for i in 0 1 2; do kubectl exec zk-$i -- zkServer.sh status; done
qiteck@server:~/program/docker_service/zookeeper$ for i in 0 1 2; do kubectl exec zk-$i -- zkServer.sh status; done ZooKeeper JMX enabled by default Using config: /usr/bin/../etc/zookeeper/zoo.cfg Mode: follower ZooKeeper JMX enabled by default Using config: /usr/bin/../etc/zookeeper/zoo.cfg Mode: leader ZooKeeper JMX enabled by default Using config: /usr/bin/../etc/zookeeper/zoo.cfg Mode: follower
3.4.查看myid
for i in 0 1 2; do echo -n "zk-$i"; kubectl exec zk-$i -- cat /var/lib/zookeeper/data/myid; done
qiteck@server:~/program/docker_service/zookeeper$ for i in 0 1 2; do echo -n "zk-$i"; kubectl exec zk-$i -- cat /var/lib/zookeeper/data/myid; done zk-01 zk-11 zk-21
3.5.在其他pod去ping zookeeper主机
sudo kubectl exec -it account-6468847985-2fqpf -- ping zk-0.zk-hs.default.svc.cluster.local
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl exec -it account-6468847985-2fqpf -- ping zk-0.zk-hs.default.svc.cluster.local PING zk-0.zk-hs.default.svc.cluster.local (10.244.1.9) 56(84) bytes of data. 64 bytes from zk-0.zk-hs.default.svc.cluster.local (10.244.1.9): icmp_seq=1 ttl=64 time=0.340 ms 64 bytes from zk-0.zk-hs.default.svc.cluster.local (10.244.1.9): icmp_seq=2 ttl=64 time=0.071 ms 64 bytes from zk-0.zk-hs.default.svc.cluster.local (10.244.1.9): icmp_seq=3 ttl=64 time=0.053 ms ^C --- zk-0.zk-hs.default.svc.cluster.local ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2031ms
sudo kubectl exec -it account-6468847985-2fqpf -- ping zk-1.zk-hs.default.svc.cluster.local
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl exec -it account-6468847985-2fqpf -- ping zk-1.zk-hs.default.svc.cluster.local PING zk-1.zk-hs.default.svc.cluster.local (10.244.1.10) 56(84) bytes of data. 64 bytes from 10-244-1-10.zk-cs.default.svc.cluster.local (10.244.1.10): icmp_seq=1 ttl=64 time=0.226 ms 64 bytes from 10-244-1-10.zk-cs.default.svc.cluster.local (10.244.1.10): icmp_seq=2 ttl=64 time=0.044 ms 64 bytes from 10-244-1-10.zk-cs.default.svc.cluster.local (10.244.1.10): icmp_seq=3 ttl=64 time=0.042 ms ^C --- zk-1.zk-hs.default.svc.cluster.local ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2038ms rtt min/avg/max/mdev = 0.042/0.104/0.226/0.086 ms
sudo kubectl exec -it account-6468847985-2fqpf -- ping zk-2.zk-hs.default.svc.cluster.local
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl exec -it account-6468847985-2fqpf -- ping zk-2.zk-hs.default.svc.cluster.local PING zk-2.zk-hs.default.svc.cluster.local (10.244.1.11) 56(84) bytes of data. 64 bytes from zk-2.zk-hs.default.svc.cluster.local (10.244.1.11): icmp_seq=1 ttl=64 time=0.308 ms 64 bytes from zk-2.zk-hs.default.svc.cluster.local (10.244.1.11): icmp_seq=2 ttl=64 time=0.080 ms 64 bytes from zk-2.zk-hs.default.svc.cluster.local (10.244.1.11): icmp_seq=3 ttl=64 time=0.295 ms ^C --- zk-2.zk-hs.default.svc.cluster.local ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2024ms rtt min/avg/max/mdev = 0.080/0.227/0.308/0.105 ms
4.验证集群功能
4.1.在0容器创建数据
进入0容器,执行zkCli.sh客户端,执行create /zk-test hsssss, 获取一下是否看对不对get /zk-test
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl exec -it zk-0 -- /bin/bash root@zk-0:/# zkCli.sh Connecting to localhost:2181 2023-01-31 08:49:55,163 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT 2023-01-31 08:49:55,166 [myid:] - INFO [main:Environment@100] - Client environment:host.name=zk-0.zk-hs.default.svc.cluster.local 2023-01-31 08:49:55,167 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_131 2023-01-31 08:49:55,170 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation 2023-01-31 08:49:55,170 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre 2023-01-31 08:49:55,170 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/usr/bin/../build/classes:/usr/bin/../build/lib/*.jar:/usr/bin/../share/zookeeper/zookeeper-3.4.10.jar:/usr/bin/../share/zookeeper/slf4j-log4j12-1.6.1.jar:/usr/bin/../share/zookeeper/slf4j-api-1.6.1.jar:/usr/bin/../share/zookeeper/netty-3.10.5.Final.jar:/usr/bin/../share/zookeeper/log4j-1.2.16.jar:/usr/bin/../share/zookeeper/jline-0.9.94.jar:/usr/bin/../src/java/lib/*.jar:/usr/bin/../etc/zookeeper: 2023-01-31 08:49:55,171 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib 2023-01-31 08:49:55,171 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp 2023-01-31 08:49:55,171 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler= 2023-01-31 08:49:55,172 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux 2023-01-31 08:49:55,172 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64 2023-01-31 08:49:55,172 [myid:] - INFO [main:Environment@100] - Client environment:os.version=5.15.0-50-generic 2023-01-31 08:49:55,173 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root 2023-01-31 08:49:55,173 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root 2023-01-31 08:49:55,173 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/ 2023-01-31 08:49:55,175 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@22d8cfe0 Welcome to ZooKeeper! 2023-01-31 08:49:55,234 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) JLine support is enabled 2023-01-31 08:49:55,410 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@876] - Socket connection established to localhost/127.0.0.1:2181, initiating session [zk: localhost:2181(CONNECTING) 0] 2023-01-31 08:49:55,494 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x18606fc8b4a0000, negotiated timeout = 30000 WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: localhost:2181(CONNECTED) 0] [zk: localhost:2181(CONNECTED) 0] create /zk-test hsssss Created /zk-test [zk: localhost:2181(CONNECTED) 1] get /zk-test hsssss cZxid = 0x100000002 ctime = Tue Jan 31 08:50:53 UTC 2023 mZxid = 0x100000002 mtime = Tue Jan 31 08:50:53 UTC 2023 pZxid = 0x100000002 cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 6 numChildren = 0
4.2.在1容器获取数据
进入1容器,执行zkCli.sh客户端,获取数据验证get /zk-test
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl exec -it zk-1 -- /bin/bash root@zk-1:/# zkCli.sh Connecting to localhost:2181 2023-01-31 08:51:55,701 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT 2023-01-31 08:51:55,710 [myid:] - INFO [main:Environment@100] - Client environment:host.name=zk-1.zk-hs.default.svc.cluster.local 2023-01-31 08:51:55,713 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_131 2023-01-31 08:51:55,717 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation 2023-01-31 08:51:55,721 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre 2023-01-31 08:51:55,721 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/usr/bin/../build/classes:/usr/bin/../build/lib/*.jar:/usr/bin/../share/zookeeper/zookeeper-3.4.10.jar:/usr/bin/../share/zookeeper/slf4j-log4j12-1.6.1.jar:/usr/bin/../share/zookeeper/slf4j-api-1.6.1.jar:/usr/bin/../share/zookeeper/netty-3.10.5.Final.jar:/usr/bin/../share/zookeeper/log4j-1.2.16.jar:/usr/bin/../share/zookeeper/jline-0.9.94.jar:/usr/bin/../src/java/lib/*.jar:/usr/bin/../etc/zookeeper: 2023-01-31 08:51:55,722 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib 2023-01-31 08:51:55,722 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp 2023-01-31 08:51:55,722 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler= 2023-01-31 08:51:55,723 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux 2023-01-31 08:51:55,723 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64 2023-01-31 08:51:55,724 [myid:] - INFO [main:Environment@100] - Client environment:os.version=5.15.0-50-generic 2023-01-31 08:51:55,725 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root 2023-01-31 08:51:55,725 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root 2023-01-31 08:51:55,726 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/ 2023-01-31 08:51:55,730 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@22d8cfe0 Welcome to ZooKeeper! 2023-01-31 08:51:55,777 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) JLine support is enabled 2023-01-31 08:51:55,943 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@876] - Socket connection established to localhost/127.0.0.1:2181, initiating session [zk: localhost:2181(CONNECTING) 0] 2023-01-31 08:51:56,014 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x28606fc8ba00000, negotiated timeout = 30000 WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: localhost:2181(CONNECTED) 0] get /zk-test hsssss cZxid = 0x100000002 ctime = Tue Jan 31 08:50:53 UTC 2023 mZxid = 0x100000002 mtime = Tue Jan 31 08:50:53 UTC 2023 pZxid = 0x100000002 cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 6 numChildren = 0
可以取到/zk-test对应的数据 hsssss
4.3.删除pod,验证pod挂掉验证集群是否能恢复正常:
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl get pods -l app=zk NAME READY STATUS RESTARTS AGE zk-0 1/1 Running 0 15m zk-1 1/1 Running 0 15m zk-2 1/1 Running 0 15m
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl delete pods zk-1 zk-0 pod "zk-1" deleted pod "zk-0" deleted
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl get pods -l app=zk -w NAME READY STATUS RESTARTS AGE zk-0 1/1 Running 0 65s zk-1 1/1 Running 0 44s zk-2 1/1 Running 0 16m
可以看到,zk-0,zk-1再删除以后会自动创建,集群能够恢复
4.4.验证恢复后的集群状态:
for i in 0 1 2; do kubectl exec zk-$i -- zkServer.sh status; done
qiteck@server:~/program/docker_service/zookeeper$ for i in 0 1 2; do kubectl exec zk-$i -- zkServer.sh status; done ZooKeeper JMX enabled by default Using config: /usr/bin/../etc/zookeeper/zoo.cfg Mode: follower ZooKeeper JMX enabled by default Using config: /usr/bin/../etc/zookeeper/zoo.cfg Mode: leader ZooKeeper JMX enabled by default Using config: /usr/bin/../etc/zookeeper/zoo.cfg Mode: follower
4.5.验证新的节点数据是否正常:
再次进入0容器,执行zkCli.sh客户端,获取数据get /zk-test
qiteck@server:~/program/docker_service/zookeeper$ sudo kubectl exec -it zk-0 -- /bin/bash root@zk-0:/# zkCli.sh Connecting to localhost:2181 2023-01-31 09:00:14,553 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT 2023-01-31 09:00:14,556 [myid:] - INFO [main:Environment@100] - Client environment:host.name=zk-0.zk-hs.default.svc.cluster.local 2023-01-31 09:00:14,556 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_131 2023-01-31 09:00:14,559 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation 2023-01-31 09:00:14,559 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre 2023-01-31 09:00:14,559 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/usr/bin/../build/classes:/usr/bin/../build/lib/*.jar:/usr/bin/../share/zookeeper/zookeeper-3.4.10.jar:/usr/bin/../share/zookeeper/slf4j-log4j12-1.6.1.jar:/usr/bin/../share/zookeeper/slf4j-api-1.6.1.jar:/usr/bin/../share/zookeeper/netty-3.10.5.Final.jar:/usr/bin/../share/zookeeper/log4j-1.2.16.jar:/usr/bin/../share/zookeeper/jline-0.9.94.jar:/usr/bin/../src/java/lib/*.jar:/usr/bin/../etc/zookeeper: 2023-01-31 09:00:14,559 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib 2023-01-31 09:00:14,559 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp 2023-01-31 09:00:14,559 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler= 2023-01-31 09:00:14,560 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux 2023-01-31 09:00:14,560 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64 2023-01-31 09:00:14,560 [myid:] - INFO [main:Environment@100] - Client environment:os.version=5.15.0-50-generic 2023-01-31 09:00:14,560 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root 2023-01-31 09:00:14,560 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root 2023-01-31 09:00:14,561 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/ 2023-01-31 09:00:14,562 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@22d8cfe0 Welcome to ZooKeeper! 2023-01-31 09:00:14,594 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) JLine support is enabled 2023-01-31 09:00:14,738 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@876] - Socket connection established to localhost/127.0.0.1:2181, initiating session [zk: localhost:2181(CONNECTING) 0] 2023-01-31 09:00:14,808 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x186070b91d80000, negotiated timeout = 30000 WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: localhost:2181(CONNECTED) 0] get /zk-test hsssss cZxid = 0x100000002 ctime = Tue Jan 31 08:50:53 UTC 2023 mZxid = 0x100000002 mtime = Tue Jan 31 08:50:53 UTC 2023 pZxid = 0x100000002 cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 6 numChildren = 0
可以看到获取zk-test的数据还是hssss
至此zookeeper的功能是正常的。
-
基于k8s的zookeeper搭建
1 官方文档https: kubernetes io zh-cn docs tutorials stateful-application zookeeper 2 k8s部署2 1 部署文件z
来源: -
读Java8函数式编程笔记07_设计和架构的原则
1 & 160;SOLID原则1 1 & 160;开发良好面向对象程序的准则1 2 & 160;Liskovsubstitution里氏替换1 3 & 160;Interfacesegreg
来源: 基于k8s的zookeeper搭建
读Java8函数式编程笔记07_设计和架构的原则
20万能买到?极氪003最新预告:3米级加速秒杀百万超跑
滚导和盘托出未来规划 超人新片定档2025年
全球观察:12.4万买下保时捷帕纳梅拉 涉事博主:无成本新车营销成功案例
3层果肉 层层爆浆 榴莲西施榴莲千层蛋糕6寸:两盒69.9元
环球最资讯丨博主怒斥极氪汽车站不起来 居然致敬燃油车奥迪Q3
三星s3370手机有触控笔吗?三星s3370手机参数
怎么删除地址栏里的网址记录?如何恢复删除的网址记录?
tdscdma手机怎么样?tdscdma手机铃声静音怎么解除?
魅族m8什么时候上市的?魅族m8手机参数
All Share Play是什么意思?All Share Play功能是什么?
一劳永逸打一地名是什么?一劳永逸和一蹴而就的区别是什么?
怒晴湘西讲的是什么故事?怒晴湘西大结局是什么?
阳光大道是什么意思?阳光大道打一个生肖是什么?
世界聚焦:linux服务器运行java项目, 监控查看内存、储存空间和cpu占用率
热点!火山引擎 DataTester:0 代码也能实施 A/B 测试的实验平台
世界滚动:一看就懂!任务提交的资源判断在Taier中的实践
全球热文:全球首个面向遥感任务设计的亿级视觉Transformer大模型
萝卜喝醉了会变成什么?脑筋急转弯大全
南国新川是什么意思?南国新川在哪里?
可测水温、室温、体温 一机多用:可孚红外电子体温枪29.9元发车
全球热点评!投入一亿建立优化实验室:一加Ace 2《原神》表现稳了
李一男造车“破梦重圆”?自游家NV现身奇瑞商用车总部
天天动态:男孩撸猫后发烧12天:腋下长鸡蛋大肿块
环球热推荐:知名车评人侮辱特斯拉被判赔10万 车评人上诉
activiti审批流源码,落地版教程
天天新消息丨easy excel 导入导出
全球最资讯丨@vue/cli 插件开发之自动根据目录列表生成别名配置
国内首家!奇瑞霸气官宣:旗下四大品牌全系车型终身质保
环球观察:30年前拍不成 现在香爆!郭帆拍《流浪地球3》 图恒宇写“4”原因揭晓
天天要闻:颜值碾压BBA 马自达旗舰CX-90全球首发:国产后或砍3.3T
支付巨头PayPal“挥刀”裁员7%:2000名员工将被辞退
当前快报:反向操作?特斯拉降价后 宝马、牧马人等油车主动涨价
全球看点:OKR之剑·实战篇04:OKR执行过程优化的那些关键事
用户不升Win11原因扎心!微软正式停售Win10:ISO等继续下载
比SSD便宜 还写不死!净亏4.4亿美元 西数力挺机械硬盘:9亿美元要收铠侠
小米商城惊现神价格!将近500块的手机壳只要10元 米粉疯狂下单
今日报丨曝苹果2025年推出折叠屏MacBook:20.5英寸屏 颠覆以往
环球最资讯丨韩国刷新世界最低生育率纪录 一小学上演1人毕业季:网友唏嘘
联想小新Pro 16 23款轻薄本真机首曝:115W性能释放堪比游戏本
【计算机网络】Stanford CS144 Lab0 : networking warmup 学习记录
天天最资讯丨React框架运行机制
netcore之异步并不是多线程!
天天观点:NVIDIA御用游戏《赛博朋克2077》终于支持DLSS 3:性能暴涨3.9倍!
天天热推荐:机械硬盘:彻底陨落
天天热头条丨地球最黑暗的时刻:被狂轰滥炸长达2000万年
信息:游客岳飞观高喊“还我河山” 砸打秦桧像:景区已报警
焦点热文:丰田章男:一年卖出1049万辆汽车!却败给了电动车
环球快报:特斯拉2022年在华营收181.45亿美元:占比降至约22%
天天微动态丨千呼万唤始出来 《赛博朋克2077》正式支持DLSS3
神十五乘组太空过春节!这一看就是咱中国的空间站:红红火火
天天热头条丨MySQL之MVCC总结理解
环球关注:autojs实例02-为朋友圈指定好友点赞
Prometheus&Grafana基本使用
直播:5万年一遇绿色彗星逼近地球 肉眼可见
python教程:shutil高级文件操作
当前播报:自定义ConditionalOnXX注解(二)
世界焦点!河南矿山开工招聘电话被打爆:因6100万奖金火出圈
天天热议:对不起!《狂飙》反派集体直播“道歉”:阵势让网友欢呼太上头
观热点:日本厂商2023年推出新款磁带收音机:支持U盘数据转录
天天日报丨戴尔灵越Pro 2023系列上架:13代酷睿P系 5999元起
DDS结构的FPGA实现
【算法训练营day34】LeetCode1005. K次取反后最大化的数组和 LeetCode134. 加油站 LeetCode135. 分发糖果
天天观焦点:女子有洁癖:每天消杀双手10次 结果患乏脂性皮炎
最新快讯!彻底消灭自燃!宝马今年开始测试固态电池:计划两年后装车
世界信息:情人节倒计时 国外动物园想出报复前任的绝妙点子:蟑螂惨了
当前速讯:宏碁杀入显卡市场!通吃Intel/AMD、不碰NVIDIA
新资讯:《狂飙》热播!湖南一网吧凌晨变《狂飙》专场
实时焦点:如何手动补充陈年老库(或纯 JS 代码)的 TypeScript 类型?
中国新车质量榜:前四均被合资车企包揽 本田最大赢家
刷新中国影史记录!2023年院线全年总票房已破百亿
播报:男生和女生初四相亲初八订婚:称不想耽误节后上班!网友惊到
全球热头条丨《黑豹2》中国角色海报发布:全员黑色皮肤 2月7日上映
看点:我国自研水陆飞机!“鲲龙”AG600M全面进入型号取证试飞阶段
博客园主题美化DIY教程
全球短讯!优秀前端都应该具备的开发好习惯,坚持了效率翻倍
每日视讯:有博主称《满江红》制作成本不到1000万!歌手胡彦斌一番话上了热搜第一
视焦点讯!Xbox月活用户突破1.2亿!微软赢麻了
全球快看:强盛集团橱窗上架《孙子兵法》:还卖小灵通手机壳
迄今为止最庞大的公版显卡来了?RTX 4090Ti/Titan曝光
比亚迪正式进军日本市场卖车:“两田一产”如临大敌
世界消息!Linux 服务器Python后台运行服务(ssh断开不退出)
资讯推荐:Docker-consul的容器服务更新与发现
【天天时快讯】记录--手把手教学,实现一个优雅的图片预览
每日快报!首款车明年量产!小米汽车最新专利公布:手表控制车有戏
天天热文:A卡游戏画面鲜艳 N卡灰蒙蒙?可能是这里设置错了
焦点播报:北美杀入前十后《流浪地球2》官宣:2月9日在中国香港及澳门上映
焦点简讯:三体人为什么那么害怕地球人的加速器?中科院科普
中国航天科技喊话《流浪地球2》:太空天梯、地球车站、空间驿站有望实现
全球报道:网易二面:CPU狂飙900%,该怎么处理?
每日看点!男子打赏女主播1.8万后起诉欲要回!最终被驳回诉求
焦点速递!男子寄5万元笔记本被摔坏索赔遭拒:屏幕、键盘都烂了 维修要2万
动视暴雪点赞《最后生还者》:索尼令人敬畏 我们被收购是应该的
天天热头条丨官网12.4万元帕纳梅拉遭抢购 保时捷:情况属实 已与首单用户达成协议
当前观察:索尼PS5现货全开放!黄牛惨了:带大量机器退货遭拒
环球资讯:Redis数据结构实战演练,看看微博、微信、购物车、抽奖小程序是如何使用的?
全球聚焦:【促进开发】上海道宁与DHTMLX为您提供易于使用且功能丰富的JavaScript组件
APITable:免费开源的多维表格与可视化数据库,上线1天斩获GitHub星标1000+
今日精选:HTTP笔记1--网络模型