Although it seems wired, Since the broker.id can be overridden in command line, so the broker.id in config/server.properties might not be the real id. It seems that no official command support the finding broker.id, and Andrew Otto's way is more reasonable. There are also two other ways to find the real broker.id. 1. When the broker was being started, the real broker.id will be print on the console or log, and you can check the console or log to find it. 2. Brokers' hostnames(or ip) were kept on zookeeper, so you can find the broker.id according to the broker's hostname(or ip)
On Fri, Feb 17, 2017 at 3:16 AM, Andrew Otto <o...@wikimedia.org> wrote: > Best I got for ya, using https://github.com/r4um/jmx-dump > > $ broker_hostname=localhost > $ jmx_port=9999 > $ java -jar jmx-dump-0.4.2-standalone.jar -h $broker_hostname -p $jmx_port > -m | grep ‘kafka.server:id=.*type=app-info’ > kafka.server:id=12,type=app-info > > This will only work if a JMX port is configured. You can enable this by > setting > -Dcom.sun.management.jmxremote -Dcom.sun.management. > jmxremote.port=$jmx_port > when starting your broker. > > > > > > On Thu, Feb 16, 2017 at 5:23 AM, Manikumar <manikumar.re...@gmail.com> > wrote: > > > If broker id is not set, then a unique broker id will be generated. > > This is stored in meta.properties file of data logs directory. > > This is id is also available through JMX mbean. > > > > On Thu, Feb 16, 2017 at 12:32 PM, Stevo Slavić <ssla...@gmail.com> > wrote: > > > > > You can just grep it from broker's config/server.properties > > > > > > On Thu, Feb 16, 2017 at 7:42 AM, kay James <myvide...@gmail.com> > wrote: > > > > > > > Is there any command can be used to get broker.id on one of broker > > with > > > > command? > > > > I can check zookeeper or check the broker starting log to find > > broker.id > > > , > > > > but I wander whether there is any command to get the broker.id? > > > > > > > > > >