1. Installation
1. Open the virtual machine VMware, you will see the following page.
2. Click "New Virtual Machine" in the figure above to enter the following page, select "Typical (Recommended)", and click Next.
3. Select "Install the operating system later" and click Next.
4. Select "Linux(L)" and select the version of Linux to be installed at the version.
5. Set your own virtual machine name and choose the location where the Linux system will be installed.
6. Set the size of the largest disk, select "Split the virtual machine into multiple files", and then click "Next".
7. Enter the following page. Start to set the device status of the installed virtual machine.
8. Click "Edit Virtual Machine Settings" to set the device status of the installed Linux system.
9. Set the memory size of the virtual machine, generally set to 2G.
10. Set the processor. It is better to set it according to your own computer. My computer has 4 cores, so the processor is set to 2, and the number of cores of each processor is set to 2, which is a total of 4 cores.
11. Set the network adapter, commonly used NAT mode, this mode solves the problem of IP address conflicts.
12. After the previous environment is set up, start the formal installation of CentOS6.8. Click "Virtual Machine", click "Settings"
13. Select "CD/DVD (IDE)", select "Use ISO image file", click "Browse", select the location of the CentOS6.8 image, and click "OK".
14. Click "Turn on this virtual machine".
15. After waiting for a period of time, you will enter the following page. Press the "tab" key to switch the cursor to Linux, select the "Skip" button
16. Then, click "Next"
17. Here, set the commonly used language. I chose Chinese (Simplified), then click "Next"
18. Then select "American English"
19. Select "Basic storage device" and click "Next".
20. On this page, select "Apply my selection to all devices with undetected partitions or file systems", and click "Yes, ignore all data".
21. Set the host name and click "Next"
22. Click "Next"
23. Set the root account and root password, click "Next"
24. Select "Create a custom layout" and click "Next"
25. Start to create a disk drive, as shown in the following page. Three partitions: swap partition swap partition; /boot partition boot partition; / partition boot partition
26. Click "Create", select "Approve Partition", and then click "Create" to enter the specific page of the disk to be created.
- Create /boot partition
- Create swap partition
- Create root partition
- The situation of the created partition is as follows. Then, click "Next",
- The following interface pops up, click "Format"
- Click "write changes to disk"
27. Click "Next"
28. Select the form of CentOS you want to create. I chose the "Desktop" form; select "Custom" and click "Next"
29. Select the program to be installed. According to your actual situation. My choices are as follows:
- Web service:
- Scalable file system support:
- Basic system:
- application:
- Development:
- Elastic storage:
- database:
- Server:
9. Desktop:
Two, network configuration
1. Check the network IP and gateway
1.1 View the virtual network editor
1.2 Modify ip address
1.3 View gateway
1.4 View the VMnet8 network configuration in the windows environment (Control Panel-Network and Internet-Change Adapter Options)
2. Configure the network IP and gateway of the Linux system
2.1 View current network IP
[whx@hadoop101 ~]$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:7D:B7:BC
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe7d:b7bc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3066 errors:0 dropped:0 overruns:0 frame:0
TX packets:1172 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240100 (234.4 KiB) TX bytes:133232 (130.1 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:123 errors:0 dropped:0 overruns:0 frame:0
TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:18048 (17.6 KiB) TX bytes:18048 (17.6 KiB)
[whx@hadoop101 ~]$
2.2 Modify the IP address of the current Linux system to a fixed address
[whx@hadoop101 ~]$ vim /etc/sysconfig/network-scripts/ifcfg-eth0
The following items marked in red must be modified, those with values should be modified according to the following values, and those without items should be added.
DEVICE=eth0
HWADDR=00:0c:29:7d:b7:bc
TYPE=Ethernet
UUID=d902e817-ae32-4272-bc86-66ebca38f2b6
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.1.101
GATEWAY=192.168.1.2
DNS1=114.114.114.114
DNS2=8.8.8.8
2.3 Restart network
carried out
service network restart
If an error is reported, reboot, restart the virtual machine
Three, configure the host name
1. View the host name of the current Linux system
[whx@hadoop101 ~]$ hostname
hadoop101
[whx@hadoop101 ~]$
2. Modify the host name of the current Linux system
If it feels that the hostname is inappropriate, we can modify it. Modify the HOSTNAME by editing the /etc/sysconfig/network file.
Note: Do not have "_" underscore in the host name
[whx@hadoop101 ~]$ vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hadoop101
NTPSERVERARGS=iburst
3. Turn off the firewall
3.1 Temporarily turn off the firewall
[whx@hadoop101 ~]$ sudo service iptables stop
3.1 Turn off the automatic startup of the iptables service: turn off the firewall at startup
[whx@hadoop101 ~]$ sudo chkconfig iptables off
4. Add a new user and configure the new user to have root privileges
4.1 Add new user
[root@hadoop101 ~]# useradd whx
[whx@hadoop101 ~]$ ll /home/
total 4
drwx------. 27 whx whx 4096 Jan 26 17:05 whx
[whx@hadoop101 ~]$
4.2 Set user password
[root@hadoop101 ~]# passwd whx
4.3 Grant ordinary users with root privileges
Modify the configuration file
[root@hadoop101 ~]# vi /etc/sudoers
Modify the /etc/sudoers file, find the following line (line 91), add a line under root, as shown below:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
whx ALL=(ALL) ALL
Or when configured to use the sudo command, no password is required
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
whx ALL=(ALL) NOPASSWD:ALL
After the modification is completed, you can now log in with the whx account, and then use the command sudo to obtain root privileges for operation.
Reference:
Steps to install CentOS6.8 under VMware 15.5