Technology sharing

Install Zookeeper in Fenestra

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

install

download link:Apache ZooKeeper

Versio downloaded: zookeeper-3.4.12

Post demptionem, unzip

Configurationis

1. Create a "data" folder et "log" folder in D: zookeeper-3.4.12 folder

2. Exemplar zoo_sample.cfg et secunda nomine: zoo.cfg

Mutare file zoo.cfg

  1. # The number of milliseconds of each tick
  2. tickTime=2000
  3. # The number of ticks that the initial
  4. # synchronization phase can take
  5. initLimit=10
  6. # The number of ticks that can pass between
  7. # sending a request and getting an acknowledgement
  8. syncLimit=5
  9. # the directory where the snapshot is stored.
  10. # do not use /tmp for storage, /tmp here is just
  11. # example sakes.
  12. #dataDir=/tmp/zookeeper
  13. dataDir=D:zookeeper-3.4.12data
  14. dataLogDir=D:zookeeper-3.4.12log
  15. # the port at which the clients will connect
  16. clientPort=2181
Start up

Intrant indicem: D: zookeeper-3.4.12bin

1. Judicium zkServer.cmd

2. judicium zkCli.cmd

  1. #连接本地zk
  2. zkCli.cmd
  3. #链接远程zk
  4. zkCli.cmd -server ip:port
Simplex usus

Agunt in zkCli.cmd

1. crea lymphaticorum

 create /test "my_data"

Node:/test

Valorem: my_data

Nota: Cum nodi in zk creant, incipere debet ab "/", alioquin error affertur;Imperium defecit: java.lang.IllegalArgumentException: Semita incipere debet / character

2. Get lymphaticorum

get /test

3. Modify nodis

 set /test "abc"

4. puer crea lymphaticorum

create /test/child "child"

5. View pueri lymphaticorum

ls /test

6. Delere nodi

delete /test/child