Yang, Tong 6182f91ba8 MRS component operation guide_normal 2.0.38.SP20 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2022-12-09 14:55:21 +00:00

24 lines
2.4 KiB
HTML

<a name="mrs_01_2110"></a><a name="mrs_01_2110"></a>
<h1 class="topictitle1">Why Four Letter Commands Don't Work With Linux netcat Command When Secure Netty Configurations Are Enabled at Zookeeper Server?</h1>
<div id="body1595905686484"><div class="section" id="mrs_01_2110__sa16d74e818ca4b1f811552f9c5481a87"><h4 class="sectiontitle">Question</h4><p id="mrs_01_2110__a89d2847da51549c39e5dc15c8bd6f254">Why four letter commands do not work with linux netcat command when secure netty configurations are enabled at Zookeeper server?</p>
<p id="mrs_01_2110__a3b68cc82e24e4121ae4f1f0ea6752439">For example,</p>
<p id="mrs_01_2110__acc3095224cff4454ab083c52fe486581"><i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2110__c1e5e0d4fcda645c28e95ac9f9ece7787">echo stat |netcat host port</span></b></i></p>
</div>
<div class="section" id="mrs_01_2110__sf060720c7726430d9e77cadc78516d95"><h4 class="sectiontitle">Answer</h4><p id="mrs_01_2110__abc3dcba5c9f6432f99976163b269f233">Linux <i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2110__c4f937a0793db480c8d60323ba6033cb8">netcat</span></b></i> command does not have option to communicate Zookeeper server securely, so it cannot support Zookeeper four letter commands when secure netty configurations are enabled.</p>
<p id="mrs_01_2110__a4fc938b615544950bc120e862f19ee83">To avoid this problem, user can use below Java API to execute four letter commands.</p>
<pre class="screen" id="mrs_01_2110__sf3d282f5770243d1b460d162256a404b">org.apache.zookeeper.client.FourLetterWordMain</pre>
<p id="mrs_01_2110__ab8268063dd6e4eeea2c54e0b28cf3edd">For example,</p>
<pre class="screen" id="mrs_01_2110__s81117cb7bbf4404cb897dc6833422863">String[] args = new String[]{host, port, "stat"};
org.apache.zookeeper.client.FourLetterWordMain.main(args);</pre>
<div class="note" id="mrs_01_2110__n3d38165bea4541318ba3a823f9c0de8f"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_2110__a0e717370569a44e7a511fdbe593e6aba"><i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2110__c695160c2540c442a8e2a215623324f06">netcat</span></b></i> command should be used only with non secure netty configuration.</p>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_2107.html">Common Issues About ZooKeeper</a></div>
</div>
</div>