0

I have deployed 3 schema registry pods on a k8s cluster. I am trying to find which schema registry pod is currently acting as a master.

I have figured it out one way to find master through schema registry logs. Here I have to check all pods logs manually.

Is there any command or configuration file in schema-registry to get the current master?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Sheshananda Naidu
  • 905
  • 1
  • 9
  • 10
  • "check all pods logs manually" - Well, if you setup something like Filebeat/Fluentd into Elasticsearch, you wouldn't need to do that. Anyways, the answer here depends if using Zookeeper or Kafka based election because the master id will be written into Zookeeper – OneCricketeer Jul 09 '18 at 02:07

1 Answers1

1

Get the master SR from ZK:

/usr/lib/zookeeper/bin/zkCli.sh

[zk: localhost:2181(CONNECTED) 1] get /schema_registry/schema_registry_master
{"host":"host name of current master schema registry","port":8081,"master_eligibility":true,"scheme":"http","version":1}
cZxid = ...
ctime = ...
mZxid = ...
mtime = ...
pZxid = ...
cversion = ...
dataVersion = ...
aclVersion = ...
ephemeralOwner = ...
dataLength = ...
numChildren = ...
Vassilis
  • 914
  • 8
  • 23