2:安装和配置hadoop9(MySQL server + hive metastore service) A:安装配置MySQL MySQL的安装参见本人博客mysql5.6.12 for Linux安装 [root@hadoop9 hadoop]# mysql -uroot -p mysql> grant all on *.* to mysql@'%' identified by 'mysql' with grant option; mysql> create user 'hadoop' identified by 'hadoop'; mysql> grant all on *.* to hadoop@'%' with grant option; mysql> quit; [root@hadoop9 hadoop]# mysql -uhadoop -p mysql> create database hive; mysql> quit;
B:安装hive 0.11.0 [root@hadoop9 soft]# tar zxf hive-0.11.0.tar.gz [root@hadoop9 soft]# cp -r hive-0.11.0 /app/hadoop/hive011 [root@hadoop9 soft]# cd /app/hadoop [root@hadoop9 hadoop]# chown -R hadoop:hadoop hive011 C:配置环境变量 [root@hadoop9 hadoop]# vi /etc/profile export HIVE_HOME=/app/hadoop/hive011 export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:${HIVE_HOME}/bin:$PATH [root@hadoop9 hadoop]# source /etc/profile D:hive配置 [root@hadoop9 hadoop]# cd hive/conf [hadoop@hadoop9 conf]$ cp hive-default.xml.template hive-site.xml [hadoop@hadoop9 conf]$ cp hive-env.sh.template hive-env.sh [hadoop@hadoop9 conf]$ vi hive-env.xml HADOOP_HOME=/app/hadoop/hadoop220 [hadoop@hadoop9 conf]$ vi hive-site.xml <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://hadoop9:3306/hive?=createDatabaseIfNotExist=true</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>hadoop</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>hadoop</value> <description>password to use against metastore database</description> </property>
C:配置hive-site.xml [hadoop@hadoop2 conf]$ vi hive-site.xml <property> <name>hive.metastore.uris</name> <value>thrift://hadoop9:9083</value> <description>Thrift uri for the remote metastore. Used by metastore client to connect to remote metastore.</description> </property>