zoukankan      html  css  js  c++  java
  • [Hive]编译部署-hive-1.1.0-cdh5.7.0

    2.部署

      

      解压 # tar -xzvf ~/software/hive-1.1.0-cdh5.7.0.tar.gz -C  ~/app/

      配置环境变量

          export HIVE_HOME=/home/hadoop/app/hive-1.1.0-cdh5.7.0

          export PATH=$HIVE_HOME/bin:$PATH

          下载mysql驱动包

      用MVN下,新建一个Pom.xml

    <?xml version="1.0" encoding="UTF-8"?>

    <project xmlns="http://maven.apache.org/POM/4.0.0"

             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

        <modelVersion>4.0.0</modelVersion>

        <groupId>Spider</groupId>

        <artifactId>Spider</artifactId>

        <version>1.0</version>

        <dependencies>

            <dependency>

                <!-- jsoup HTML parser library @ http://jsoup.org/ -->

                <groupId>mysql</groupId>

                <artifactId>mysql-connector-java</artifactId>

                <version>5.1.17</version>

            </dependency>

        </dependencies>

        <build>

            <plugins>

                <plugin>

                    <artifactId>maven-dependency-plugin</artifactId>

                    <configuration>

                        <excludeTransitive>false</excludeTransitive> 

                        <stripVersion>true</stripVersion>

                        <outputDirectory>./lib</outputDirectory>

                    </configuration>

                     

                </plugin>

            </plugins>

        </build>

    </project>

      执行后,Jar包即在./lib文件夹 # mvn dependency:copy-dependencies

      拷贝驱动包到Hive # cp ~/software/test/lib/mysql-connector-java.jar ~/app/hive-1.1.0-cdh5.7.0/lib/

      修改配置

        #cp ~/app/hive-1.1.0-cdh5.7.0/conf/hive-env.sh.template ~/app/hive-1.1.0-cdh5.7.0/conf/hive-env.sh

        #vi ~/app/hive-1.1.0-cdh5.7.0/conf/hive-env.sh

        编辑如下

          HADOOP_HOME=/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/bin/hadoop

        #vi ~/app/hive-1.1.0-cdh5.7.0/conf/hive-site.xml

        编辑如下:

    <configuration>

      <property>

        <name>javax.jdo.option.ConnectionURL</name>

        <value>jdbc:mysql://hadoop000:3306/hive_basic?createDatabaseIfNotExist=true</value>

      </property>

      <property>

        <name>javax.jdo.option.ConnectionDriverName</name>

        <value>com.mysql.jdbc.Driver</value>

      </property>

      <property>

        <name>javax.jdo.option.ConnectionUserName</name>

        <value>root</value>

      </property>

      <property>

        <name>javax.jdo.option.ConnectionPassword</name>

        <value>12abAB</value>

      </property>

    </configuration>

          

        日志输出修改

        #cp ~/app/hive-1.1.0-cdh5.7.0/conf/hive-log4j.properties.template ~/app/hive-1.1.0-cdh5.7.0/conf/hive-log4j.properties

        #vi ~/app/hive-1.1.0-cdh5.7.0/conf/hive-log4j.properties

        修改如下:

          hive.log.dir=/home/hadoop/app/hive-1.1.0-cdh5.7.0/logs

      启动Hive (必须是Hadoop启动的前提下)

      #hive

        

    mvn dependency:copy-dependencies

  • 相关阅读:
    使用Windbg调试.Net应用程序 [转]
    jquery的$.extend和$.fn.extend作用及区别
    java获取ip
    在IDEA中使用MyBatis Generator逆向工程生成代码
    github结合TortoiseGit使用sshkey,无需输入账号和密码
    Mapped Statements collection does not contain value for com.xxxx.dao.impl.AreaDAOImpl.findByCode
    idea设置tomcat虚拟路径的两种方法
    spring MVC中传递的参数对象中包含list的情况
    PowerDsigner 16逆向工程导入mysql
    [C++]Qt文本操作(按行读写)
  • 原文地址:https://www.cnblogs.com/NightPxy/p/9131692.html
Copyright © 2011-2022 走看看