ZooKeeper下载安装及简单使用
ZooKeeper下载安装(Windows版本)参考博客
https://www.cnblogs.com/mh-study/p/10368891.html
添加Zookeeper依赖
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.9</version>
</dependency>
启动ZooKeeper:./zkServer.sh start  查看ZooKeeper连接:./zkCli.sh  使用cmd连接ZooKeeper:zkCli.cmd -server 127.0.0.1:2181  查看指定路径下包含的节点:ls / 查看指定节点的服务名:ls /节点名 查看指定服务的流水号:ls /节点名/服务名 查看指定服务的详细信息:get ls /节点名/服务名/流水号  注册到ZooKeeper的服务节点为临时节点,服务关闭节点会立即从ZooKeeper中删掉
Consul下载安装及简单使用
官网下载地址:https://www.consul.io/downloads
查看consul版本号:consul --version  启动consul:consul agent -dev   添加Consul依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
|