标签:
采用第二种方式,安装MySQL,启动并创建Hive用户,创建Hive元数据库
insert into mysql.user(Host,User,Password) values("localhost","hive",password("hive"));
create database hive;
grant all on hive.* to hive@‘%‘ identified by ‘hive‘;
grant all on hive.* to hive@‘localhost‘ identified by ‘hive‘;
flush privileges;
?
vim /etc/profile
修改hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL </name>
<value>jdbc:mysql://localhost:3306/hive </value>
</property>
?
<property>
<name>javax.jdo.option.ConnectionDriverName </name>
<value>com.mysql.jdbc.Driver </value>
</property>
?
<property>
<name>javax.jdo.option.ConnectionPassword </name>
<value>hive </value>
</property>
?
<property>
<name>hive.hwi.listen.port </name>
<value>9999 </value>
<description>This is the port the Hive Web Interface will listen on </descript ion>
</property>
?
<property>
<name>datanucleus.autoCreateSchema </name>
<value>true</value>
</property>
?
<property>
<name>datanucleus.fixedDatastore </name>
<value>false</value>
</property>
</property>
?
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
<description>Username to use against metastore database</description>
</property>
?
<property>
<name>hive.exec.local.scratchdir</name>
<value>/home/hdpsrc/hive/iotmp</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/home/hdpsrc/hive/iotmp</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
<property>
<name>hive.querylog.location</name>
<value>/home/hdpsrc/hive/iotmp</value>
<description>Location of Hive run time structured log file</description>
</property>
?
在hive中新建表
?
在MySQL中查看
标签:
原文地址:http://www.cnblogs.com/wocaca/p/5224282.html