{"id":1373,"date":"2020-02-12T22:18:48","date_gmt":"2020-02-12T14:18:48","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=1373"},"modified":"2020-02-12T22:19:34","modified_gmt":"2020-02-12T14:19:34","slug":"inceptor-%e7%9a%84%e5%85%83%e6%95%b0%e6%8d%ae%e5%ba%93%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=1373","title":{"rendered":"Inceptor \u7684\u5143\u6570\u636e\u5e93\u7ba1\u7406"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>\u5143\u6570\u636e\u5e93\u662f\u7528\u6765\u8bb0\u5f55\u5b58\u50a8\u5728Hive\u4e2d\u7684\u6570\u636e\u7684\u63cf\u8ff0\u4fe1\u606f\u3002 \u4e00\u822c\u5305\u542b\u8868\u540d\u3001\u8868\u7684\u5217\u3001\u5206\u533a\u3001\u4ee5\u53ca\u5c5e\u6027\u503c\u3001\u8868\u7684\u5c5e\u6027\uff08\u5185\u5916\u8868\uff0c\u8868\u7c7b\u578b\u7b49\uff09\u3001\u8868\u6570\u636e\u6240\u5728\u7684\u76ee\u5f55\uff1b Hive\u9ed8\u8ba4\u7684metastore\u662f\u5b58\u50a8\u5728derby\u4e2d\uff0c\u6570\u636e\u5b58\u50a8\u76ee\u5f55\u4e0d\u56fa\u5b9a\uff0c\u6570\u636e\u5e93\u662f\u8ddf\u7740hive\u8d70\u7684\uff0c\u4e0d\u65b9\u4fbf\u7ba1\u7406\uff1b\u6240\u4ee5TDH \u4e2d\u7684Inceptor Metastore \u914d\u7f6e\u4e86\u81ea\u5df1\u7684\u6570\u636e\u5e93\uff1b<br \/>\n\u672c\u6848\u4f8b\u7b80\u5355\u4ecb\u7ecd\u4e24\u79cd Inceptor Metastore \u7684\u67e5\u770b\u65b9\u5f0f\uff1b<br \/>\n\u672c\u6848\u4f8b\u73af\u5883\uff1aTDH 5.2.2\u3001TDH 4.8.0<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<p>TDH\u4e2d\u7684Inceptor\u5c06\u5143\u6570\u636e\u5b58\u50a8\u5230\u81ea\u5df1\u642d\u5efa\u7684\u6570\u636e\u5e93\u4e2d\uff0c\u5728TDH 4.x\u7248\u672c\u4e2d\uff0cinceptor\u5143\u6570\u636e\u662f\u4ee5mysql\u6570\u636e\u5e93\u5b58\u50a8\uff0c\u5728TDH 5.x\u7248\u672c\u4e2d\uff0cinceptor\u662f\u4ee5 TXSQL \u6570\u636e\u5e93\u5b58\u50a8\u5143\u6570\u636e\uff1b\u4e24\u4e2a\u7248\u672c\u4e0bmetastore\u7684\u767b\u5f55\u65b9\u5f0f\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>4.x \u7248\u672c\u4e2d\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u76f4\u63a5\u83b7\u53d6\u767b\u5f55\u4fe1\u606f<\/li>\n<li>5.x \u7248\u672c\u4e2d\u901a\u8fc7\u67e5\u770b txsql \u914d\u7f6e\u4fe1\u606f\u548c pod \u7684\u63cf\u8ff0\u4fe1\u606f\u83b7\u53d6\u767b\u5f55\u4fe1\u606f<\/li>\n<\/ul>\n<h3>\u64cd\u4f5c\u6b65\u9aa4<\/h3>\n<ol>\n<li>\u83b7\u53d6\u767b\u5f55\u4fe1\u606f<\/li>\n<li>\u767b\u5f55 Metastore<\/li>\n<\/ol>\n<h4>4.x \u7248\u672c\u767b\u5f55 Metastore<\/h4>\n<p>\u4ece Inceptor \u7684\u914d\u7f6e\u4fe1\u606f\u4e2d\u83b7\u53d6 Metastore \u767b\u5f55\u4fe1\u606f\uff0c\u5bf9\u5e94\u7684 Inceptor \u914d\u7f6e\u6587\u4ef6\u4e3a\uff1a<strong><code>\/etc\/inceptorsql1\/conf\/hive-site.xml<\/code><\/strong><br \/>\nmysql \u7684\u8fde\u63a5 URL \u4e2d\u5305\u542b\u4e86\u767b\u5f55\u4e3b\u673a\u540d\u3001metastore \u7aef\u53e3\u3001\u767b\u5f55\u7528\u6237\uff08user\uff09\u3001\u767b\u5f55\u5bc6\u7801\uff08password\uff09\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1b<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2019\/11\/image-1573016421348.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">$ grep password \/etc\/inceptorsql1\/conf\/hive-site.xml -C 3\n    <\/property>\n    <property>\n        <name>javax.jdo.option.ConnectionPassword<\/name>\n        <value>password<\/value>\n    <\/property>\n    <property>\n        <name>hive.server2.enable.doAs<\/name>\n--\n    <\/property>\n    <property>\n        <name>hive.stats.dbconnectionstring<\/name>\n        <value>jdbc:mysql:\/\/tdh-42:3306\/metastore_inceptorsql1?createDatabaseIfNotExist=true&user=hiveuser&password=password&characterEncoding=UTF-8<\/value>\n    <\/property>\n    <property>\n        <name>hive.security.authorization.enabled<\/name><\/code><\/pre>\n<p>\u4f7f\u7528\u8be5\u8fde\u63a5\u4e32\u4e2d\u83b7\u53d6\u7684\u4fe1\u606f <strong><code>mysql -htdh-42 -P3306 -uhiveuser -ppassword<\/code><\/strong>\uff0c\u5373\u53ef\u767b\u5f55 Inceptor metastore \u6570\u636e\u5e93\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u5176\u4e2d metastore_inceptorsql1 \u5e93\u5c31\u662f inceptorsql \u7684 metastore \u6570\u636e\u5e93\uff1a<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2019\/11\/image-1573016841432.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">$ mysql -htdh-42 -P3306 -uhiveuser -ppassword\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 1056\nServer version: 5.5.44-MariaDB-log MariaDB Server\nCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nMariaDB [(none)]> show databases;\n+------------------------+\n| Database               |\n+------------------------+\n| information_schema     |\n| metastore_inceptorsql1 |\n| test                   |\n+------------------------+\n3 rows in set (0.00 sec)\n\nMariaDB [(none)]> <\/code><\/pre>\n<h4>5.x \u7248\u672c\u767b\u5f55 Metastore<\/h4>\n<p>\u901a\u8fc7 TXSQL  pod \u91cc\u7684\u5de5\u5177\u8fdb\u5165 Inceptor Metastore \uff0c\u5bf9\u5e94\u7684 pod \u4e3a txsql-server \u7684 pod\uff0c\u7528\u547d\u4ee4 <strong><code>kubectl get pods |grep txsql-server-txsql<\/code><\/strong> \u83b7\u53d6 txsql-server \u7684 pod \u4fe1\u606f<br \/>\n\u9009\u62e9\u72b6\u6001\u4e3a 1\/1 Running \u7684 txsql-server \u7684 pod\uff0c\u7136\u540e\u6267\u884c\u547d\u4ee4 <strong><code>kubectl exec -ti {pod-name} bash<\/code><\/strong> \u8fdb\u5165\u8be5 pod \u7684\u7ec8\u7aef\uff0c\u7136\u540e\u6267\u884c\u811a\u672c <strong><code>\/usr\/bin\/txsql\/tools\/txsql.sh localshell<\/code><\/strong>\u5373\u53ef\u767b\u5f55 Metastore \u7684\u6570\u636e\u5e93\uff0c\u67e5\u770b metastore_inceptor1 \u5e93\u5c31\u662f inceptor \u7684 metastore \u6570\u636e\u5e93\uff1b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2019\/11\/image-1573022233150.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">$ kubectl exec -ti txsql-server-txsql1-3619959039-lcp6s bash\n[root@tdh-03 \/]# \/usr\/bin\/txsql\/tools\/txsql.sh localshell\nWarning: Using a password on the command line interface can be insecure.\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 2912696\nServer version: 5.6.31-77.0-log Source distribution\n\nCopyright (c) 2009-2016 Percona LLC and\/or its affiliates\nCopyright (c) 2000, 2016, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql> show databases;\n+----------------------------+\n| Database                   |\n+----------------------------+\n| information_schema         |\n| metastore_inceptor1        |\n| mysql                      |\n| performance_schema         |\n| tdt_transporter1           |\n| test                       |\n| tmp_txsql_function_test    |\n+----------------------------+\n7 rows in set (0.09 sec)\n\nmysql>\n<\/code><\/pre>\n<p>\u81f3\u6b64\u4e24\u4e2a\u7248\u672c\u4e0b Inceptor Metastore \u7684\u767b\u5f55\u65b9\u5f0f\u4ecb\u7ecd\u5b8c\u6bd5\uff0c\u53ef\u4ee5\u901a\u8fc7 sql \u67e5\u770b\u6570\u636e\u5e93\u91cc\u9762\u7684\u8868\u83b7\u53d6\u5143\u6570\u636e\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 \u5143\u6570\u636e\u5e93\u662f\u7528\u6765\u8bb0\u5f55\u5b58\u50a8\u5728Hive\u4e2d\u7684\u6570\u636e\u7684\u63cf\u8ff0\u4fe1\u606f\u3002 \u4e00\u822c\u5305\u542b\u8868\u540d\u3001\u8868\u7684\u5217\u3001\u5206\u533a\u3001\u4ee5\u53ca\u5c5e\u6027\u503c\u3001\u8868\u7684\u5c5e ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=1373\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[106,107],"class_list":["post-1373","post","type-post","status-publish","format-standard","hentry","category-configuration","tag-metastore","tag-inceptor-"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1373","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1373"}],"version-history":[{"count":1,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1373\/revisions"}],"predecessor-version":[{"id":2302,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1373\/revisions\/2302"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}