Requires components: Virtual Machine, CentOS-6.5-x86_64-minimal.iso, CentOS-6.5-x86_64-bin-DVD1.iso.
1. First, use minimal to install the virtual machine to minimize installation;
2. Perform some basic configurations;
2.1 The virtual machine uses NAT to connect to the Internet and finds the ip address of the gateway, which is 192.168.128.2 and records the ip address of the gateway;
2.2 configure the static IP address and machine Name:
Static IP :(/etc/sysconfig/network-scripts/ifcfg-eth0) only use IPADDR, netmask, gateway, dns configuration, modify ipv6init to no
DEVICE="eth0"BOOTPROTO="static"IPADDR="192.168.128.100"NETMASK="255.255.255.0"GATEWAY="192.168.128.2"DNS1="8.8.8.8"HWADDR="00:0C:29:5E:9D:9E"IPV6INIT="no"NM_CONTROLLED="yes"ONBOOT="yes"TYPE="Ethernet"UUID="83afb8fd-3d1b-4ab5-bcd1-a1c4493d57b1"
Machine name: (/etc/sysconfig/network), machine name is set to vm1
NETWORKING=yesNETWORKING_IPV6=noHOSTNAME=vm1GATEWAY=192.168.128.2
Configure ip ing: (/etc/hosts), vm2 and vm3 belong to a cluster, so as to prepare for building a hadoop cluster later.
192.168.128.100 vm1192.168.128.101 vm2192.168.128.102 vm3127.0.0.1 vm1::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Restart the VM (if you only modify the ip address, you do not need to restart the VM, but we have changed the machine name here, so restart the VM ).
3. Enter ping www.baidu.com in the terminal to test whether a network connection exists. If yes, the network configuration is OK.
4. Configure local source:
4.1 modify the iso file in the virtual machine to a dvd, for example:
4.2 mount the iso file to the/media/cdrom Folder: mkdir/media/cdrom; mount/dev/cdrom/media/cdrom;
4.3 go to the/etc/yum. repos. d folder and you can see:
CentOS-Debuginfo.repo CentOS-Vault.repoCentOS-Base.repo CentOS-Media.repo
Rename CentOS-D * And CentOS-B * to add a. bak later, modify the CentOS-Media.repo file:
[c6-media]name=CentOS-$releasever - Mediabaseurl=file:///media/cdrom/gpgcheck=0enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Run yum clean all and yum install vim. If vim is successfully installed, the local yum source configuration is successful.
5. Configure the http Source:
5.1 install httpd: yum install httpd;
5.2 disable the firewall: service iptables stop; chkconfig iptables off; setenforce 0;
Modify selinux = "" in the/etc/SELINUX/config file to disabled.
5.3 re-mount iso to/media/cdrom. Copy: cp-R/media/cdrom/Packages/var/www/html/rhel.
5.4 install createrepo, yum install createrepo *
5.5 generate the repodata folder, createrepo/var/www/html/rhel;
5.6 Modify/etc/httpd/conf/httpd. conf: ServerAdmin root @ vm1 ServerName: vm1: 80;
5.7 Add a myiso. repo file in the/etc/yum. repo. d folder with the following content:
[myiso]name=myiso repobaseurl=http://vm1/rhelgpgcheck=0enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Rename CentOS-M * To. bak;
5.8 start httpd: httpd-k start; chkconfig httpd on
5.9 yum clean all; yum install vim if the system prompts that the installation has been completed, it indicates that the http source configuration for the http LAN is successful;
6. other machines in the LAN use this http Source:
When the network environment configuration is consistent:
In the/etc/yum. repo. d folder, copy the newly created myiso. repo to this point, and rename other files (Add. bak later.
Use yum clean all; yum install vim for testing.
Share, grow, and be happy
Reprinted please indicate blog address: http://blog.csdn.net/fansy1990