CM安装集群时,添加hive服务使用

添加HIve 的过程中,会要求配置 mysql, username, dbname 等连接信息。(取代了以往的在hive-site.xml 文件修改);

添加成功,可以认为Hive已经与mysql配置好了;

验证

运行mysql;

mysql> show databases;

会有曾经 装好mysql 时,创建的那些数据库 hue,hive等,我这里hive设置的数据库名称为metastore;

所以输入 use metastore

database changed

再输入 show tables

会输出 很多默认的表。。。。。

运行Hive-》执行一个创建语句

create table page_view(view_time String,country String,userid String,page_url String,refer_url String,ip String)row format delimited  fields terminated by ',' lines terminated by '\n';

此时可能出现错误

MetaException(message:Required table missing : “DBS” in Catalog “” Schema “”. DataNucleus requires this table to perform its persistence operations

 Either your MetaData is incorrect, or you need to enable “datanucleus.schema.autoCreateTables”)


解决方法: vim /etc/hive/conf/hive-site.xml

添加下面的属性。重新启动hive服务。

<property>
    <name>datanucleus.schema.autoCreateAll</name>
    <value>true</value>
 </property>

show tables;

x显示表明就对了

load data local inpath '你的linux中的数据文件地址‘’ into table page_view;

 

再 select * from page_view;

ok

ok

ok

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值