網站首頁 編程語言 正文
1.安裝hive
本人前前后后找了很多hive安裝文檔,按照文檔方式安裝踩了無數的坑,前人的輪子很多, 因此大家自己實踐的時候,主要任務是搜索靠譜有效的文檔,如果是mac系統的話參考一下主要連接?https://luckymrwang.github.io/2018/03/14/Install-hive-on-Mac-with-Homebrew/?就行,注意按照上面方式操作后,需要創建mysql下的hive數據庫命令,文章漏掉了這一步.
cd /usr/local/Cellar/hive/3.1.2_3/libexec/bin
schematool -dbType mysql -initSchema
或者這篇?http://dblab.xmu.edu.cn/blog/2440-2/
2.啟動hive
1. 先啟動hadoop?
2.在啟動hive
?
3.報錯
1.比較難解決的問題 是最后運行schematool -dbType mysql -initSchema? 初始化hive時候報?Unable to load authentication plugin 'caching_sha2_password'.
schematool -dbType mysql -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hive/3.1.2_2/libexec/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/Cellar/hadoop/3.3.0/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL: jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true
Metastore Connection Driver : com.mysql.jdbc.Driver
Metastore connection User: hadoop
Mon Jan 25 14:51:11 CST 2021 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : Unable to load authentication plugin 'caching_sha2_password'.
SQL Error code: 0
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
解決方案:https://www.cnblogs.com/feiquan/p/13691980.html?按照這個文檔的方案解決了
原因:
hive/lib 下使用的jar[mysql-connector-java-5.1.42-bin.jar] 包和MySQL 版本不統一
主要原因8.x版本的驗證模塊和之前版本不同:
5.x版本是:default_authentication_plugin=mysql_native_password
8.x版本就是:default_authentication_plugin=caching_sha2_password
解決:
hive/lib 下換用新jar 包:?mysql-connector-java-8.0.15.jar? ?
cp ~/Downloads/mysql-connector-java-8.0.15/mysql-connector-java-8.0.15.jar libexec/lib
?
2.hive運行時候一直提示
Mon Jan 25 21:22:00 CST 2021 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
?
Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'characterE
tips:?
1. Xml文件中不能使用&,要使用他的轉義&來代替。
2.mysql 的Java 連接 各個版本下載?https://blog.csdn.net/weixin_41804049/article/details/87719574,可以替換?/usr/local/Cellar/hive/3.1.2_2/libexec/lib? 下面的mysql-connector-java-8.0.23? 沒有和安裝的mysql版本一直時候,可以替換
3.mac mysql 常用啟安裝和卸載操作
1.安裝
brew install mysql -- 默認最新版本
啟動mqsql
brew services start mysql 安裝后啟動下
brew services stop mysql
2.卸載
brew安裝的mysql默認在 usr/local/Celler 目錄下面很方便,建議可以brew 方式安裝軟件
先停止mysql服務
brew services stop mysql
卸載
brew uninstall mysql
4. 運行hadoop 命令 顯示 Invalid HADOOP_COMMON_HOME
WARNING: log4j.properties is not found. HADOOP_CONF_DIR may be incomplete.
ERROR: Invalid HADOOP_COMMON_HOME
解決方案: 這個問題我在百度找了一晚上沒有什么解決方案,一度懷疑人生,差點吧hadoop的配置文件都看了一遍, 后來在google 上搜到了答案, 如下第六個問題, 一般打不開貼上問題解決方案. 因為我安裝的hadoop3.0以上的版本, 可能低版本的沒有這個問題,意思是說hadoop在v3 以上不需要在bash_profile 上配置HADOOP_HOME路徑,我在百度上搜的都是3.0以下的配置, 以后的同學再安裝hadoop注意啊,看清上下文.
連接:Complete Apache Hadoop Troubleshooting | by Pete Houston | Medium https://medium.com/@petehouston/complete-apache-hadoop-troubleshooting-660122eac6a5
Question 5: After setting up Apache Hadoop, any hadoop command issued shows following error : ERROR: Invalid HADOOP_COMMON_HOME. What happen?
If I’m not mistaken, it looks like you follow wrong or out-of-date Hadoop installation tutorial. Commonly, prior to Hadoop v3, installation often requires to export HADOOP_HOME environment. However, this is a NO-NO for Hadoop v3.
The solution is to drop that HADOOP_HOME, which means:
$ export HADOOP_HOME=
Unset it, then it’s done.
If you’re on a Mac and problem still happens, try to follow my guide on setting up Apache Hadoop on Mac.
5.mysql 運行報錯 mysql ERROR 2002 (HY000): '/tmp/mysql.sock'
說明問題:搜了很多博客,都是修改配置文件,都不好使, 只能卸載重新裝了,主要是刪除 這個目錄下面的內容?
sudo rm -rf /usr/local/var/mysql
解決參考鏈接:?https://cloud.tencent.com/developer/article/1468919
多看看官網:?https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html
6.Hadoop: connect to host localhost port 22: Connection refused when running start-dfs.sh
在mac環境下打開網絡連接,即在偏好設置中-> 共享(share) -> 遠程連接勾選
7. hive 啟動是報 Access denied for user 'root'@'localhost' (using password: YES)?
問題原因:
根據報錯顯示密碼正確,但是權限不夠,因此主要目的是解決權限問題
解決方案:
1.root 方式登錄msyql
2.給hive用戶增加權限
GRANT INSERT, SELECT, DELETE, UPDATE ON hive.* TO 'hive'@'localhost' IDENTIFIED BY '123456';
flush privileges; 刷新數據庫
參考連接: https://stackoverflow.com/questions/20353402/access-denied-for-user-testlocalhost-using-password-yes-except-root-user
8.ssl 認證問題??https://blog.csdn.net/qq_41785135/article/details/85118329
9.Relative path in absolute URI:?問題??https://blog.csdn.net/fhg12225/article/details/45817477
10. 找不到主類:?https://blog.csdn.net/qq_29232943/article/details/103788404
4.總結
? ?1.安裝hive 的過程中很容易出現找不到解決問題的情況,因為放假自己安裝沒有人可以請教, 經常陷入死胡同, 殺手锏就是 卸載再來一遍. 2.安裝過程中發現自己對hive sql還是停留在使用上, 不知道底層原理,對各種報錯,查詢文檔,不知所以然,基本功還是不好,需要把hive的官方文檔好好閱讀.? 3.最重要的遇到問題不要急,學會仔細看報錯日志,留意關鍵錯誤信息.
?
原文鏈接:https://blog.csdn.net/stay_forever/article/details/113142206
相關推薦
- 2023-01-17 解讀python?cvxpy下SDP問題編程_python
- 2022-06-09 ASP.NET?Core使用EF創建模型(索引、備用鍵、繼承、支持字段)_實用技巧
- 2023-02-17 C++可執行文件絕對路徑值與VS安全檢查詳解_C 語言
- 2022-06-08 FreeRTOS實時操作系統支持時間片示例詳解_操作系統
- 2024-04-07 mybatis-plus插入數據庫值無效(插入不對,沒有插入數據庫默認值,int的類型的null會變
- 2022-10-30 SwiftUI?List在MacOS中的性能優化示例_Swift
- 2022-09-15 c語言如何實現兩數之和_C 語言
- 2022-03-14 surface屏幕自動調節亮度無法關閉
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支