hive 2.3.3 檢修java
環境mysql
1 安裝sql
上傳 解壓 apache
2 配置app
vi conf/hive-env.sh
配置其中的$hadoop_homeoop
配置元數據倉庫到mysql
vi hive-site.xmlcode
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://yh01:3306/hive?characterEncoding=utf8&useSSL=false</value> <description>JDBC connect string for a JDBC metastore</description> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> <description>Driver class name for a JDBC metastore</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>12345678</value> <description>password to use against metastore database</description> </property> </configuration>
若是出現沒有權限的問題,在mysql受權(在安裝mysql的機器上執行)
mysql -uroot -p密碼server
#(執行下面的語句 *.*:全部庫下的全部表 %:任何IP地址或主機均可以鏈接) GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; FLUSH PRIVILEGES; 設置設置當前用戶密碼永不過時 update user set password = password('密碼'),password_expired='N' where user = 'root';
/home/hadoop/app/hadoop-2.6.4/share/hadoop/yarn/lib/jline-0.9.94.jarxml
3.初始化hive進程
運行HiveServer2和Beeline
從Hive 2.1開始,咱們須要在下面運行schematool命令做爲初始化步驟。例如,咱們能夠使用「mysql」做爲db類型。
$HIVE_HOME/bin/schematool -dbType mysql -initSchema
4 啓動hive
4945 org.apache.hadoop.util.RunJar /export/servers/hive-2.3.3/lib/hive-metastore-2.3.3.jar org.apache.hadoop.hive.metastore.HiveMetaStore
4809 org.apache.hadoop.util.RunJar /export/servers/hive-2.3.3/lib/hive-service-2.3.3.jar org.apache.hive.service.server.HiveServer2