2015-02-16 17 views
5

Tôi đã cài đặt ubuntu 14 và hadoop 2.6.0 và Hive 0.14.0 trong trình phát VM của mình. Trong Hive/conf của tôi không có tệp Hive-site.xml, vì vậy tôi đã tạo một tệp mới. Nhưng tôi gặp lỗi khi mở vỏ Hive. Nếu tôi xóa tệp hive-site.xml, tôi có thể mở trình bao. Tại sao điều này? tôi nên làm gì? Lỗi Hive như sau:hive shell không mở khi tôi có hive-site.xml

> [email protected]:/usr/lib/hive/apache-hive-0.14.0-bin/bin$ hive 
15/02/15 22:51:00 WARN conf.HiveConf: DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore. 
15/02/15 22:51:00 WARN conf.HiveConf: HiveConf of name hive.metastore.local does not exist 

Logging initialized using configuration in jar:file:/usr/lib/hive/apache-hive-0.14.0-bin/lib/hive-common-0.14.0.jar!/hive-log4j.properties 
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/usr/lib/hive/apache-hive-0.14.0-bin/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D 
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:444) 
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:672) 
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616) 
    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.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D 
    at org.apache.hadoop.fs.Path.initialize(Path.java:206) 
    at org.apache.hadoop.fs.Path.<init>(Path.java:172) 
    at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:487) 
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:430) 
    ... 8 more 
Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D 
    at java.net.URI.checkPath(URI.java:1804) 
    at java.net.URI.<init>(URI.java:752) 
    at org.apache.hadoop.fs.Path.initialize(Path.java:203) 

Mọi trợ giúp sẽ tuyệt vời!

+0

cảnh báo cho bạn biết rằng 'hive.metastore.local' Điều quan trọng là không được sử dụng. Hãy thử loại bỏ conf này khỏi tệp hive-site.xml của bạn – amow

+0

Có cần thiết phải có tệp hive-site.xml không? Mục đích của nó là gì? – DrewRose

Trả lời

2

nếu bạn sử dụng Hive-1.0.0 sau đó tạo thư mục mới có tên với log trong HIVE_HOME sau đó đi đến hive-site.xml tìm $ {hệ thống: java.io.tmpdir} và thay thế bằng đường dẫn thư mục log ví dụ ./Home/hduser/hive/log/........

9

bạn cần phải thêm cấu hình sau vào hive-site.xml

<property> 
    <name>hive.querylog.location</name> 
    <value>$HIVE_HOME/iotmp</value> 
    <description>Location of Hive run time structured log file</description> 
    </property> 

    <property> 
    <name>hive.exec.local.scratchdir</name> 
    <value>$HIVE_HOME/iotmp</value> 
    <description>Local scratch space for Hive jobs</description> 
    </property> 

    <property> 
    <name>hive.downloaded.resources.dir</name> 
    <value>$HIVE_HOME/iotmp</value> 
    <description>Temporary local directory for added resources in the remote file system.</description> 
    </property> 

nhớ để thay thế $ HIVE_HOME với mục hive của bạn

1

Để ALL Sau khi cài đặt mới nhất 2.xy Hadoop và Hive 1.xy:

Nếu Bạn có Hive Bắt đầu vấn đề:

Edit:

$ HIVE_HOME/conf/hive-site.xml

<property> 
    <name>hive.exec.local.scratchdir</name> 
    <value>$HIVE_HOME/iotmp</value> 
    <description>Local scratch space for Hive jobs</description> 
</property> 



<property> 
    <name>hive.querylog.location</name> 
    <value>$HIVE_HOME/iotmp</value> 
    <description>Location of Hive run time structured log file</description> 
</property> 



<property> 
    <name>hive.downloaded.resources.dir</name> 
    <value>$HIVE_HOME/iotmp</value> 
    <description>Temporary local directory for added resources in the remote file system.</description> 
</property> 
0

Đường dẫn tương đối URISyntaxException ngoại lệ là trước khi của bạn phải được xác định đường dẫn tương đối. Tôi cũng phải đối mặt với vấn đề tương tự khi cố gắng khởi động HMaster, lỗi là vì tôi đang sử dụng đường dẫn tương đối tới hdfs cho thuộc tính hbase.rootdir trong hbase-site.xml khi sửa đường dẫn thư mục gốc có thể khởi động Hmaster bình thường

con đường gây ngoại lệ: HDFS: // localhost: 8020

đúng đường dẫn: HDFS: // localhost: 8020/HBase

2

Trước tiên, bạn cần phải sao chép configs từ hive-default.xml.template đến tạo hive-site.xml

Như đã đề cập đến n Hive Admin Configuration manual thiết lập các configs sau

<property> 
    <name>hive.querylog.location</name> 
    <value>/tmp/hive</value> 
    <description>Location of Hive run time structured log file</description> 
</property> 

<property> 
    <name>hive.exec.local.scratchdir</name> 
    <value>/tmp/hive</value> 
    <description>Local scratch space for Hive jobs</description> 
</property> 

<property> 
    <name>hive.downloaded.resources.dir</name> 
    <value>/tmp/hive</value> 
    <description>Temporary local directory for added resources in the remote file system.</description> 
</property> 

Nó làm việc cho tôi để bắt đầu tổ ong cũng như beeline.

3

Đặt sau vào đầu hive-site.xml

<configuration> 
    <property> 
    <name>system:java.io.tmpdir</name> 
    <value>/tmp/hive/java</value> 
    </property> 
    <property> 
    <name>system:user.name</name> 
    <value>${user.name}</value> 
    </property> 

Xem this câu hỏi cũng

0

chỉ để thêm các thiết lập sau đây để hive tại chỗ.xml

[[email protected] conf]$ vi hive-site.xml 
< property> 
    < name>hive.querylog.location< /name> 
    < value>/home/hadoop/app/hive/iotmp< /value> 
    < description>Location of Hive run time structured log file< /description> 
< /property> 

< property> 
    < name>hive.exec.local.scratchdir< /name> 
    < value>/home/hadoop/app/hive/iotmp< /value> 
    < description>Local scratch space for Hive jobs< /description> 
< /property> 

< property> 
    < name>hive.downloaded.resources.dir< /name> 
    < value>/home/hadoop/app/hive/iotmp< /value> 
    < description>Temporary local directory for added resources in the remote file system.< /description> 
< /property> 

tiết kiệm & restart hive

[[email protected] hive]$ hive 
    hive> show databases; 
    OK 
    default 
    Time taken: 3.684 seconds, Fetched: 1 row(s) 
    hive> 
Các vấn đề liên quan