|
Required Components: VM, 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 the installation;
2. Then carry out some basic configuration;
2.1 virtual machine using NAT mode networking, and find the gateway ip, here is 192.168.128.2, record the gateway ip;
2.2 Configuring Static IP and Machine Name:
Static ip: (/ etc / sysconfig / network-scripts / ifcfg-eth0) Only the allocation IPADDR, netmask, gateway, dns can be amended ipv6init 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 = yes
NETWORKING_IPV6 = no
HOSTNAME = vm1
GATEWAY = 192.168.128.2
Configure the ip map: (/ etc / hosts), vm2 and vm3 belong to a cluster, so do the Hadoop cluster to build the back.
192.168.128.100 vm1
192.168.128.101 vm2
192.168.128.102 vm3
127.0.0.1 vm1
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Restart the virtual machine (if you just modify the ip, then do not restart can be, but here we change the machine name, so restart a good point).
3. In the terminal, enter ping www.baidu.com test whether there is a network connection, there is description of the network configuration ok.
4. Configure the local source:
4.1 modify the iso file in the virtual machine for the DVD version
4.2 Mount the iso file to the / media / cdrom folder: mkdir / media / cdrom; mount / dev / cdrom / media / cdrom;
4.3 into / etc / yum.repos.d folder you can see:
CentOS-Debuginfo.repo CentOS-Vault.repo
CentOS-Base.repo CentOS-Media.repo
CentOS-D * and CentOS-B * renamed to be followed by a. Bak can, modify the CentOS-Media.repo file:
[C6-media]
Name = CentOS- $ releasever - Media
Baseurl = file: /// media / cdrom /
Gpgcheck = 0
Enabled = 1
Gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6
Run yum clean all, yum install vim, if vim successfully installed, then the local yum source configuration is successful.
5. Configure the http source:
5.1 Installing httpd: yum install httpd;
5.2 Shut down 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 Installing 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, as follows:
[Myiso]
Name = myiso repo
Baseurl = http: // vm1 / rhel
Gpgcheck = 0
Enabled = 1
Gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6
Also rename CentOS-M * to .bak;
5.8 Start httpd: httpd -k start; chkconfig httpd on
Yum install vim If the prompt has been installed, then http http http source configuration is successful;
6. Other machines in the LAN use this http source:
In the case of a consistent network environment:
In / etc / yum.repo.d folder below the new myiso.repo copy to this, while renaming other files (followed by. Bak) can be.
Use yum clean all; yum install vim to test. |
|
|
|