Sqoop | 安装

作者: icebreakeros | 来源:发表于2019-07-04 08:01 被阅读0次

    sqoop安装

    主机名 IP 服务
    ubuntu02 192.168.0.152 zookeeper、namenode、resourcemanager、jobhistoryserver、hregionserver
    ubuntu03 192.168.0.153 zookeeper、datanode、nodemanager、hregionserver
    ubuntu04 192.168.0.154 zookeeper、datanode、nodemanager、hregionserver
    ubuntu05 192.168.0.155 secondarynamenode、datanode、nodemanager、hmaster、sqoop

    sqoop1安装

    wget -c \
    http://www-eu.apache.org/dist/sqoop/1.4.7/sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz
    tar -zxvf sqoop-1.4.7.tar.gz && mv sqoop-1.4.7/ /usr/local/
    cd /usr/local && ln -s sqoop-1.4.7/ sqoop
    
    cat >> /etc/profile << EOF
    
    # for sqoop
    export SQOOP_HOME=/usr/local/sqoop
    export PATH=\$SQOOP_HOME/bin:\$PATH
    EOF
    
    source /etc/profile
    cp conf/sqoop-env-template.sh conf/sqoop-env.sh
    
    vim conf/sqoop-env.sh
    export HADOOP_COMMON_HOME=/usr/local/hadoop
    export HADOOP_MAPRED_HOME=/usr/local/hadoop/share/hadoop/mapreduce
    export HBASE_HOME=/usr/local/hbase
    export HIVE_HOME=/usr/local/hive
    
    cp /opt/mysql-connector-java-8.0.12.jar lib/
    sqoop-list-databases \
        --connect "jdbc:mysql://192.168.219.51:3306/sqoop?useSSL=false&serverTimezone=UTC" \
        --username "sqoop" \
        --password "******"
    
    sqoop-list-tables \
        --connect "jdbc:mysql://192.168.219.51:3306/sqoop?useSSL=false&serverTimezone=UTC" \
        --username "sqoop" \
        --password "******"
    

    sqoop2安装

    wget -c https://www-us.apache.org/dist/sqoop/1.99.7/sqoop-1.99.7-bin-hadoop200.tar.gz
    tar -zxvf sqoop-1.99.7-bin-hadoop200.tar.gz
    mv sqoop-1.99.7-bin-hadoop200 /usr/local/
    cd /usr/local && ln -s sqoop-1.99.7-bin-hadoop200/ sqoop
    
    cat >> /etc/profile << EOF
    
    # for sqoop
    export SQOOP_HOME=/usr/local/sqoop
    export PATH=\$SQOOP_HOME/bin:\$PATH
    EOF
    
    cat conf/sqoop.properties | grep "org.apache.sqoop.submission.engine.mapreduce.configuration.directory"
    sed \
    -i "s|
    org.apache.sqoop.submission.engine.mapreduce.configuration.directory=.*|
    org.apache.sqoop.submission.engine.mapreduce.configuration.directory\
      =/usr/local/hadoop/etc/hadoop|
    g" \
    conf/sqoop.properties
    
    cat conf/sqoop.properties | grep "@LOGDIR@"
    sed -i "s|@LOGDIR@|/logs/sqoop|g" conf/sqoop.properties
    
    cat conf/sqoop.properties | grep "@BASEDIR@"
    sed -i "s|@BASEDIR@|/usr/local/sqoop|g" conf/sqoop.properties
    
    sqoop2-tool upgrade
    sqoop2-tool verify
    
    sqoop2-server start
    sqoop2-server stop
    
    http://192.168.0.155:12000/sqoop/v1/connector/all
    sqoop2-shell
    

    相关文章

      网友评论

        本文标题:Sqoop | 安装

        本文链接:https://www.haomeiwen.com/subject/usuncctx.html