[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
1.安装
下载 zookeeper-3.4.10.tar.gz(需要的小伙伴可以找我要压缩包,也可以自己去官网下载)
root@ubuntu:/home/seven# cd ./pro root@ubuntu:/home/seven/pro# ls zookeeper
root@ubuntu:/home/seven/pro# cd ./zookeeper/
root@ubuntu:/home/seven/pro/zookeeper# ls zookeeper-3.4.10.tar.gz
root@ubuntu:/home/seven/pro/zookeeper# tar -zxvf zookeeper-3.4.10.tar.gz
zookeeper也是一个c/s架构的中间件。zookeeper是免安装的,解压之后可以直接使用的,但是第一次使用之前需要配置一下才可以。
1.1安装openjdk
执行更新
apt-get update
安装openjdk8
sudo apt-get install openjdk-8-jdk
确认安装成功
java -version
2.配置
root@ubuntu:/home/seven/pro/zookeeper# ls zookeeper-3.4.10
zookeeper-3.4.10.tar.gz root@ubuntu:/home/seven/pro/zookeeper# cd
./zookeeper-3.4.10 root@ubuntu:/home/seven/pro/zookeeper/zookeeper-3.4.10# ls
bin contrib ivysettings.xml LICENSE.txt README.txt zookeeper-3.4.10.jar
zookeeper-3.4.10.jar.sha1 build.xml dist-maven ivy.xml NOTICE.txt recipes
zookeeper-3.4.10.jar.asc conf docs lib README_packaging.txt src
zookeeper-3.4.10.jar.md5
root@ubuntu:/home/seven/pro/zookeeper/zookeeper-3.4.10# cd ./conf
root@ubuntu:/home/seven/pro/zookeeper/zookeeper-3.4.10/conf# ls
configuration.xsl log4j.properties zoo_sample.cfg
root@ubuntu:/home/seven/pro/zookeeper/zookeeper-3.4.10/conf# vim zoo_sample.cfg
root@ubuntu:/home/seven/pro/zookeeper/zookeeper-3.4.10/conf#
修改配置文件里面的数据路径,不要存储在/tmp里面,因为电脑关机,数据会丢失。修改完了保存退出。
然后 mv zoo_sample.cfg zoo.cfg修改一下名字
3.开始启动zookeeper
进入到 bin目录下面
看到zkCli.sh 和zkServer.sh,这两个分别是客户端和服务端程序。服务端程序有几种模式的
我们可以通过参数设置zookeeper的命令进行设置。执行下面命令,即可启动
./zkServer.sh start ps -ef | grep zookeeper netstat -tanp