VMware virtual machine installation and static IP setting configuration domestic mirroring

Purpose

Prepare the virtual machine, install Centos7, configure static IP, and configure domestic mirroring

Software statistics

Tool name illustrate
VMware-workstation-full-15.5.1-15018445.exe Virtual machine installation package
MobaXterm_Portable_v20.3.zip Decompress and use, remotely connect to Centos system for remote access, support login and file upload
CentOS-7-x86_64-DVD-1511.iso Centos7 system ISO image, no need to decompress, required for VMware installation
jdk-8u171-linuxx64.tar.gz jdk installation package, upload to Centos system for use
hadoop-2.7.3.tar.gz The hadoop installation package needs to be uploaded to the virtual machine

Experimental content
Complete the installation of VMware, virtual machine creation, and CentOS7 operating system installation
Experimental steps
1. Install VMware
2. Create a virtual machine and install the operating system CentOS7
3. Configure the network card to solve the problem of ifconfig naming not being found

Create a virtual machine and install the operating system CentOS7

Configure a virtual machine in VMware
New Virtual Machine Wizard
Insert image description here

Select a blank hard drive
Insert image description here

Select operating system
Insert image description here

Custom virtual machine location
Insert image description here

Specify the disk size. This size is dynamic at first and becomes larger as it is used. The maximum value is the maximum value we set.

Insert image description here

Custom system configuration
Insert image description here
Insert image description here

Start the virtual machine for installation

  • Start the virtual machine to install Centos7
  • This image is a minimal installation package for IOS. There is no image operation interface after installation.

Choose a pure English system and keyboard
Insert image description here

Modify time zone
Insert image description here

Set up a custom disk partition
Insert image description here
Insert image description here

Automatic partitioning scheme
Insert image description here

manual partition scheme
Insert image description here

Partition description

Partition illustrate
/home User profile space
/ The root directory must exist, and all first-level directories are under it. It is also related to booting, restoring, and repairing the system. It includes the system to create a program. To meet the system needs, it should be as small as possible. At the same time, it is best not to /Partition creates subdirectories and stores non-essential files. Recommend 50~100G (when there is enough space)
/boot Recommend 500M~1G, including system boot
/biosboot The hard disk adopts GPT partition. When the firmware is BIOS, it must exist. 2M is recommended.
/was Transformation data such as logs and caches will grow larger as they are used. It is recommended to divide them separately. Especially some high-load applications generate a large number of logs. 100~200G is recommended (when there is sufficient space)
/tmp Place some temporary files and temporary files in the program. When running high-debt services, create a separate partition. 100~200G is recommended (when there is sufficient space)
swap The swap partition is divided according to the memory size, which is generally 2 to 3 times the running memory.

It is recommended not to divide the entire space of the hard disk, but to reserve a part for expansion (LVM). The mount point, partition type, and file system can use the system recommendations. There is no need to use soft raid now, and there is no need to modify the volume group. Label (equivalent to the partition naming system and software under Windows) and Name are set according to the actual situation. Certainly. /usr and /opt generally do not need to be divided separately. Usually the server is usually dedicated and does not install many software. Sometimes it may be necessary to divide a /date to save some data.

Recommendations for custom partitioning of a virtual machine with a total space of 20G
Insert image description here

Click Done-》Accept Changes
Insert image description here

Installation process and ROOT password settings, new user settings
Insert image description here

After configuring the password

Insert image description here

After the installation is complete, reboot

Configure static IP

View host VMnet8 information

Check the network segment information in cmd

Insert image description here
View network segment information in VMware
Insert image description here
Insert image description here
Insert image description here

Configure static IP in virtual machine



[root@master hadoop-2.7.3]# cat /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
UUID=05722fba-2128-4348-a606-49c8f8e5775d
DEVICE=eno16777736
ONBOOT=yes

IPADDR=192.168.137.110
NETMASK=255.255.255.0
DNS1=8.8.4.4
GATEWAY=192.168.137.2
DNS2=8.8.8.8

# 重启网络服务
service network restart
# or
systemctl restart network.service

Insert image description here

Configure virtual machine external network access

After some virtual machines have a static IP, they can connect to the virtual machine through MobaXterm and access the external network. If the external network can be accessed normally, skip this step. If you cannot access the external network normally, you need to perform this step.

Settings-Network-Change Adapter

Insert image description here

Set up shared VMnet8 according to the network access method, wired or wifi
Insert image description here

After setting up shared VMnet8, the IP network segment of the VMnet8 network segment changes, and the static IP network needs to be reset.

Centos7 changed to domestic source

Commonly used centos domestic sources:

Implementation steps :

  1. It is recommended to back up the files in /etc/yum.repos.d/ first
  2. Replace centso source file settings
  3. update package

# 1备份文件
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

# 2替换centso源文件
# 对于 CentOS 7
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo

# 对于 CentOS 8
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org/$contentdir|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo
		 
# 更新软件包缓存
sudo yum makecache

Insert image description here

Insert image description here

Guess you like

Origin blog.csdn.net/pblh123/article/details/126809710