欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Ubuntu 安装hive + mysql

程序员文章站 2023-04-05 23:37:27
先安装mysql 1. 通过tar -zxvf ....hive.tar.gz -C /soft 解压安装hive 3. cp hive-exec-log4j.properties.template hive-exec-log4j.properties 显示日志 ......

先安装mysql 

sudo apt-get update
sudo apt-get install mysql-server 
sudo mysql_secure_installation
具体详情请另查。
注意:mysql 5.7.24 会有安全检测之类,可能需要降低安全机制:
  详见:https://blog.csdn.net/u014236541/article/details/78244601

 

1. 通过tar -zxvf ....hive.tar.gz  -c /soft  解压安装hive

  1.   进入conf/目录:
    1. cp hive-default.xml.template hive-default.xml
      1.   
            <property>
                <name>javax.jdo.option.connectionurl</name>
                <value>jdbc:mysql://hadoop-senior01.itguigu.com:3306/metastore?createdatabaseifnotexist=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>root</value>
                <description>username to use against metastore database</description>
            </property>
        
            <property>
                <name>javax.jdo.option.connectionpassword</name>
                <value>123456</value>
                <description>password to use against metastore database</description>
            </property>
            <!-- 是否在当前客户端中显示查询出来的数据的字段名称 -->
            <property>
                <name>hive.cli.print.header</name>
                <value>true</value>
                <description>whether to print the names of the columns in query output.</description>
            </property>
        
            <!-- 是否在当前客户端中显示当前所在数据库名称 -->
            <property>
                <name>hive.cli.print.current.db</name>
                <value>true</value>
                <description>whether to include the current database in the hive prompt.</description>
            </property>

         

    2. cp hive-env.sh.template hive-env.sh
      1.   
        # set hadoop_home to point to a specific hadoop install directory
        hadoop_home=/soft/hadoop-2.5.0-cdh5.3.6
        
        # hive configuration directory can be controlled by:
        export hive_conf_dir=/soft/hive-0.13.1-cdh5.3.6/conf
        
        # folder containing extra ibraries required for hive compilation/execution can be controlled by:
        # export hive_aux_jars_path=
        ubantu@s101:/soft/hive-0.13.1-cdh5.3.

        3. cp hive-exec-log4j.properties.template hive-exec-log4j.properties  显示日志