網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
1.安裝hive
本人前前后后找了很多hive安裝文檔,按照文檔方式安裝踩了無數(shù)的坑,前人的輪子很多, 因此大家自己實(shí)踐的時(shí)候,主要任務(wù)是搜索靠譜有效的文檔,如果是mac系統(tǒng)的話參考一下主要連接?https://luckymrwang.github.io/2018/03/14/Install-hive-on-Mac-with-Homebrew/?就行,注意按照上面方式操作后,需要?jiǎng)?chuàng)建mysql下的hive數(shù)據(jù)庫(kù)命令,文章漏掉了這一步.
cd /usr/local/Cellar/hive/3.1.2_3/libexec/bin
schematool -dbType mysql -initSchema
或者這篇?http://dblab.xmu.edu.cn/blog/2440-2/
2.啟動(dòng)hive
1. 先啟動(dòng)hadoop?
2.在啟動(dòng)hive
?
3.報(bào)錯(cuò)
1.比較難解決的問題 是最后運(yùn)行schematool -dbType mysql -initSchema? 初始化hive時(shí)候報(bào)?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?按照這個(gè)文檔的方案解決了
原因:
hive/lib 下使用的jar[mysql-connector-java-5.1.42-bin.jar] 包和MySQL 版本不統(tǒng)一
主要原因8.x版本的驗(yàn)證模塊和之前版本不同:
5.x版本是:default_authentication_plugin=mysql_native_password
8.x版本就是:default_authentication_plugin=caching_sha2_password
解決:
hive/lib 下?lián)Q用新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運(yùn)行時(shí)候一直提示
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文件中不能使用&,要使用他的轉(zhuǎn)義&來代替。
2.mysql 的Java 連接 各個(gè)版本下載?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版本一直時(shí)候,可以替換
3.mac mysql 常用啟安裝和卸載操作
1.安裝
brew install mysql -- 默認(rèn)最新版本
啟動(dòng)mqsql
brew services start mysql 安裝后啟動(dòng)下
brew services stop mysql
2.卸載
brew安裝的mysql默認(rèn)在 usr/local/Celler 目錄下面很方便,建議可以brew 方式安裝軟件
先停止mysql服務(wù)
brew services stop mysql
卸載
brew uninstall mysql
4. 運(yùn)行hadoop 命令 顯示 Invalid HADOOP_COMMON_HOME
WARNING: log4j.properties is not found. HADOOP_CONF_DIR may be incomplete.
ERROR: Invalid HADOOP_COMMON_HOME
解決方案: 這個(gè)問題我在百度找了一晚上沒有什么解決方案,一度懷疑人生,差點(diǎn)吧hadoop的配置文件都看了一遍, 后來在google 上搜到了答案, 如下第六個(gè)問題, 一般打不開貼上問題解決方案. 因?yàn)槲野惭b的hadoop3.0以上的版本, 可能低版本的沒有這個(gè)問題,意思是說hadoop在v3 以上不需要在bash_profile 上配置HADOOP_HOME路徑,我在百度上搜的都是3.0以下的配置, 以后的同學(xué)再安裝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 運(yùn)行報(bào)錯(cuò) mysql ERROR 2002 (HY000): '/tmp/mysql.sock'
說明問題:搜了很多博客,都是修改配置文件,都不好使, 只能卸載重新裝了,主要是刪除 這個(gè)目錄下面的內(nèi)容?
sudo rm -rf /usr/local/var/mysql
解決參考鏈接:?https://cloud.tencent.com/developer/article/1468919
多看看官網(wǎng):?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環(huán)境下打開網(wǎng)絡(luò)連接,即在偏好設(shè)置中-> 共享(share) -> 遠(yuǎn)程連接勾選
7. hive 啟動(dòng)是報(bào) Access denied for user 'root'@'localhost' (using password: YES)?
問題原因:
根據(jù)報(bào)錯(cuò)顯示密碼正確,但是權(quán)限不夠,因此主要目的是解決權(quán)限問題
解決方案:
1.root 方式登錄msyql
2.給hive用戶增加權(quán)限
GRANT INSERT, SELECT, DELETE, UPDATE ON hive.* TO 'hive'@'localhost' IDENTIFIED BY '123456';
flush privileges; 刷新數(shù)據(jù)庫(kù)
參考連接: https://stackoverflow.com/questions/20353402/access-denied-for-user-testlocalhost-using-password-yes-except-root-user
8.ssl 認(rèn)證問題??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.總結(jié)
? ?1.安裝hive 的過程中很容易出現(xiàn)找不到解決問題的情況,因?yàn)榉偶僮约喊惭b沒有人可以請(qǐng)教, 經(jīng)常陷入死胡同, 殺手锏就是 卸載再來一遍. 2.安裝過程中發(fā)現(xiàn)自己對(duì)hive sql還是停留在使用上, 不知道底層原理,對(duì)各種報(bào)錯(cuò),查詢文檔,不知所以然,基本功還是不好,需要把hive的官方文檔好好閱讀.? 3.最重要的遇到問題不要急,學(xué)會(huì)仔細(xì)看報(bào)錯(cuò)日志,留意關(guān)鍵錯(cuò)誤信息.
?
原文鏈接:https://blog.csdn.net/stay_forever/article/details/113142206
相關(guān)推薦
- 2022-04-11 Python如何在終端彩色打印輸出_python
- 2022-04-11 MVVMLight項(xiàng)目之雙向數(shù)據(jù)綁定_Android
- 2023-10-15 el-popover彈窗修改三角樣式或者位置
- 2023-07-22 macos通過homebrew安裝多版本node
- 2022-02-09 利用上下文屬性將?C++?對(duì)象嵌入?QML?里_C 語(yǔ)言
- 2023-01-05 C#不提升自己程序的權(quán)限實(shí)現(xiàn)操作注冊(cè)表_C#教程
- 2023-02-27 python定時(shí)任務(wù)timeloop庫(kù)用法實(shí)例詳解_python
- 2022-04-25 C++的類型轉(zhuǎn)換(強(qiáng)轉(zhuǎn))你了解嗎_C 語(yǔ)言
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支