• ansible快速部署CDH-5.6.1


    使用ansible快速部署cdh-5.6.1

    本部署步骤的前提是已安装配置完成ansible,达到快速部署的目的。

    1.关闭selinux

    ansible mysql -m shell -a "sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config"
    

    2.关闭防火墙

    ansible mysql -m shell -a 'chkconfig iptables off'
    ansible mysql -m shell -a 'service iptables stop'
    

    3.修改hosts

    ansible shyd -m shell -a "mv /etc/hosts /etc/hosts.bak1"
    ansible shyd -m shell -a 'wget -P /etc/ http://192.168.5.100/1/hosts'
    

    4.配置ntp服务

    ansible shyd -m shell -a "mv /etc/ntp.conf /etc/ntp.conf.bak"
    ansible shyd -m shell -a 'wget -P /etc/ http://192.168.5.100/1/ntp.conf'
    ansible shyd -m shell -a "ntpdate 192.168.5.31"
    ansible shyd -m shell -a "service ntpd restart"
    ansible shyd -m shell -a "chkconfig ntpd on"
    

    5.优化服务器参数

    --优化所有服务器打开文件数:
    ansible shyd -m shell -a "echo '* soft nofile 65534' >> /etc/security/limits.conf"
    ansible shyd -m shell -a "echo '* hard nofile 65534' >> /etc/security/limits.conf"
    --优化cloudera服务器vm.swappiness参数
    ansible cloudera -m shell -a "echo 'vm.swappiness = 10' >> /etc/sysctl.conf"
    

    6.配置主机互信

    ansible cloudera -m shell -a "cat /root/.ssh/id_rsa.pub"
    ansible cloudera -m shell -a 'wget -P /root/ http://192.168.5.100/1/authorized_keys'
    ansible cloudera -m shell -a "mv /root/"
    

    7.配置jdk

    ansible shyd -m copy -a "src=/root/jdk/ dest=/root/ owner=root group=root mode=0600"
    ansible cloudera -m shell -a 'bash +x /root/jdk/install.sh"
    

    8.配置CM节点

    #clouder-manager解压文件至/opt下
    tar zxvf cloudera-manager-el6-cm5.6.1_x86_64.tar.gz -C /opt
    #创建CDH本地源
    mkdir -p /opt/cloudera/parcel-repo
    mv CDH-5.6.1-1.cdh5.6.1.p0.3-el6.parcel* manifest.json /opt/cloudera/parcel-repo/
    #拷贝mysql连接包
    cp mysql-connector-java-5.1.39-bin.jar /opt/cm-5.6.1/share/cmf/lib/mysql-connector-java.jar
    #添加用户:
    useradd --system --home=/opt/cm-5.6.1/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
    #安装mysql
    yum -y install mysql-server mysql
    #启动mysql
    service mysqld start
    #开机启动mysql
    chkconfig mysqld on
    #使用mysql登陆: 执行:
    update user set password=PASSWORD("root") where user='root';
    grant all privileges on *.* to root@"%" identified by "root" ;
    CREATE DATABASE hive DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    FLUSH PRIVILEGES;
    #初始化数据:
    /opt/cm-5.6.1/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -proot --scm-host localhost scm scm scm
    #编辑修改cloudera-manager安装配置文件:
    vi /opt/cm-5.6.1/etc/cloudera-scm-agent/config.ini
    #修改如下
    server_host=FX-I12-CU100
    #拷贝文件至其它五个节点
    #拷贝mysql-jdbc包
    cp mysql-connector-java-5.1.39-bin.jar /usr/share/java/
    #安装oozie报错: 则执行
    cp /root/cloudera5.6.1/mysql-connector-java-5.1.39-bin.jar /var/lib/oozie/
    #创建文件夹:
    mkdir -p /var/lib/cloudera-scm-server
    chown cloudera-scm:cloudera-scm /var/lib/cloudera-scm-server
    #启动cloudera-scm-server
    /opt/cm-5.6.1/etc/init.d/cloudera-scm-server start
    

    9.配置agent节点

    ####其他节点
    拷贝agent:
    ansible cloudera -m copy -a "src=/opt/cm-5.6.1.tar dest=/root/ owner=root group=root mode=0700"
    ansible cloudera -m shell -a "tar -xvf /root/cm-5.6.1.tar -C /opt"
    ansible cloudera -m shell -a 'useradd --system --home=/opt/cm-5.6.1/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm'
    
    #启动agent节点
    /opt/cm-5.6.1/etc/init.d/cloudera-scm-agent start
    /opt/cm-5.6.1/etc/init.d/cloudera-scm-agent stop
    #查看启动日志
    tail -f /opt/cm-5.6.1/log/cloudera-scm-agent/cloudera-scm-agent.log
    

    10.常见报错

  • 相关阅读:
    20199131-2020-3-18 《网络攻防实践》第3周作业
    20199131-第2次作业-网络攻防实践
    20199131-第1次作业-网络攻防概述
    20199131《网络攻防实践》假期作业
    学习《深入理解计算机系统(第三版)》第二章总结
    学习《构建之法(第三版)》第一章总结
    关于宏的使用和Vim及其插件安装的学习总结
    细读《从问题到程序(第二版)》第一章学习总结
    细读《深入理解计算机系统(第三版)》第一章学习总结
    可信计算
  • 原文地址:https://www.cnblogs.com/sdhzdtwhm/p/9644586.html
Copyright © 2020-2023  润新知