1.环境准备

安装jdk需要(注意:jdk目录配置/usr/java下以免后期即使修改配置文件后jdk还是不正常)
安装mysql

  1. CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  2. CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  3. CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  4. CREATE DATABASE hive DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  5. #mysql-connector-java-5.1.27-bin.jar拷贝到/usr/share/java路径下
  6. mv mysql-connector-java-5.1.27-bin.jar mysql-connector-java.jar

2.CM服务安装&配置

2.1集群规划

节点 node1 node2 node3
服务 cloudera-scm-server
cloudera-scm-agent
cloudera-scm-agent cloudera-scm-agent

2.1配置

  1. #下载在线yum源配置文件(在线yum安装)
  2. cd /etc/yum.repos.d
  3. wget https://archive.cloudera.com/cm6/6.2.1/redhat7/yum/cloudera-manager.repo
  4. xsync /etc/yum.repos.d/cloudera-manager.repo
  5. tar -zxvf cloudera-repos.tar.gz -C /var/www/html
  6. cd /var/www/html/
  7. python -m SimpleHTTPServer 8900
  8. #查看 node1:9000是否正常
  9. vim /etc/yum.repos.d/cloudera-manager.repo
  10. [cloudera-manager]
  11. name=cloudera-manager
  12. baseurl=http://node1:8900/cloudera-repos/cm6/6.2.1/redhat7/yum/
  13. enabled=1
  14. gpgcheck=0
  15. #完成上面的文件分发
  16. #node1执行
  17. yum -y install cloudera-manager-daemons cloudera-manager-agent cloudera-manager-server
  18. #node2 &node3执行
  19. yum -y install cloudera-manager-agent cloudera-manager-daemons
  20. #修改cm配置文件中的server_host=node1,不要分发每台服务器手动修改
  21. vim /etc/cloudera-scm-agent/config.ini
  22. #初始化
  23. /opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm root 123456
  24. node1启动cm服务
  25. systemctl start cloudera-scm-server
  26. #node1,node2,node3启动agent
  27. systemctl start cloudera-scm-agent
  28. #启动日志有Started则启动成功
  29. tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log