1主机情况
Df -h
Lsblk
Cat /etc/fstab
2统一主机名和域名
Vim /etc/hosts
Vim /etc/hostname
3修改网关
Vim /etc/sysconfig/network-scripts/ifcfg-ens192
Service network restart 重启网卡服务,使上述生效
4禁用SELinux
Vim /etc/selinux/config
为了SELinux更换失效,需要重新启动reboot
5关闭防火墙
关闭:Systemctl stop firewalld
查看状态:Systemctl status firewalld
6关闭透明大页
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
7 swap设置为1
并永久修改并保存到文件:echo vm.swappiness = 1 >> /etc/sysctl.conf
sysctl -p 可以立即生效
8安装Httpd服务
安装:Sudo yum -y install httpd
启动:Sudo systemctl start httpd
关闭:Sudo systemctl stop httpd
9 yum源的安装
rhel-server-7.2-x86_64-dvd.iso镜像文件挂载
mount -o loop /root/iso/rhel-server-7.2-x86_64-dvd.iso /root/dev/centos
sudo scp -r /root/dev/centos/* /var/www/html/iso/
配置yum的repo
Local.repo
本地yum源
通过该配置,可以使集群的主机访问http://192.168.0.197/cm5.16目录下的文件
Os.repo
Yum repolist 使repo生效
10集群时间同步
安装ntp:Yum -y install ntp
修改配置文件:Vim /etc/ntp.conf
基准主机:所有集群同步node1主机
跟随主机 node2,node3,node4
11安装MariaDB
1安装:yum-y install mariadb mariadb-server
2启动: systemctl start mariadb
3初始化数据库:sudo /usr/bin/mysql_secure_installation
设置密码123456,移除匿名用户,允许远程连接,删除测试数据库并访问它,重新加载特权表
4建立组件对用的元数据表,以cm和hive为例:
mysql -uroot -p123456
create database metastore default character set utf8;
CREATE USER ‘hive’@’%’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON metastore. * TO ‘hive’@’%’;
FLUSH PRIVILEGES;
create database cm default character set utf8;
CREATE USER ‘cm’@’%’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON cm. * TO ‘cm’@’%’;
FLUSH PRIVILEGES;
5建立jdbc驱动的软连接
sudo ln -s mysql-connector-java-5.1.37.jar
mysql-connector-java.jar