新机器要干的事情
- 设置网卡【设置ip和相关参数】
[root@vm01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777728
- 设置网卡参数【所有节点都需设置,不同之处在于IPADDR】
[root@vm01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno16777728
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777728
UUID=b308f19b-6f6c-4c81-acc0-53de244624ea
DEVICE=eno16777728
ONBOOT=yes
IPADDR=192.168.200.50
NETMASK=255.255.255.0
GATEWAY=192.168.200.1
DNS1=114.114.114.114
DNS2=214.141.136.10
- 重启网络服务
[root@vm01 ~]# service network restart
- 查看本机ip【确认是否已经更改】
[root@vm01 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777728: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:9d:b7:90 brd ff:ff:ff:ff:ff:ff
inet 192.168.200.50/24 brd 192.168.200.255 scope global eno16777728
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe9d:b790/64 scope link
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 52:54:00:a2:c0:34 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 500
link/ether 52:54:00:a2:c0:34 brd ff:ff:ff:ff:ff:ff
- 修改主机名【需要重启】
[root@vm02 shujubeifen]# cat /etc/hostname
vm02
- 修改/etc/sysconfig/network
[root@vm02 shujubeifen]# cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
- 修改/etc/hosts【主机映射】
[root@vm02 shujubeifen]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.200.50 vm01
192.168.200.51 vm02
192.168.200.52 vm03
- 重启网络服务【更改成功标志为能够ping通】
- 安装jdk环境
a. rz命令上传jdk包
b. 解压至/opt/apps【需要新建】
c. 配置环境变量
d. source /etc/profile
e. 将jdk安装包和profile文件分发到每一台节点上
- 更改yum源为国内地址
a. 备份本地yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
b. 获取阿里yum源配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
c. 更新cache
yum makecache
d. 查看
yum -y update