hive的嵌入模式报错

配置conf/hive-site.xml

原来的内容:

 


            
                         
                    
                    javax.jdo.option.ConnectionURL
                    jdbc:derby:;databaseName=metastore_db;create=true
                    
    

                    
                    javax.jdo.option.ConnectionDriverName
                    org.apache.derby.jdbc.EmbeddedDriver
                    
    

                    
                    hive.metastore.local
                    true
                    
    

                    
                    hive.metastore.warehouse.dir
                    file:///root/training/apache-hive-2.3.0-bin/warehouse
                    
        
                

 

[Fatal Error] hive-site.xml:2:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Exception in thread "main" java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/root/training/apache-hive-2.3.0-bin/conf/hive-site.xml; lineNumber: 2; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed.
        at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2348)
        at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2205)
        at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2112)
        at org.apache.hadoop.conf.Configuration.get(Configuration.java:1078)
        at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:3901)
        at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:3970)
        at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:4057)
        at org.apache.hadoop.hive.conf.HiveConf.(HiveConf.java:4005)
        at org.apache.hive.beeline.HiveSchemaTool.(HiveSchemaTool.java:82)
        at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1117)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Caused by: org.xml.sax.SAXParseException; systemId: file:/root/training/apache-hive-2.3.0-bin/conf/hive-site.xml; lineNumber: 2; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:150)
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2183)
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2171)
        at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2239)
        ... 14 more
 

 

 

 

解决办法:修改conf/hive-site.xml为(即去掉头2行):

             
                    
                    javax.jdo.option.ConnectionURL
                    jdbc:derby:;databaseName=metastore_db;create=true
                    
    

                    
                    javax.jdo.option.ConnectionDriverName
                    org.apache.derby.jdbc.EmbeddedDriver
                    
    

                    
                    hive.metastore.local
                    true
                    
    

                    
                    hive.metastore.warehouse.dir
                    file:///root/training/apache-hive-2.3.0-bin/warehouse
                    
        
                
 

你可能感兴趣的:(hive)