1.安装hadoop(1.0以上)
2.安装hive安装(0.9.0以上版本)
4.当然你还得安装jdk
4. mysql,同时准备个可访问的账号,这里采用root,最好配上远程访问权限。
修改hive下的conf文件夹中将 hive-default.xml.template 复制并改名成 hive-site.xml
这里是我的文件
<property>
<name>hive.metastore.local</name>
<value>true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>
jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true
</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>Username</value><!-- In my case UserName is hadoop-->
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>UserPassword</value><!-- In my case password is hadoop-->
</property>
其中标红的都是需要修改的,并改成自己的设置,同时将mysql的jdbc驱动拷贝到hive的lib目录下,然后启动hive看到如下界面
- WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
- Logging initialized using configuration in jar:file:/usr/local/hadoop/hive/lib/hive-common-0.9.0.jar!/hive-log4j.properties
- Hive history file=/tmp/root/hive_job_log_root_201206141444_1788273672.txt
- hive>