Heim > php教程 > PHP开发 > Hauptteil

Bienenstockinstallation

高洛峰
Freigeben: 2016-12-02 16:09:32
Original
1194 Leute haben es durchsucht

Ich möchte hier betonen:

Hadoop, Zookpeer, Spark und Kafka wurden normal gestartet

Installation und Bereitstellung von Hive beginnen

Grundlegende Abhängigkeitsumgebung:

1,jdk   1.6+
2, hadoop 2.x
3,hive 0.13-0.19
4,mysql   (mysql-connector-jar)
Nach dem Login kopieren

Die Installationsdetails sind wie folgt:

#java 
export JAVA_HOME=/soft/jdk1.7.0_79/
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
#bin
export PATH=$PATH:/$JAVA_HOME/bin:$HADOOP_HOME/bin:$SCALA_HOME/bin:$SPARK_HOME/bin:/usr/local/hadoop/hive/bin
#hadoop
export HADOOP_HOME=/usr/local/hadoop/hadoop
#scala
export SCALA_HOME=/usr/local/hadoop/scala
#spark
export SPARK_HOME=/usr/local/hadoop/spark
#hive
export HIVE_HOME=/usr/local/hadoop/hive
Nach dem Login kopieren

                                             >

https://hive.apache.org/downloads.html
Nach dem Login kopieren
Entpacken:

tar  xvf   apache-hive-2.1.0-bin.tar.gz  -C  /usr/local/hadoop/
cd  /usr/local/hadoop/
mv   apache-hive-2.1.0   hive
Nach dem Login kopieren
2, ändern Sie die Konfiguration

修改启动环境
cd   /usr/local/hadoop/hive
vim bin/hive-config.sh
#java 
export JAVA_HOME=/soft/jdk1.7.0_79/
#hadoop
export HADOOP_HOME=/usr/local/hadoop/hadoop
#hive
export HIVE_HOME=/usr/local/hadoop/hive
Nach dem Login kopieren
Ändern Sie die Standardkonfigurationsdatei

cd   /usr/local/hadoop/hive
vim conf/hive-site.xml
<configuration>
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:mysql://master:3306/hive?createDatabaseInfoNotExist=true</value> 
            <description>JDBC connect string for a JDBC metastore</description>
      </property>
     <property>
            <name>javax.jdo.option.ConnectionDriverName</name>
            <value>com.mysql.jdbc.Driver</value>
            <description>Driver class name for a JDBC metastore</description>
      </property>
    <property>
            <name>javax.jdo.option.ConnectionUserName</name>
            <value>hive</value>
            <description>Username to use against metastore database</description>
      </property>
    <property>
            <name>javax.jdo.option.ConnectionPassword</name>
            <value>xujun</value>
            <description>password to use against metastore database</description>
      </property>
</configuration>
Nach dem Login kopieren
3, ändern Sie das TMP-Verzeichnis

Änderung Ändern Sie den Wert des darin enthaltenen Konfigurationselements „system:java.io.tmpdir“ an die obige Adresse

/tmp/hive

2. MySQL installiert und gestartet

1. Datenbank erstellen

create database hive 
grant all on *.* to  hive@&#39;%&#39;  identified by &#39;hive&#39;;
flush  privileges;
Nach dem Login kopieren
3. Hive initialisieren

cd   /usr/local/hadoop/hive
bin/schematool -initSchema -dbType mysql 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL: jdbc:mysql://hadoop3:3306/hive?createDatabaseInfoNotExist=true
Metastore Connection Driver : com.mysql.jdbc.Driver
Metastore connection User: hive
Starting metastore schema initialization to 2.1.0
Initialization script hive-schema-2.1.0.mysql.sql
Initialization script completed
schemaTool completed
Nach dem Login kopieren
4. Start

[hadoop@hadoop1 hadoop]$ hive/bin/hive
which: no hbase in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin://soft/jdk1.7.0_79//bin:/bin:/bin:/bin:/usr/local/hadoop/hive/bin:/home/hadoop/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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.apache.logging.slf4j.Log4jLoggerFactory]
Logging initialized using configuration in jar:file:/usr/local/hadoop/hive/lib/hive-common-2.1.0.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. tez, spark) or using Hive 1.X releases.
hive> show databases;
OK
default
Time taken: 1.184 seconds, Fetched: 1 row(s)
hive>
Nach dem Login kopieren


Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Empfehlungen
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!