欢迎投稿

今日深度:

hive的安装配置,

hive的安装配置,


1 使用yum安装mysql     yum install mysql-server -y 开启mysql mysql -uroot -p
没有启动mysql服务     service 启动:service mysqld start
      、使用 mysqld 脚本启动:/etc/inint.d/mysqld start
     3、使用 safe_mysqld 启动:safe_mysqld&

.配置HIVE元数据库,以及创建用户名,分配网络访问权限。
 
mysql -u root create database if not exists hive; grant all privileges on hive.* to 'hive'@'%' identified by 'hive'; grant all privileges on hive.* to 'hive'@'localhost' identified by 'hive'; grant all privileges on hive.* to 'hive'@'master' identified by 'hive'; grant all privileges on hive.* to 'hive'@'localhost' identified by 'hive'; flush privileges;
mysql -uhive -p
  show databases;
  use hive;
  create table test (name int);
  show tables;
  drop table test;


2 ,安装hive [root@chen01 tool]# tar -zxvf hive-0.12.0.tar.gz  [root@chen01 tool]#mv -zxvf hive-0.12.0.tar.gz ../sortwares 配置环境变量: [root@chen01 hive-0.12.0]# cd  [root@chen01 ~]# vim .bash_profile  在./bash_profile文件末尾加入hive的环境变量 export HIVE_HOME=/usr/bigdata/sortwares/hive-0.12.0 (自己的hive路径) export PATH=$PATH:$HIVE_HOME/bin

[root@chen01 conf]# cp hive-default.xml.template hive-site.xml [root@chen01 conf]# vi hive-site.xml  <property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true<alue>
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver<alue>
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>root<alue>
  <description>username to use against metastore database</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>123<alue>
  <description>password to use against metastore database</description>
</property>

[root@chen01 conf]# vi hive-env.sh.template 
 HADOOP_HOME=/usr/bigdata/sortwares/hadoop-2.6.2 export HIVE_CONF_DIR=/usr/bigdata/sortwares/hive-0.12.0   安装完毕, [root@chen01 conf]# hive hive> 
-------------------------------时间分割线 这是很久写的安装笔记,当时安装好就没有用过,昨天重装一次,发现安装好了hive却不能创建表,报了如下错误 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
才发现元数据信息没有初始化,是在抱歉,可能让按照本文安装hive的没能成功,但我相信你们肯定都能度娘解决. 初始化元数据信息 schematool -initSchema -dbType mysql 到hive/bin目录下执行该语句即可

www.htsjk.Com true http://www.htsjk.com/hive/41032.html NewsArticle hive的安装配置, 1 使用yum安装mysql      yum install mysql-server -y 开启mysql mysql -uroot -p 没有启动mysql服务     service 启动:service mysqld start       、使用 mysqld 脚本启动:/etc/inint.d/mys...
相关文章
    暂无相关文章
评论暂时关闭