[root@master ~]# vim /etc/selinux/config# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three values:# targeted - Targeted processes are protected,# minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection.
SELINUXTYPE=targeted
保存修改,执行以下命令立即禁用SELinux(安装完CDH后可以修改回enforcing模式)
[root@master ~]# setenforce 0
5、配置root用户之间免密登录
[root@master ~]# cd .ssh[root@master .ssh]# ssh-keygen -t rsa#一路回车..........[root@master .ssh]# cat id_rsa.pub >> authorized_keys[root@master .ssh]# ls
authorized_keys id_rsa id_rsa.pub known_hosts
[root@master .ssh]# ssh master
Last login: Mon Dec 28 11:45:39 2020 from 192.168.159.1#将master节点的公钥复制到slave的authorized_keys中即可[root@slave1 .ssh]# ssh-copy-id -i slave1#输入yes和密码[root@slave1 .ssh]# ssh slave1
Last login: Mon Dec 28 11:56:42 2020 from fe80::d7d4:6826:4c17:9459%ens33
[root@master ~]#
[root@master download]# tar -xvf mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar -C .
mysql-community-libs-5.7.27-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.27-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.27-1.el7.x86_64.rpm
mysql-community-devel-5.7.27-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.27-1.el7.x86_64.rpm
mysql-community-common-5.7.27-1.el7.x86_64.rpm
mysql-community-client-5.7.27-1.el7.x86_64.rpm
mysql-community-server-5.7.27-1.el7.x86_64.rpm
mysql-community-test-5.7.27-1.el7.x86_64.rpm
mysql-community-embedded-5.7.27-1.el7.x86_64.rpm
[root@master download]# rpm -i mysql-community-common-5.7.27-1.el7.x86_64.rpm [root@master download]# rpm -i mysql-community-libs-5.7.27-1.el7.x86_64.rpm [root@master download]# rpm -i mysql-community-client-5.7.27-1.el7.x86_64.rpm [root@master download]# rpm -i mysql-community-server-5.7.27-1.el7.x86_64.rpm#查看msyql服务状态[root@master download]# systemctl status mysqld
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: inactive (dead)Docs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.html
#启动mysql[root@master download]# systemctl start mysqld[root@master download]# systemctl status mysqld
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: active (running) since 一 2020-12-28 14:00:03 CST; 2s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 50627 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS(code=exited, status=0/SUCCESS)Process: 50553 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 50631 (mysqld)CGroup: /system.slice/mysqld.service└─50631 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
#查看启动mysql生成的临时密码[root@master download]# cat /var/log/mysqld.log | grep 'password'
2020-12-28T05:59:55.350376Z 1 [Note] A temporary password is generated for root@localhost: tZF%khh1_8ha
#修改密码[root@master download]# mysql -uroot -p
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password@123';#若出现ERROR 1819 (HY000): Your password does not satisfy the current policy requirements#则先设置一个不少于8位数的复杂密码,然后执行以下sql
mysql>set global validate_password_policy=LOW;
mysql>set global validate_password_length=4;
mysql> show variables like 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF || validate_password_dictionary_file ||| validate_password_length | 4 || validate_password_mixed_case_count | 1 || validate_password_number_count | 1 || validate_password_policy | LOW || validate_password_special_char_count | 1 |
+--------------------------------------+-------+
#然后再修改简单的密码#启用远程连接
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql>select user,host from user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| mysql.session | localhost || mysql.sys | localhost || root | localhost |
+---------------+-----------+
3 rows inset(0.00 sec)mysql> update user set host='%' where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)#配置msyql数据库和权限
create database scm default character set utf8 default collate utf8_general_ci;
grant all on scm.* to 'scm'@'%' identified by 'cdh_scm';
create database amon default character set utf8 default collate utf8_general_ci;
grant all on amon.* to 'amon'@'%' identified by 'cdh_amon';
create database rman default character set utf8 default collate utf8_general_ci;
grant all on rman.* to 'rman'@'%' identified by 'cdh_rman';
create database hue default character set utf8 default collate utf8_general_ci;
grant all on hue.* to 'hue'@'%' identified by 'cdh__hue';
create database metastore default character set utf8 default collate utf8_general_ci;
grant all on metastore.* to 'hive'@'%' identified by 'cdh_hive';
create database sentry default character set utf8 default collate utf8_general_ci;
grant all on sentry.* to 'sentry'@'%' identified by 'cdh_sentry';
create database nav default character set utf8 default collate utf8_general_ci;
grant all on nav.* to 'nav'@'%' identified by 'cdh_nav';
create database oozie default character set utf8 default collate utf8_general_ci;
grant all on oozie.* to 'oozie'@'%' identified by 'cdh_oozie';
flush privileges;
8、安装http服务器和createrepo
[root@master download]# yum install httpd createrepo
[root@master download]# systemctl start httpd
[root@master download]# systemctl status httpd
● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)Active: active (running) since 一 2020-12-28 15:39:51 CST; 4s agoDocs: man:httpd(8)man:apachectl(8)
[root@master download]# cd /usr/lib/tuned/
[root@master tuned]# grep "vm.swappiness" * -R
latency-performance/tuned.conf:vm.swappiness=10
throughput-performance/tuned.conf:vm.swappiness=10
virtual-guest/tuned.conf:vm.swappiness = 30
[root@master tuned]# vim latency-performance/tuned.conf
[root@master tuned]# vim throughput-performance/tuned.conf
[root@master tuned]# vim virtual-guest/tuned.conf
[root@master tuned]# grep "vm.swappiness" * -R
latency-performance/tuned.conf:vm.swappiness=0
throughput-performance/tuned.conf:vm.swappiness=0
virtual-guest/tuned.conf:vm.swappiness = 0
#修改完成后同步到其它节点
11、禁用透明页(所有节点)
[root@master ~]# vim /etc/rc.local
在文件中添加如下内容:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
#然后将该文件同步其他机器上,然后启动所有服务器