forked from docs/doc-exports
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>
32 lines
7.9 KiB
HTML
32 lines
7.9 KiB
HTML
<a name="mrs_01_1753"></a><a name="mrs_01_1753"></a>
|
|
|
|
<h1 class="topictitle1">How Do I Delete UDFs on Multiple HiveServers at the Same Time?</h1>
|
|
<div id="body1595924880897"><div class="section" id="mrs_01_1753__s6380d631a944450391eb3eb1aa7c4546"><h4 class="sectiontitle">Question</h4><p id="mrs_01_1753__afb92bd6e0dc6407fa170ca8c40a37b6d">How can I delete permanent user-defined functions (UDFs) on multiple HiveServers at the same time?</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1753__s76f9b6de7b8146349714e967fa0f2cf7"><h4 class="sectiontitle">Answer</h4><p id="mrs_01_1753__a84f92017392e48b78e8d36c1f920970d">Multiple HiveServers share one MetaStore database. Therefore, there is a delay in the data synchronization between the MetaStore database and the HiveServer memory. If a permanent UDF is deleted from one HiveServer, the operation result cannot be synchronized to the other HiveServers promptly.</p>
|
|
<p id="mrs_01_1753__a838d712499ee40dda3cb116c1b8bb03f">In this case, you need to log in to the Hive client to connect to each HiveServer and delete permanent UDFs on the HiveServers one by one. The operations are as follows:</p>
|
|
<ol id="mrs_01_1753__obd7030cf3ec04be6b73e50463bae2b5c"><li id="mrs_01_1753__lcad486aaf12a4b0397fad5a17c9298cd"><span>Log in to the node where the Hive client is installed as the Hive client installation user.</span></li><li id="mrs_01_1753__l5590180054df44fc9303048bbd4737f1"><span>Run the following command to go to the client installation directory:</span><p><p id="mrs_01_1753__ad4b2e529b3aa4a208332dacfb3e293e8"><strong id="mrs_01_1753__a60cc9091616349ea99f23dcdef0f7ca6">cd </strong><i><span class="varname" id="mrs_01_1753__va2bbd0e91dab421f8eff63e760ae3e7a">Client installation directory</span></i></p>
|
|
<p id="mrs_01_1753__a3a25f9cf219a4122a076caaec50a142e">For example, if the client installation directory is <strong id="mrs_01_1753__b207181624376">/opt</strong><strong id="mrs_01_1753__b27184241373"></strong><strong id="mrs_01_1753__b171814247715">/client</strong>, run the following command:</p>
|
|
<p id="mrs_01_1753__a65ab9daeca254871acf5b7c45299eb95"><strong id="mrs_01_1753__a658cd06c8f8c4ad3bef04a116f08587b">cd /opt/client</strong></p>
|
|
</p></li><li id="mrs_01_1753__l2929b2a59bc347abb4eda944a849db8f"><span>Run the following command to configure environment variables:</span><p><p id="mrs_01_1753__ac45ad8626fe74808bd03055e288f634c"><strong id="mrs_01_1753__ae473b290b2534831b96be36d2235b34e">source bigdata_env</strong></p>
|
|
</p></li><li id="mrs_01_1753__lae695bd9b5874996a98dd7b0e122b3b9"><span>Run the following command to authenticate the user:</span><p><p id="mrs_01_1753__a6ad048d3089c4ace8666d5bbab0b5316"><strong id="mrs_01_1753__a878766605df24bd19aff5ca2deab5e12">kinit</strong> <i><span class="varname" id="mrs_01_1753__varname362013221576">Hive service user</span></i></p>
|
|
<div class="note" id="mrs_01_1753__n8f2df59923db47d0b6b40e060fd9c5d2"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_1753__a6800c40ce5674c748c1a8feb4ea93822">The login user must have the Hive admin rights.</p>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_1753__l7ef35cc9f4de4ef9966a1cda923d47e5"><a name="mrs_01_1753__l7ef35cc9f4de4ef9966a1cda923d47e5"></a><a name="l7ef35cc9f4de4ef9966a1cda923d47e5"></a><span>Run the following command to connect to the specified HiveServer:</span><p><p id="mrs_01_1753__en-us_topic_0116216636_p445229417234"><strong id="mrs_01_1753__a9f529b84a73445588c2da5a26ca49322">beeline -u "jdbc:hive2://</strong><i><span class="varname" id="mrs_01_1753__v3b9f170960774013a38b5d6603ba7a5c">10.39.151.74</span></i><strong id="mrs_01_1753__en-us_topic_0116216636_b821231517420">:</strong><i><span class="varname" id="mrs_01_1753__v45d01f81b9f0462494aee7ba9b8220ab">21066</span></i><strong id="mrs_01_1753__ab042bb720634420a8a564dcdbd5e028b">/default;sasl.qop=auth-conf;auth=KERBEROS;principal=</strong><i><span class="varname" id="mrs_01_1753__ve6eb3cb2b87045b3a43370fbadaffea7">hive</span></i>/<i><span class="varname" id="mrs_01_1753__v0c58e7bdca574f2199a6cdb31d6a8c63">hadoop.<system domain name>@<system domain name></span></i>"</p>
|
|
<div class="note" id="mrs_01_1753__ncbc02d344d0d446e8263d856714ed442"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_1753__u3d94f90b8d574d18a2d6ba9480b8e980"><li id="mrs_01_1753__l7295388d432d4d578f9972e7c0ddfac7"><i><span class="varname" id="mrs_01_1753__v83d627cedbc240378acaa0ee1633f17b">10.39.151.74</span></i> is the IP address of the node where the HiveServer is located.</li><li id="mrs_01_1753__l48512845b34d40f88928045bee692665"><i><span class="varname" id="mrs_01_1753__v605a41bef08641498651fd16ac36321e">21066</span></i> is the port number of the HiveServer. The HiveServer port number ranges from 21066 to 21070 by default. Use the actual port number.</li><li id="mrs_01_1753__lfadbebe4aea7487baaf92649e1001316"><i><span class="varname" id="mrs_01_1753__vb7051867032745f482c1805bd8c54e49">hive</span></i> is the username. For example, if the Hive1 instance is used, the username is <strong id="mrs_01_1753__b16369123021011">hive1</strong>.</li><li id="mrs_01_1753__li1067119614316">You can log in to FusionInsight Manager, choose <strong id="mrs_01_1753__b47672043353053">System</strong> > <strong id="mrs_01_1753__b17768683753053">Permission</strong> > <strong id="mrs_01_1753__b71786366553053">Domain and Mutual Trust</strong>, and view the value of <strong id="mrs_01_1753__b194070201053053">Local Domain</strong>, which is the current system domain name.</li><li id="mrs_01_1753__li7817963115"><span class="parmvalue" id="mrs_01_1753__parmvalue361312185295"><b>hive/hadoop.<span id="mrs_01_1753__text1061316189290"><em id="mrs_01_1753__i17613111802915"><system domain name></em></span></b></span> is the username. All letters in the system domain name contained in the username are lowercase letters.</li></ul>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_1753__lb890fe49d684425ba9362545104951ec"><span>Run the following command to enable the Hive admin rights:</span><p><p id="mrs_01_1753__a829a626a708d4d79924d892e95d636f1"><strong id="mrs_01_1753__aa2913fa76d22416da50bbbaccef24b1a">set role admin;</strong></p>
|
|
</p></li><li id="mrs_01_1753__l25d12549a0cb4699a3bb73e9cc4e8ad6"><span>Run the following command to delete the permanent UDF:</span><p><p id="mrs_01_1753__acc1a1af8b0a84bdd9f433064a447a829"><strong id="mrs_01_1753__a0ec73249a1014ea8be80f47527f781a7">drop function </strong><i><span class="varname" id="mrs_01_1753__vce7cee74fbac451199649540a6ea926a">function_name</span></i><strong id="mrs_01_1753__a26079fdad8ad41d18675dc75da8d9593">;</strong></p>
|
|
<div class="note" id="mrs_01_1753__nc771902498f34fdda6eb3ea4be2b80d5"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_1753__u7b037d2c937e48aabc4e24e2c92bfbe2"><li id="mrs_01_1753__l1dfd0134808e4f30bd76b5fba72b7e01"><i><span class="varname" id="mrs_01_1753__v055d204142a04b2d9abb66c253392ffa">function_name</span></i> indicates the name of the permanent function.</li><li id="mrs_01_1753__l5c260dffeb724208af7c8baa0fec8360">If the permanent UDF is created in Spark, the permanent UDF needs to be deleted from Spark and then from HiveServer by running the preceding command.</li></ul>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_1753__le21b6d558b2247f1b98b961c0ae2f095"><span>Check whether the permanent UDFs are deleted from all HiveServers.</span><p><ul id="mrs_01_1753__u01e0dc105834435d8971757ffe05ebf4"><li id="mrs_01_1753__lc0cee105a0114315b800441f3119c54f">If yes, no further action is required.</li><li id="mrs_01_1753__lc9aef916f44b4434b5b22ef3f2acc4c7">If no, go to <a href="#mrs_01_1753__l7ef35cc9f4de4ef9966a1cda923d47e5">5</a>.</li></ul>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1752.html">Common Issues About Hive</a></div>
|
|
</div>
|
|
</div>
|
|
|