1. System inconsistent time and time zone
1.1 Check System Time:
[root@localhost sysconfig]# timedatectl
Local time: 一 2017-11-06 21:13:19 CST
Universal time: 一 2017-11-06 13:13:19 UTC
RTC time: 一 2017-11-06 13:13:19
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: noNTP synchronized: no
RTC in local TZ: no
DST active: n/a
1.2 View system time zone:
[root@localhost sysconfig]# ls /usr/share/zoneinfo/
Africa Brazil Egypt GB-Eire HST Japan Navajo posixrules Turkey zone1970.tab
America Canada Eire GMT Iceland Kwaj
1.3 delete the partition in which the current system:
[root@localhost sysconfig]# sudo rm /etc/localtime
1.4 to create a soft link from / usr / share / zoneinfo / to replace the current time zone information, directly select Universal ::
[root@localhost sysconfig]# sudo ln -s /usr/share/zoneinfo/Universal /etc/localtime
1.5 once again view the system time:
[root@localhost sysconfig]# sudo timedatectl
Local time: 一 2017-11-06 13:14:32 UTC
Universal time: 一 2017-11-06 13:14:32 UTC
RTC time: 一 2017-11-06 13:14:32
Time zone: Universal (UTC, +0000)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
2. Network Settings
2.1 virtual machine settings editor to enter the three files (in order to)
vim /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
GATEWAY=192.168.50.2
vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
NAME=ens33
BOOTPROTO=static
NM_CONTROLLED=yes
IPV6INIT=no
ONBOOT=yes
IPADDR=192.168.50.10
PREFIX0=32
NETMASK=255.255.255.0
DNS1=192.168.50.2
vim /etc/resolv.conf
nameserver 192.168.50.2
2.2 Network Service Restart
systemctl restart network.service
3. The switching mirror source (Ali)
(1) image backup yum source (cd /etc/yum.repos.d)
[root@slave2 yum.repos.d]#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(2) Download aliyun the yum configuration file to /etc/yum.repos.d
[root@slave2 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
(3) generating the cache operation yum
[root@slave2 yum.repos.d]# yum makecache
(4) Update System
[root@slave2 yum.repos.d]# yum -y update
4. CENTOS unloading system comes java
查看CentOS自带JDK是否已安装:
yum list installed |grep java
卸载JDK相关文件输入:
yum -y remove java-1.8.0-openjdk*
卸载tzdata-java输入:
yum -y remove tzdata-java.noarch
5.java environment variable configuration
vim ~/.bashrc:
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
JAVA_HOME=/usr/local/src/jdk1.8.0_172
CLASSPATH=.:/usr/local/src/jdk1.8.0_172/bin
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi