1、安装CentOS 7
http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1611.iso
1、在vmware中,Edit->Virtual Network Editor,选择VMnet8
2、去掉Use local DHCP service to distribute IP address to VMs选项
3、Subnet IP设置为192.168.2.0
4、点击NAT Settings设置GATEWAY地址:192.168.2.2
5、安装过程略,注意修改主机名
hostnamectl set-hostname node1
- 修改/etc/sysconfig/network-scripts/ifcfg-eth0:(eth0根据实际情况查看网卡名字)
BOOTPROTO="static"
IPADDR=192.168.2.11
NETMASK=255.255.255.0
ONBOOT=yes
GATEWAY=192.168.2.2
DNS1=192.168.2.2
reboot
ping www.baidu.com
yum upgrade
yum -y install net-tools
ifconfig
192.168.2.11 node1
192.168.2.12 node2
192.168.2.13 node3
192.168.2.14 node4
192.168.2.15 node5
192.168.2.16 node6
yum -y install vim
set ai " always set autoindenting on
set nu!
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4
set softtabstop=4 " Sets the number of columns for a TAB
set expandtab " Expand TABs to spaces
set paste
scp /etc/vimrc root@node2:/etc
scp /etc/vimrc root@node3:/etc
scp /etc/vimrc root@node4:/etc
scp /etc/vimrc root@node5:/etc
scp /etc/vimrc root@node6:/etc
alias rm='rm -f'
# alias cp='cp -i'
# alias mv='mv -i'
alias vi='vim'
scp /root/.bashrc root@node2:/root
scp /root/.bashrc root@node3:/root
scp /root/.bashrc root@node4:/root
scp /root/.bashrc root@node5:/root
scp /root/.bashrc root@node6:/root
systemctl stop firewalld.service
systemctl disable firewalld.service
# 生成密钥
ssh-keygen -t rsa
# 将公钥放入认证文件中
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
# 拷贝认证文件到其他节点
scp /root/.ssh/authorized_keys root@node2:/root/.ssh/
scp /root/.ssh/authorized_keys root@node3:/root/.ssh/
scp /root/.ssh/authorized_keys root@node4:/root/.ssh/
scp /root/.ssh/authorized_keys root@node5:/root/.ssh/
scp /root/.ssh/authorized_keys root@node6:/root/.ssh/
网友评论