Guest User

Untitled

a guest
Nov 23rd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.21 KB | None | 0 0
  1. private static void connectHiveMetastore() throws MetaException, MalformedURLException {
  2. //System.setProperty("javax.security.auth.useSubjectCredsOnly","false");
  3. //System.setProperty("java.security.krb5.conf","C:\kerb5.conf");
  4. Configuration configuration = new Configuration();
  5. //configuration.addResource("E:\hdp\client_config\HDFS_CLIENT\core-site.xml");
  6. //configuration.addResource("E:\hdp\client_config\HDFS_CLIENT\hdfs-site.xml");
  7. HiveConf hiveConf = new HiveConf(configuration,Configuration.class);
  8. //URL url = new File("E:\hdp\client_config\HDFS_CLIENT\hive-site.xml").toURI().toURL();
  9. //hiveConf.setHiveSiteLocation(url);
  10. //hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS,"thrift://l4283t.sss.com:9083,thrift://l4284t.sss.com:9083");
  11. HiveMetaStoreClient hiveMetaStoreClient = new HiveMetaStoreClient(hiveConf);
  12. }
  13.  
  14. </dependencies>
  15. <dependency>
  16. <groupId>junit</groupId>
  17. <artifactId>junit</artifactId>
  18. <version>3.8.1</version>
  19. <scope>test</scope>
  20. </dependency>
  21. <!-- https://mvnrepository.com/artifact/org.apache.hive/hive-metastore -->
  22. <dependency>
  23. <groupId>org.apache.hive</groupId>
  24. <artifactId>hive-metastore</artifactId>
  25. <version>2.3.2</version>
  26. </dependency>
  27. <!-- https://mvnrepository.com/artifact/org.apache.hive/hive-exec -->
  28. <dependency>
  29. <groupId>org.apache.hive</groupId>
  30. <artifactId>hive-exec</artifactId>
  31. <version>2.3.2</version>
  32. </dependency>
  33. <!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-common -->
  34. <dependency>
  35. <groupId>org.apache.hadoop</groupId>
  36. <artifactId>hadoop-common</artifactId>
  37. <version>2.9.0</version>
  38. </dependency>
  39. </dependencies>
  40.  
  41. 15:35:27.139 [main] ERROR org.apache.hadoop.hive.metastore.RetryingHMSHandler - MetaException(message:Version information not found in metastore. )
  42. at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:7564)
  43. at org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:7542)
  44. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  45. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  46. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  47. at java.lang.reflect.Method.invoke(Method.java:498)
  48. at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:101)
  49. at com.sun.proxy.$Proxy8.verifySchema(Unknown Source)
  50. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMSForConf(HiveMetaStore.java:591)
  51. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:584)
  52. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:651)
  53. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:427)
  54. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  55. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  56. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  57. at java.lang.reflect.Method.invoke(Method.java:498)
  58. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
  59. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
  60. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:79)
  61. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
  62. at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6893)
  63. at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:164)
  64. at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:129)
  65. at com.my.App.connectHiveMetastore(App.java:58)
  66. at com.my.App.main(App.java:37)
  67. 15:35:27.141 [main] ERROR org.apache.hadoop.hive.metastore.RetryingHMSHandler - HMSHandler Fatal error: MetaException(message:Version information not found in metastore. )
  68. at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:7564)
  69. at org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:7542)
  70. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  71. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  72. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  73. at java.lang.reflect.Method.invoke(Method.java:498)
  74. at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:101)
  75. at com.sun.proxy.$Proxy8.verifySchema(Unknown Source)
  76. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMSForConf(HiveMetaStore.java:591)
  77. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:584)
  78. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:651)
  79. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:427)
  80. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  81. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  82. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  83. at java.lang.reflect.Method.invoke(Method.java:498)
  84. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
  85. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
  86. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:79)
  87. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
  88. at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6893)
  89. at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:164)
  90. at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:129)
  91. at com.my.App.connectHiveMetastore(App.java:58)
  92. at com.my.App.main(App.java:37)
  93. Exception in thread "main" MetaException(message:Version information not found in metastore. )
  94. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:83)
  95. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
  96. at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6893)
  97. at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:164)
  98. at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:129)
  99. at com.my.App.connectHiveMetastore(App.java:58)
  100. at com.my.App.main(App.java:37)
  101. Caused by: MetaException(message:Version information not found in metastore. )
  102. at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:7564)
  103. at org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:7542)
  104. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  105. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  106. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  107. at java.lang.reflect.Method.invoke(Method.java:498)
  108. at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:101)
  109. at com.sun.proxy.$Proxy8.verifySchema(Unknown Source)
  110. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMSForConf(HiveMetaStore.java:591)
  111. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:584)
  112. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:651)
  113. at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:427)
  114. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  115. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  116. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  117. at java.lang.reflect.Method.invoke(Method.java:498)
  118. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
  119. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
  120. at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:79)
  121. ... 6 more
  122. Process finished with exit code 1
Add Comment
Please, Sign In to add comment