1、解压安装包
tar xf /root/bkce_src-5.1.29.tar.gz -C /data/
2、解压证书到/data/src/cert/
tar xf /root/bkce_src-5.1.29.tar.gz -C /data/
3、修改install.config.3ip.sample模板
cd /data/install/ && cp install.config.3ip.sample install.config 172.27.16.44 kafka(config),zk(config),es,consul,bkdata(databus),nginx,influxdb,paas,cmdb,job,gse,license,redis,appo 172.27.16.38 kafka(config),zk(config),es,consul,bkdata(dataapi),mongodb,mysql,beanstalk,fta,rabbitmq 172.27.16.88 kafka(config),zk(config),es,consul,bkdata(monitor),appt
4、配置ssh免密登录
ssh-keygen 1. .ssh 目录权限为:700 2. 密钥文件authorized_keys权限为:600 3. 其他新增密钥文件known_hosts权限为:644 ssh-keygen ssh-copy-id root@172.27.16.44 cat server.list |xargs -i ssh {} "command" //server.list为准备安装蓝鲸的服务器资源列表,command为在每台服务器上执行的命令
#蓝鲸平台检查ssh
cd /data/install
bash configure_ssh_without_paas # 根据提示输入各主机的root密码完成免密登录配置
5、批量修改并检查环境准备
cat server.txt |xargs -i ssh {} "which rsync"
cat server.txt |xargs -i ssh {} "systemctl setenforce 0" cat server.txt |xargs -i ssh {} "sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config" cat server.txt |xargs -i ssh {} "systemctl stop firewalld " cat server.txt |xargs -i ssh {} "systemctl disable firewalld" cat server.txt |xargs -i ssh {} "systemctl stop NetworkManager" cat server.txt |xargs -i ssh {} "systemctl disable NetworkManager" cat server.txt |xargs -i ssh {} "cat << EOF >> /etc/security/limits.conf root soft nofile 102400 root hard nofile 102400 EOF" cat server.txt |xargs -i ssh {} "date -R && timedatectl |grep Time && ulimit -n" cat server.txt |xargs -i ssh {} "sed -i '2d' /etc/resolv.conf && sed -i '1i nameserver 127.0.0.1' /etc/resolv.conf"
cat server.txt |xargs -i ssh {} "cat /etc/profile | grep umask"
umask 002 umask 022 ###
注意:
timedatectl |grep Time #过滤出时区必须为shanghai
timedatectl set-timezone 'Asia/Shanghai' #修改时区
ntpdate -d cn.pool.ntp.org #联网修改时间
检查是否存在全局 HTTP 代理 echo "$http_proxy" "$https_proxy" # 检查 http_proxy https_proxy 变量是否设置,若为空可以跳过后面的操作。 对于本机配置 http_proxy 变量的方式,请依次查找文件 /etc/profile、/etc/bashrc、$HOME/.bashrc 等是否有设置。 env | grep -i proxy //检查环境变量中是否有http的变量 cat /etc/profile | grep -i proxy*
6、添加swap分区
# 使用dd命令创建一个swap分区,在这里创建一个8G大小的分区 dd if=/dev/zero of=/root/swapfile bs=8G count=1 # 格式化新建的分区文件 mkswap /root/swapfile # 将新建的分区文件设为swap分区 swapon /root/swapfile # 设置开机自动挂载swap分区 echo "/root/swapfile swap swap defaults 0 0" >> /etc/fstab
7、检查yum配置文件
# CentOS-Epel.repo [epel] name=EPEL for redhat/centos $releasever - $basearch failovermethod=priority gpgcheck=1 gpgkey=http://mirrors.tencentyun.com/epel/RPM-GPG-KEY-EPEL-7 enabled=1 baseurl=http://mirrors.tencentyun.com/epel/$releasever/$basearch/ # CentOS-Base.repo [extras] gpgcheck=1 gpgkey=http://mirrors.tencentyun.com/centos/RPM-GPG-KEY-CentOS-7 enabled=1 baseurl=http://mirrors.tencentyun.com/centos/$releasever/extras/$basearch/ name=Qcloud centos extras - $basearch [os] gpgcheck=1 gpgkey=http://mirrors.tencentyun.com/centos/RPM-GPG-KEY-CentOS-7 enabled=1 baseurl=http://mirrors.tencentyun.com/centos/$releasever/os/$basearch/ name=Qcloud centos os - $basearch [updates] gpgcheck=1 gpgkey=http://mirrors.tencentyun.com/centos/RPM-GPG-KEY-CentOS-7 enabled=1 baseurl=http://mirrors.tencentyun.com/centos/$releasever/updates/$basearch/
8、重启服务器
reboot
小技巧:如何查看当前机器是否为中控机
cat /data/install/.controller_ip
预选可安装的程序
yum -y install pidof pkill rsync gawk curl lsof tar sed iproute uuid psmisc wget bind-utils mysql-devel MySQL-python vim lrzsz yum -y groupinstall "Development Tools"