一、准备工具
vmwareworkstation
centos-6.9-x86_64-minimal.iso
securecrtportabl
二、安装系统
1、图解虚拟机安装过程
install or upgrade an existing systeminstall system with basic vedio driverrescue install system第一项为正常安装第二项为基本显卡安装第三项为救援模式选择第一项
检查硬件 故障 disc found此项主要检查安装光盘有无问题。选择检查,选择ok
配置网络: 需要点掉自动连接此项相当于开启网卡
重新启动
2、网络配置
使用root和密码登录到系统中
然后设置网卡
vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
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=eno16777736
device=eno16777736
onboot=yes //启用网卡
ipaddr=192.168.225.104 //设置ip
netmask=255.255.255.0 //设置掩码
gateway=192.168.225.2 //设置网关,就是记住的网关
dns1=114.114.114.114 //设置dns
dns2=114.114.114.115 //设置备用dns
使用securecrt连接
3、配置yum源
[root@wangmaster ~]# cd /etc/yum.repos.d/
[root@wangmaster yum.repos.d]# ls
centos7-base-163.repo centos-debuginfo.repo centos-sources.repo
centos-base.repo centos-fasttrack.repo centos-vault.repo
centos-cr.repo centos-media.repo
[root@wangmaster yum.repos.d]# mv centos-base.repocentos-base.repo.bak //使原来的yum失效
[root@wangmaster yum.repos.d]# yum clean all //清除yum缓存
已加载插件:fastestmirror
正在清理软件源: base extras updates
cleaning up everything
[root@wangmaster yum.repos.d]# yum repolist //更新yum库
已加载插件:fastestmirror
base | 3.6 kb 00:00
extras | 3.4 kb 00:00
updates | 3.4 kb 00:00
(1/4): base/7/x86_64/group_gz | 155 kb 00:00
(2/4): extras/7/x86_64/primary_db | 139 kb 00:00
(3/4): base/7/x86_64/primary_db | 5.6 mb 00:09
(4/4): updates/7/x86_64/primary_db | 3.9 mb 00:11
determining fastest mirrors
源标识 源名称 状态
base/7/x86_64 centos-7 - base - 163 9,363
extras/7/x86_64 centos-7 - extras - 163 311
updates/7/x86_64 centos-7 - updates - 163 1,126
repolist: 10,800
[root@wangmaster yum.repos.d]#
[root@wangmaster yum.repos.d]# yum install -y vim //安装vim工具
4、关闭selinux
[root@wangmaster yum.repos.d]# vim /etc/selinux/config
# this file controls the state of selinux on the system.
# selinux= can take one of these three values:
# enforcing -selinux security policy is enforced.
# permissive -selinux prints warnings instead of enforcing.
# disabled - noselinux policy is loaded.
selinux=disabled
# selinuxtype= can take one of three two values:
# targeted -targeted processes are protected,
# minimum -modification of targeted policy. only selected processes are protected.
# mls - multilevel security protection.
selinuxtype=targeted
5、停止防火墙
查询防火墙状态:[root@localhost ~]# service iptables status停止防火墙:[root@localhost ~]# service iptables stop启动防火墙:[root@localhost ~]# service iptables start重启防火墙:[root@localhost ~]# service iptables restart永久关闭防火墙:[root@localhost ~]# chkconfig iptables off永久关闭后启用:[root@localhost ~]# chkconfig iptables on
6、安装jdk环境
上传jdk
tar-zxvf jdk1.8.tar.gz
修改/etc/profile文件,配置java环境
vim/etc/profile
java_home=/usr/local/java/jdk1.8
java_bin=/usr/local/java/jdk1.8/bin
path=$path:$java_home/bin
classpath=.:$java_home/lib/dt.jar:$java_home/lib/tools.jar:$java_home/jre/lib/rt.jar
exportjava_home
exportjava_bin
exportpath
exportclasspath
source/etc/profile
三、安装过程出现的问题
(1)虚拟化性能计数器不兼容二进制转换。
解决办法:设置处理器时,关闭性能计数器
(2)linux获取 gpg 密钥失败
解决办法:
实质性问题就是自己系统没有yum的gpg密钥
查看自己系统版本
cat /etc/issue
登陆mirrors.163 找到自己系统对应的密钥
rpm-gpg-key-centos-3
rpm-gpg-key-centos-4
rpm-gpg-key-centos-5
rpm-gpg-key-centos-6
使用命令rpm --import进行导入
rpm --import http://mirrors.163/centos/rpm-gpg-key-centos-6(把6改为你当前版本)
再用 yum -y install tree 就可以了