hive初次使用报错
2016-07-12 17:02
267 查看
hive(元数据存储在mysql) 启动
Exception in thread "main" java.lang.RuntimeException: Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying
database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql)
看解释是hive元数据库没有初始化的原因,
第一次需要执行初始化命令:
这时候你再查看mysql中 hive 数据库的表,会有一大堆表生成,如图
执行完成之后,可以重启一下mysql服务,service mysqld restart
之后又报错,
Exception in thread "main" java.lang.IllegalArgumentExc
4000
eption: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir}/${system:user.name}
at org.apache.hadoop.fs.Path.initialize(Path.java:206)
at org.apache.hadoop.fs.Path.(Path.java:172)
at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:606)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:526)
at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:494)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:709)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:645)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir}
这个错误的原因是 ${system:java.io.tmpdir} 设置的路径不存在还是怎么回事,那么在hive-site.xml中去查找${system:java.io.tmpdir} ,将该路径替换成你本地的缓存目录,这个目录你可以自己建,可以在hive目录下建立一个tmp目录,替换成这个路径。
执行bin/hive
成功。
metastore一共有三种模式,http://www.micmiu.com/bigdata/hive/hive-metastore-config/
Exception in thread "main" java.lang.RuntimeException: Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying
database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql)
看解释是hive元数据库没有初始化的原因,
第一次需要执行初始化命令:
schematool -dbType mysql -initSchema
查看初始化后信息 schematool
-dbType mysql -info
这时候你再查看mysql中 hive 数据库的表,会有一大堆表生成,如图
执行完成之后,可以重启一下mysql服务,service mysqld restart
之后又报错,
Exception in thread "main" java.lang.IllegalArgumentExc
4000
eption: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir}/${system:user.name}
at org.apache.hadoop.fs.Path.initialize(Path.java:206)
at org.apache.hadoop.fs.Path.(Path.java:172)
at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:606)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:526)
at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:494)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:709)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:645)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir}
这个错误的原因是 ${system:java.io.tmpdir} 设置的路径不存在还是怎么回事,那么在hive-site.xml中去查找${system:java.io.tmpdir} ,将该路径替换成你本地的缓存目录,这个目录你可以自己建,可以在hive目录下建立一个tmp目录,替换成这个路径。
执行bin/hive
成功。
metastore一共有三种模式,http://www.micmiu.com/bigdata/hive/hive-metastore-config/
相关文章推荐
- TableAdapter配置向导中设置SQL语句的参数
- 姓名测试
- 通用权限管理设计篇(一)
- HDU 2660 Accepted Necklace
- 银行自助填表方案介绍
- 纸张的规格:A3.A4.A5.A6纸的尺寸大小
- hive教程
- 服务器被人控制
- AS中so文件和assets文件的引用
- spring aop pointcut expression 例子说明
- JPA事务控制设置
- Build a RESTful API Using Node and Express 4
- Error while commiting the transaction
- Android图片三级缓存
- 身份证卡专用复印机
- 字段表达式校验器(fieldexpression)
- 10款高质量的jQuery表单验证插件
- JS判断flash加载完成
- JPA一对多实现插入的问题
- 短信猫程序开发