打赏

Hive的单节点集群详细启动步骤

 

  说在前面的话,

在这里,推荐大家,一定要先去看这篇博客,如下

     再谈hive-1.0.0与hive-1.2.1到JDBC编程忽略细节问题

     Hadoop Hive概念学习系列之hive三种方式区别和搭建、HiveServer2环境搭建、HWI环境搭建和beeline环境搭建(五)

 

 

 

 

 

 

  版本1

 

先启动hadoop集群,至少是hdfs

 

也可以设置成开机启动,chkconfig mysqld on 


[hadoop@weekend110 app]$ su root
Password:
[root@weekend110 app]# service mysqld start  (因为,我的mysql是安装在/home/hadoop/app下)
Starting mysqld: [ OK ]
[root@weekend110 app]# su hadoop
[hadoop@weekend110 app]$ cd hive-0.12.0/
[hadoop@weekend110 hive-0.12.0]$ bin/hive
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative

Logging initialized using configuration in jar:file:/home/hadoop/app/hive-0.12.0/lib/hive-common-0.12.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/app/hadoop-2.4.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/app/hive-0.12.0/lib/slf4j-log4j12-1.6.1.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]
hive>

 

 

 

 

 

 

 

  版本2 

 

先启动hadoop集群,至少是hdfs

[hadoop@djt002 hadoop-2.6.0]$ jps
2870 NodeManager
2612 SecondaryNameNode
2767 ResourceManager
3189 Jps
2430 DataNode
2334 NameNode
[hadoop@djt002 hadoop-2.6.0]$


  也可以设置成开机启动,chkconfig mysqld on 


[hadoop@djt002 local]$ pwd
/usr/local
[hadoop@djt002 local]$ su root
Password:
[root@djt002 local]# service mysqld start      (因为,我的mysql是安装在/usr/local下)
Starting mysqld: [ OK ]
[root@djt002 local]# su hadoop
[hadoop@djt002 local]$ pwd
/usr/local
[hadoop@djt002 local]$ cd hive/hive-1.0.0/
[hadoop@djt002 hive-1.0.0]$ pwd
/usr/local/hive/hive-1.0.0
[hadoop@djt002 hive-1.0.0]$ bin/hive

Logging initialized using configuration in jar:file:/usr/local/hive/hive-1.0.0/lib/hive-common-1.0.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hive/hive-1.0.0/lib/hive-jdbc-1.0.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]
hive> exit;
hive>

 

 

 

 

 

 

 

  版本3

 

  比如,我这里是由HadoopMaster、HadoopSlave1、HadoopSlave2组成的3节点集群。但是,我只在HadoopSlave1节点上安装大家Hive。

  这里,版本同样是hadoop-2.6.0.tar.gz,但是是与hive-1.2.1搭配。具体怎么如何做到,见如下博客

再谈hive-1.0.0与hive-1.2.1到JDBC编程忽略细节问题

hive常见问题解决干货大全

hive权威安装出现的不解错误!(完美解决)两种方法都可以

  

 

 

 


 

  ,在HadoopSlave1节点
[hadoop@HadoopSlave1 hive-1.2.1]$ su root
Password:
[root@HadoopSlave1 hive-1.2.1]# cd /home/hadoop/app/
[root@HadoopSlave1 app]# service mysqld start        (因为,我的mysql是安装在/home/hadoop/app下)
Starting mysqld: [ OK ]


  ,在HadoopMaster节点
[root@HadoopMaster app]# su hadoop
[hadoop@HadoopMaster app]$ cd $HADOOP_HOME
[hadoop@HadoopMaster hadoop-2.6.0]$ sbin/start-all.sh
[hadoop@HadoopMaster hadoop-2.6.0]$ jps
3612 NameNode
4374 Jps
3952 ResourceManager
3805 SecondaryNameNode


[hadoop@HadoopSlave1 hadoop-2.6.0]$ jps
3004 Jps
2269 DataNode
2378 NodeManager

 

[hadoop@HadoopSlave2 hadoop-2.6.0]$ jps
2255 DataNode
2998 Jps
2365 NodeManager

 


[hadoop@HadoopSlave1 hadoop-2.6.0]$ cd $HIVE_HOME
[hadoop@HadoopSlave1 hive-1.2.1]$ bin/hive
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
16/11/02 11:42:54 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative

Logging initialized using configuration in jar:file:/home/hadoop/app/hive-0.12.0/lib/hive-common-0.12.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/app/hadoop-2.4.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/app/hive-0.12.0/lib/slf4j-log4j12-1.6.1.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]
hive>

 


  另外,再开一个HadoopSlave1远程界面

[hadoop@HadoopSlave1 hive-1.2.1]$ bin/hive --service hiveserver2 &

 

posted @ 2017-03-15 13:12  大数据和AI躺过的坑  阅读(1171)  评论(0编辑  收藏  举报