org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/hive/warehouse/page_view. Name node is in safe mode

FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.ipc.RemoteException org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/hive/warehouse/page_view. Name node is in safe mode.

在安装hive mysql in hadoop 的时候报了错

bin/hadoop dfsadmin -safemode leave

 

开启调机模式:

cp conf/hive-default.xml.template conf/hive-set.xml

vim conf/hive-set.xml 添加
    <property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:mysql://localhost:3306/hive?characterEncoding=UTF-8</value>
    </property>
    <property>
       <name>javax.jdo.option.ConnectionDriverName</name>
       <value>com.mysql.jdbc.Driver</value>
   </property>
   <property>
       <name>javax.jdo.option.ConnectionUserName</name>
       <value>hive</value>
   </property>
   <property>
       <name>javax.jdo.option.ConnectionPassword</name>
       <value>hive</value>
   </property>
进入mysql 创建帐号:
mysql -uroot -p
grant all privileges on *.* to 'hive'@localhost identified by 'hive';
flush privileges;#刷新权限
set name utf8;
create database hive;#创建数据库

 

 

cd ${HIVE_HOME}/bin

./hive -hiveconf hive.root.logger=DEBUG,console #开启调机模式

hive> show tables;
hive>create table page_view(viewTime int,userid bigint,page_url string,referrer_url string,ip string comment 'IP_Address of the User')comment 'This is the page view table';

 

你可能感兴趣的:(exception)