{"id":9307,"date":"2023-01-31T17:25:25","date_gmt":"2023-01-31T09:25:25","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=9307"},"modified":"2023-01-31T17:25:25","modified_gmt":"2023-01-31T09:25:25","slug":"offset-explorer%ef%bc%88kafka-tool%ef%bc%89%e8%bf%9e%e6%8e%a5kerberos%e8%ae%a4%e8%af%81%e7%9a%84kafka","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=9307","title":{"rendered":"Offset Explorer\uff08Kafka Tool\uff09\u8fde\u63a5kerberos\u8ba4\u8bc1\u7684kafka"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p><strong>Offset Explorer<\/strong>\uff082.1\u4e4b\u524d\u7684\u7248\u672c\u79f0\u4e3a<strong>Kafka Tool<\/strong>\uff09\u662f\u4e00\u4e2a\u7528\u4e8e\u7ba1\u7406\u548c\u4f7fApache Kafka\u96c6\u7fa4\u7684GUI\u5e94\u7528\u7a0b\u5e8f\u3002\u63d0\u4f9b\u4e86\u4e00\u4e2a\u8f83\u4e3a\u76f4\u89c2\u7684UI\u53ef\u8ba9\u7528\u6237\u5feb\u901f\u67e5\u770bKafka\u96c6\u7fa4\u4e2d\u7684\u5bf9\u8c61\u4ee5\u53ca\u5b58\u50a8\u5728topic\u4e2d\u7684\u6d88\u606f\u3002<\/p>\n<p>\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u901a\u8fc7offset explorer\u5982\u4f55\u8fde\u63a5TDH\u96c6\u7fa4\u4e2d\u5f00\u542fkerberos\u8ba4\u8bc1\u7684kafka\u3002<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<h4>\u5b89\u88c5Offset Explorer<\/h4>\n<p>\u8fd9\u4e2a\u8f6f\u4ef6\u7684\u5b89\u88c5\u5f88\u7b80\u5355\uff0c\u50bb\u74dc\u5f0f\u5b89\u88c5\uff0c\u76f4\u63a5\u9ed8\u8ba4\u4e0b\u4e00\u6b65\u5b89\u88c5\u5373\u53ef\uff0c\u4e0b\u8f7d\u5730\u5740\uff1a<br \/>\n<a href=\"https:\/\/www.kafkatool.com\/download.html\">https:\/\/www.kafkatool.com\/download.html<\/a><br \/>\n\u672c\u6587\u4e2d\u4f7f\u7528\u7684\u7248\u672c\u662fOffset Explorer 2.3\u3002<\/p>\n<h4>\u8fde\u63a5kafka\u914d\u7f6e<\/h4>\n<p>1\u3001\u4ecekafka\u96c6\u7fa4\u8282\u70b9\u4e0a\u62f7\u8d1d\/etc\/kafka1\/conf\/krb5.conf\u548c\/etc\/kafka1\/conf\/kafka.keytab\u5230PC\u7684\u672c\u5730\u76ee\u5f55\uff0c\u6700\u597d\u662f\u7b2c\u4e00\u5c42\u76ee\u5f55\u4e0b\uff08\u8fd9\u91cc\u76f4\u63a5\u653e\u5728D\u76d8\uff09\uff0c\u9632\u6b62\u627e\u4e0d\u5230\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673592274061.png\" alt=\"file\" \/><\/p>\n<p>2\u3001\u521b\u5efaoffset explorer\u5feb\u6377\u65b9\u5f0f\uff0c\u5e76\u4fee\u6539\u5c5e\u6027\u589e\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a<br \/>\n-J-Djava.security.krb5.conf=D:\/krb5.conf<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673592547331.png\" alt=\"file\" \/><\/p>\n<p>3\u3001\u6253\u5f00offset explorer\uff0c\u6dfb\u52a0kafka\u96c6\u7fa4\u914d\u7f6e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673592681206.png\" alt=\"file\" \/><\/p>\n<p>3.1\u3001Zookeeper\u914d\u7f6e\uff1a<br \/>\n\u96c6\u7fa4\u540d\u79f0\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff1b<br \/>\nkafka\u7248\u672c\u8fd9\u91cc\u9009\u62e90.11\uff0c\u9009\u62e9\u9ad8\u7248\u672c\u4e5f\u4e0d\u5f71\u54cd\uff1b<br \/>\nzookeeper\u5730\u5740\u548c\u7aef\u53e3\uff0c\u586b\u4e00\u4e2a\u8282\u70b9\u5c31\u53ef\u4ee5\uff0c\u5982\u679c\u4f7f\u7528\u7684\u4e3b\u673a\u540d\uff0c\u9700\u8981\u5728pc\u7684hosts\u4e2d\u6dfb\u52a0ip\u6620\u5c04\uff0c\u6dfb\u52a0\u4e4b\u540e\u53ef\u4ee5\u70b9\u51fb\u201cPing\u201d\u6d4b\u8bd5\u8fde\u901a\u6027\uff1b<br \/>\nchroot path\u9ed8\u8ba4\u6839\u76ee\u5f55\uff1b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673592825591.png\" alt=\"file\" \/><\/p>\n<p>3.2\u3001Security\u914d\u7f6e\uff1a<br \/>\n\u548c\u96c6\u7fa4\u7684kafka\u8ba4\u8bc1\u4e00\u81f4\uff0cSASL_PLAINTEXT\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673593085285.png\" alt=\"file\" \/><\/p>\n<p>3.3\u3001Advanced\u914d\u7f6e\uff1a<br \/>\nBootstrap servers\u6dfb\u52a0\u96c6\u7fa4kafka\u96c6\u7fa4\u6240\u6709\u8282\u70b9\uff0c\u8282\u70b9\u4e4b\u95f4\u9017\u53f7\u5206\u683c\uff1b<br \/>\nSASL Mechanism\u914d\u7f6e\u4e3aGSSAPI\uff0c\u5373kerberos\u8ba4\u8bc1\u65b9\u5f0f\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673593313581.png\" alt=\"file\" \/><\/p>\n<p>3.4\u3001JAAS Config \u914d\u7f6e<br \/>\n\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u5728JAAS Config\u6587\u672c\u6846\u4e2d\u914d\u7f6e\uff0c\u5185\u5bb9\u53c2\u8003\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-shell\">    com.sun.security.auth.module.Krb5LoginModule required\n    serviceName=\"kafka\"\n    useKeyTab=true\n    storeKey=true\n    useTicketCache=false\n    keyTab=\"D:\/xxll.keytab\"\n    principal=\"xxll@TDH\";<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673593778166.png\" alt=\"file\" \/><\/p>\n<p>\u4e5f\u53ef\u4ee5\u5728\u672c\u5730\u521b\u5efajaas.conf\u6587\u4ef6\uff0c\u5185\u5bb9\u53c2\u8003\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-shell\">KafkaClient{\n    com.sun.security.auth.module.Krb5LoginModule required\n    serviceName=\"kafka\"\n    useKeyTab=true\n    storeKey=true\n    useTicketCache=false\n    keyTab=\"D:\/xxll.keytab\"\n    principal=\"xxll@TDH\";\n};<\/code><\/pre>\n<p>\u7136\u540e\u5728offset explorer\u5feb\u6377\u65b9\u5f0f\u4e2d\u4fee\u6539\u5c5e\u6027\u589e\u52a0\u914d\u7f6e\uff1a<br \/>\n-J-Djava.security.krb5.conf=D:\/krb5.conf<\/p>\n<p>\u6700\u540e\u7a0b\u5e8f\u542f\u52a8\u53c2\u6570\u7684\u6574\u4f53\u914d\u7f6e\u5982\u4e0b\uff0c\u4ec5\u4f9b\u53c2\u8003:<\/p>\n<pre><code class=\"language-shell\">\"D:\\Program Files\\OffsetExplorer2\\offsetexplorer.exe\" -J-Djava.security.krb5.conf=D:\/krb5.conf -J-Djava.security.auth.login.config=D:\/jaas.conf<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673593951021.png\" alt=\"file\" \/><\/p>\n<p>\u7136\u540eADD\u6dfb\u52a0\u8fde\u63a5\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/01\/image-1673594119850.png\" alt=\"file\" \/><\/p>\n<p>\u5982\u679c\u8fde\u63a5\u62a5\u9519\u53ef\u4ee5\u5230\u7a0b\u5e8f\u7684\u5b89\u88c5\u76ee\u5f55\u4e0b\u67e5\u770berror.log\u3002<\/p>\n<h4>\u6ce8\u610f\u4e8b\u9879\u53ca\u5e38\u89c1\u8fde\u63a5\u62a5\u9519<\/h4>\n<p><strong>\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><br \/>\n1\u3001windows\u4e2d\u7684\u8def\u5f84\u95ee\u9898\uff1a<br \/>\n\u6dfb\u52a0\u5230\u7a0b\u5e8f\u542f\u52a8\u53c2\u6570\u4e2d\u7684krb5.conf\u548cjaas.conf\u6587\u4ef6\uff0c\u4ee5\u53ca\u5199\u5728jaas\u4e2dkeytab\u7684\u8def\u5f84\u5747\u662f\u659c\u6760\u201c\/\u201d\uff0c\u5982D:\/jaas.conf\uff0c\u7528\u53cd\u659c\u6760\u201c\\\u201d\u4f1a\u914d\u7f6e\u65e0\u6548\uff1b<\/p>\n<p>2\u3001\u672c\u5730\u7535\u8111\u548ckafka\u96c6\u7fa4\u8282\u70b9\u7684\u65f6\u95f4\u8981\u4fdd\u6301\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u8ba4\u8bc1\u5931\u8d25\uff1b<\/p>\n<p><strong>\u5e38\u89c1\u8fde\u63a5\u62a5\u9519\uff1a<\/strong><\/p>\n<p>1\u3001\u5f00\u542fSASL_PLAINTEXT\u8ba4\u8bc1\uff0c\u4f46\u662f\u6ca1\u6709\u914d\u7f6ejaas\uff0c\u6216\u8005jaas\u8ba4\u8bc1\u6ca1\u6709\u88ab\u8bc6\u522b\u5230\uff0c\u91cd\u65b0\u914d\u7f6e\u6216\u8005\u68c0\u67e5jaas.conf\u8def\u5f84\u3002<\/p>\n<pre><code class=\"language-shell\">java.lang.Exception: Error connecting to the cluster.JAAS config is empty and property java.security.auth.login.config not specified at Offset Explorer startup.\nWith SASL, you must specify JAAS config in the UI or start Offset Explorer by passing in JAAS config file: offsetexplorer.exe -J-Djava.security.auth.login.config=c:\/client_jaas.conf<\/code><\/pre>\n<p>2\u3001JAAS\u4e2d\u6ca1\u6709\u6307\u5b9aserviceName\uff0c\u5982\u679cjaas\u4e2d\u7684\u914d\u7f6e\u662f\u4ece\u96c6\u7fa4\/etc\/kafka1\/conf\/jaas.conf\u4e2d\u62f7\u8d1d\u7684\uff0c\u662f\u4e0d\u5305\u542bserviceName\u7684\uff0c\u9700\u8981\u6dfb\u52a0\u4e00\u6761\uff1a<br \/>\nserviceName=&quot;kafka&quot;<\/p>\n<pre><code class=\"language-shell\">Caused by: org.apache.kafka.common.KafkaException: java.lang.IllegalArgumentException: No serviceName defined in either JAAS or Kafka config<\/code><\/pre>\n<p>3\u3001jaas\u4e2d\u7684\u914d\u7f6e\u9879\u4e0d\u5bf9\uff0c\u5c24\u5176\u662fkerberos\u8ba4\u8bc1\u914d\u7f6e\uff0c\u6bd4\u5982keyTab\u8def\u5f84\u5e94\u4e3a&quot;D:\/xxll.keytab&quot; \uff0c\u4e0d\u80fd\u5199\u6210&quot;D:\\xxll.keytab&quot;\u3002<\/p>\n<pre><code class=\"language-shell\">Caused by: org.apache.kafka.common.KafkaException: javax.security.auth.login.LoginException: Could not login: the client is being asked for a password, but the Kafka client code does not currently support obtaining a password from the user. not available to garner  authentication information from the user<\/code><\/pre>\n<p>4\u3001\u6307\u5b9a\u7684JAAS.conf\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u683c\u5f0f\u4e0d\u6b63\u786e\uff0c\u6bd4\u5982\u6ca1\u6709\u5e26KafkaClient{}\u5c5e\u6027\u540d\uff0c\u6216\u6362\u884c\u6709\u95ee\u9898\uff0c\u6216\u5176\u4e2d\u7684\u53c2\u6570\u591a\u52a0\u4e86\u5206\u53f7\u3002<\/p>\n<pre><code class=\"language-shell\">Caused by: java.lang.IllegalArgumentException: Login module control flag is not available in the JAAS config<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 Offset Explorer\uff082.1\u4e4b\u524d\u7684\u7248\u672c\u79f0\u4e3aKafka Tool\uff09\u662f\u4e00\u4e2a\u7528\u4e8e\u7ba1\u7406\u548c\u4f7fApac ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=9307\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":105,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-9307","post","type-post","status-publish","format-standard","hentry","category-configuration"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/105"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9307"}],"version-history":[{"count":3,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9307\/revisions"}],"predecessor-version":[{"id":9402,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9307\/revisions\/9402"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}