此篇基本与官方文档一致,细节不一样的地方会标注
我的环境:
server1 192.168.1.201 4核 8G 120G(固态)
server2 192.168.1.202 4核 8G 120G+500G(固态)
server3 192.168.1.203 4核 8G 120G+500G(固态)
server4 192.168.1.204 4核 8G 120G+500G(固态)
以上机型用cobbler 批量安装centos7.5 minimal.
修改hosts 文件,关闭防火墙(批量默认关闭),关闭selinux (批量默认关闭)
4台主机互相设置免密登陆
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain 192.168.1.201 server1 192.168.1.202 server2 192.168.1.203 server3 192.168.1.204 server4
批量操作可以使用ansible
0,所有节点操作,替换阿里源,epel
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
#yum clean all
#yum makecache fast
1,所有节点操作,添加Cloudera 源和keys
# wget https://archive.cloudera.com/cm6/6.0.1/redhat7/yum/cloudera-manager.repo -P /etc/yum.repos.d/
# rpm --import https://archive.cloudera.com/cm6/6.0.0/redhat7/yum/RPM-GPG-KEY-cloudera
2,server1,配置jdk环境 (此处建议遵循官方文档yum安装,不建议手动安装,后面的Auto-TLS 会有问题)
# yum install oracle-j2sdk1.8
3,server1,安装Clouder Manager Server (此处建议只安装cloudera-manager-server)
# yum install cloudera-manager-server
4,server1,Enable Auto_Tls (开启https 的支持,此为可选操作,我在后面遇到了问题,为了排除问题,所以这一步没有做)
5,server1,安装数据库 (Mariadb,Mysql 都可以的,根据个人喜好,此处Mysql 为例)
# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum update
# yum install mysql-server
修改数据库的配置文件 # vim /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock transaction-isolation = READ-COMMITTED # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: symbolic-links = 0 key_buffer_size = 32M max_allowed_packet = 32M thread_stack = 256K thread_cache_size = 64 query_cache_limit = 8M query_cache_size = 64M query_cache_type = 1 #最大连接数按照内存大小设置,8G为 600左右 max_connections = 550 #expire_logs_days = 10 #max_binlog_size = 100M #log_bin should be on a disk with enough free space. #Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your #system and chown the specified folder to the mysql user. log_bin=/var/lib/mysql/mysql_binary_log #In later versions of MySQL, if you enable the binary log and do not set #a server_id, MySQL will not start. The server_id must be unique within #the replicating group. server_id=1 binlog_format = mixed read_buffer_size = 2M read_rnd_buffer_size = 16M sort_buffer_size = 8M join_buffer_size = 8M # InnoDB settings innodb_file_per_table = 1 innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 64M innodb_buffer_pool_size = 4G innodb_thread_concurrency = 8 innodb_flush_method = O_DIRECT innodb_log_file_size = 512M [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid sql_mode=STRICT_ALL_TABLES
# systemctl enable mysqld
# systemctl start mysqld
数据库设置自启,开启数据库以后,初始化一下,按照提示操作
# /usr/bin/mysql_secure_installation
6,server1,按照JDBC 驱动 (参照官网)
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz
tar zxvf mysql-connector-java-5.1.46.tar.gz
mkdir -p /usr/share/java/
cd mysql-connector-java-5.1.46
cp mysql-connector-java-5.1.46-bin.jar /usr/share/java/mysql-connector-java.jar
7,server1,创建数据库 (参照官网,前期我观察只有scm 一个有用,但是为了后续操作,我全部建立了。)
mysql > CREATE DATABASE<database>DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
mysql > GRANT ALL ON<database>.* TO '<user>'@'%' IDENTIFIED BY '<password>';
8,server1,验证数据库链接
# /opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm (mysql为数据库类型,scm数据库名,scm用户名,然后输入密码,成功会有如下提示)
9,所有节点,关键的一步 (重命名此文件)
# mv /usr/bin/host /usr/bin/host.bk
10,server1,开启clouder-scm-server 服务 (时间可能会长一些,数据库里面要写入东西)
# systemctl start cloudera-scm-server
查看日志:
# tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
最好一行出先这个,表示启动正常
INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
浏览器登陆(根据浏览器语言自动选择中英文)
http://192.168.1.201:7180
用户名:admin
密码:admin
cm6.0.1 的 rpm 包下载地址,如需手动安装,可下载
https://archive.cloudera.com/cm6/6.0.1/redhat7/yum/RPMS/x86_64/
4个节点之间的时间同步我用的是chrony,大家可以参考
写的不好,有问题欢迎指正
VX:85862870
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。