-
-
Notifications
You must be signed in to change notification settings - Fork 13
Update getting-started.adoc - set zookeeper cli port #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/25.3
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
I have left two comments suggestion two small changes.
Co-authored-by: Techassi <[email protected]>
Co-authored-by: Techassi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, good catch! I don't think we need to complicate the surrounding text, but we should definitely be aware of this. ..especially since this affects our default configuration.
|
||
[source,bash] | ||
---- | ||
kubectl exec -i -t simple-zk-server-primary-0 -- bin/zkCli.sh | ||
# optional, determine the port | ||
PORT=$(kubectl get pod simple-zk-server-primary-0 -o=jsonpath='{.spec.containers[0].ports[0].containerPort}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm.. I don't think we should assume the order of the containers or ports. If we use jq we can decouple from that.
PORT=$(kubectl get pod simple-zk-server-primary-0 -o=jsonpath='{.spec.containers[0].ports[0].containerPort}') | |
PORT="$(kubectl get pod simple-zk-server-primary-0 -o=json | jq '.spec.containers[].ports[] | select(.name == "zk") | .containerPort')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, jq might be the better alternative. The idea was just to use the kubectl builtin features to keep it simple. If the order could change i would also prefer jq.
We can test ZooKeeper by running the ZooKeeper CLI shell. The easiest way to do this is to run the CLI shell on the pod that is running ZooKeeper. It might be necessary to determine and set the port. | ||
|
||
[source,bash] | ||
---- | ||
kubectl exec -i -t simple-zk-server-primary-0 -- bin/zkCli.sh | ||
# optional, determine the port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to tell people to do the wrong thing first, might as well just do the correct thing immediately.
We can test ZooKeeper by running the ZooKeeper CLI shell. The easiest way to do this is to run the CLI shell on the pod that is running ZooKeeper. It might be necessary to determine and set the port. | |
[source,bash] | |
---- | |
kubectl exec -i -t simple-zk-server-primary-0 -- bin/zkCli.sh | |
# optional, determine the port | |
We can test ZooKeeper by running the ZooKeeper CLI shell. The easiest way to do this is to run the CLI shell on the pod that is running ZooKeeper. | |
[source,bash] | |
---- |
|
||
[source,bash] | ||
---- | ||
kubectl exec -i -t simple-zk-server-primary-0 -- bin/zkCli.sh | ||
# optional, determine the port | ||
PORT=$(kubectl get pod simple-zk-server-primary-0 -o=jsonpath='{.spec.containers[0].ports[0].containerPort}') | ||
echo $PORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we need to print this out, to be honest.
echo $PORT |
In my case the default port was not correct, leading to an error: