私の連絡先情報
郵便メール:
2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
ダウンロードリンク:Apache ズーキーパー
私がダウンロードしたバージョン:zookeeper-3.4.12
ダウンロード後、解凍してください
1. D:zookeeper-3.4.12 フォルダー内に「data」フォルダーと「log」フォルダーを作成します。
2.zoo_sample.cfgをコピーし、名前をzoo.cfgに変更します。
Zoo.cfg ファイルを変更する
- # The number of milliseconds of each tick
- tickTime=2000
- # The number of ticks that the initial
- # synchronization phase can take
- initLimit=10
- # The number of ticks that can pass between
- # sending a request and getting an acknowledgement
- syncLimit=5
- # the directory where the snapshot is stored.
- # do not use /tmp for storage, /tmp here is just
- # example sakes.
- #dataDir=/tmp/zookeeper
- dataDir=D:zookeeper-3.4.12data
- dataLogDir=D:zookeeper-3.4.12log
- # the port at which the clients will connect
- clientPort=2181
ディレクトリを入力します: D:zookeeper-3.4.12bin
1. zkServer.cmdを実行します。
2. zkCli.cmdを実行します。
- #连接本地zk
- zkCli.cmd
-
- #链接远程zk
- zkCli.cmd -server ip:port
zkCli.cmdでの操作
1. ノードの作成
create /test "my_data"
ノード:/テスト
値: my_data
注: zk でノードを作成するときは、「/」で始める必要があります。そうしないと、エラーが報告されます。コマンドが失敗しました: java.lang.IllegalArgumentException: パスは / 文字で始まる必要があります
2. ノードを取得する
get /test
3. ノードを変更する
set /test "abc"
4. 子ノードの作成
create /test/child "child"
5. 子ノードを表示する
ls /test
6. ノードの削除
delete /test/child