Home  >  Article  >  Operation and Maintenance  >  How VMware installs and optimizes Rocky Linux server systems

How VMware installs and optimizes Rocky Linux server systems

WBOY
WBOYforward
2023-05-12 22:10:131671browse

Create a virtual machine

Just save the process here, after all, it is not the point.

Step 1: Select "Custom (Advanced)"

Step 2: Choose the highest version for compatibility. If you want to export to VMware on other computers, it is recommended not to choose one that is too high. version, it is recommended to select ESXi 6.7 for hardware compatibility

Step 3: Select the image package downloaded from the official website

, which is the minimal version from the official website. If it is a DVD version, the full version is 10.4GB. Large, it is still not recommended to download. After all, I only need a minimal installation.

How VMware installs and optimizes Rocky Linux server systems

Step 4: Select version Red Hat Enterprise Linux 8 64-bit

How VMware installs and optimizes Rocky Linux server systems

Step 5: Virtual machine name and location, fill this in yourself

Step 6: Number of processors*The number of cores per processor should not exceed that of the physical machine That's it, allocate it on demand. If it's just for testing, it is recommended to use 1 CPU and 2 cores.

How VMware installs and optimizes Rocky Linux server systems

Step 7: 4G of memory is enough

Step 8: Choose NAT for the network, this is the most stable, at least you don’t have to worry about not having a network. If you confirm the

in the network Step 9: Default

Step 10 and hard disk operation: NVME, create a new hard disk, the largest disk can be larger, compared to a server, if it is too small, The data will fill up immediately. You can enter 512. If your disk is already large, you can enter 1024 and larger capacities.

It is recommended to store the virtual disk as a single file

How VMware installs and optimizes Rocky Linux server systems

#Then take the next step to complete the creation of the virtual machine.

Delete excess hardware and select EFI boot

Click "Edit Virtual Machine Settings" to remove the printer and sound card. Select the USB controller and uncheck "Share Bluetooth device with virtual machine"

How VMware installs and optimizes Rocky Linux server systems

How VMware installs and optimizes Rocky Linux server systems

Enter the second menu and select "Advanced" , select "UEFI" as the firmware type. Why choose EFI? Firstly, this boot is more advanced, and when installing the system, the screen display area is larger. If you don’t believe me, you can try booting using BIOS. Anyway, I have tried both.

Open the virtual machine and install RockyLinux

How VMware installs and optimizes Rocky Linux server systems

You need to press the ↑ key and select Install Rocky Linux 8

Wait for a while to enter This interface:

How VMware installs and optimizes Rocky Linux server systems

#Real men choose English! After all, no one wants to see that the folder names in the user folder of the home directory are all in Chinese, right?

How VMware installs and optimizes Rocky Linux server systems

You need to do this step one by one, you can’t skip it directly. .

How VMware installs and optimizes Rocky Linux server systems

Language Support Select English and Chinese, I am afraid that Chinese will appear garbled

Time & Date Select Dongba District

How VMware installs and optimizes Rocky Linux server systems

Software Selection select Minimal Install, minimum installation

How VMware installs and optimizes Rocky Linux server systems

Installation Destination select Custom

How VMware installs and optimizes Rocky Linux server systems

Follow my installation From experience, home does not need to be too big at present. After all, those who really know how to operate the server generally use the root user to install server applications in the root directory. They are not very good at running home to install them, so I will use all the remaining space of more than 450 G here. Give the root directory

How VMware installs and optimizes Rocky Linux server systems

#Select Accept Changes in the pop-up window

How VMware installs and optimizes Rocky Linux server systems

Network & Host Name Remember to turn on the network card! ! Otherwise, the server is not connected to the Internet, then click Configure

How VMware installs and optimizes Rocky Linux server systems

, click IPV4 Settings, enter DNS, here we recommend 114.114.114.114 or 223.5.5.5

Return to Time & Date, open Network Time

How VMware installs and optimizes Rocky Linux server systems

Click the gear on the right side of ON to set the NTP server

A Alibaba Cloud timing server is added here

How VMware installs and optimizes Rocky Linux server systems

Set the root password, pay attention! If the password security is very low, you need to press Done twice to save the password.

How VMware installs and optimizes Rocky Linux server systems

Create a normal user here. Similarly, if the password security is very low, you need to click twice. Done several times to be able to save

How VMware installs and optimizes Rocky Linux server systems

The completed effect is as shown in the figure, and then click Begin Installation. After the installation is complete, Reboot System can

Connect to Rocky Linux

How VMware installs and optimizes Rocky Linux server systems

Enter ip addr to view the server's ip address, and then start FinalShell to connect to the server. No, no, no, there is no one really operating the server in the server, right?

How VMware installs and optimizes Rocky Linux server systems

How VMware installs and optimizes Rocky Linux server systems

Please use root to log in to Rocky Linux

Optimize Rocky Linux

Close and delete vmtoolsd

Why do I need to do this step? Because I found that installing Rocky Linux/CentOS in VMware will automatically install a vmtoolsd for you, but here we It is the server kernel version, there is no need for this thing at all, and this thing may have a memory leak and occupy a lot of memory, so it is better to delete it directly. The shell script is as follows:

systemctl stop vmtoolsd
systemctl disable vmtoolsd
rm -rf /etc/pam.d/vmtoolsd
rm -rf /usr/bin/vmtoolsd

Do not stop NetworkManager

Attention! ! network.service does not exist in Rocky Linux! ! If you stop NetworkManager, the system will be offline! !

How VMware installs and optimizes Rocky Linux server systems

Optional, turn off the firewall

systemctl stop firewalld
systemctl disable firewalld

Change the resource mirror source to Alibaba Cloud

Since Rocky Linux is based on CentOS8, it is directly Just take the resource mirror source of Alibaba Cloud CentOS8

yum install -y wget
wget -O /etc/yum.repos.d/Rocky-BaseOS.repo http://mirrors.aliyun.com/repo/Centos-8.repo
yum clean all
yum makecache

Since the minimum installation of Rocky Linux does not include wget, you need to install this first. The principle is to directly download the CentOS8 image source on Alibaba Cloud, name it Rocky-BaseOS.repo and directly replace this file. Then refresh the image source cache through two yum commands.

Install common tools

yum install -y vim net-tools unzip zip

Change rc.local to executable mode

chmod 755 /etc/rc.d/rc.local

Modify the boot waiting time

The default boot waiting time is 5 seconds. It's such a waste of time

vim /boot/efi/EFI/rocky/grub.cfg

Since I am using EFI boot installation, I edit grub.cfg in the EFI folder

How VMware installs and optimizes Rocky Linux server systems

In the command mode of vim, enter /timeout and press Enter to find the place to control the boot waiting time. After changing it to 1 second, you can modify it by :wq

How VMware installs and optimizes Rocky Linux server systems

Host name

The default host name is localhost. If you feel like changing the name is the same, you can use the command:

hostnamectl set-hostname ${替换为你自己的主机名}

Set the time zone to Dongba District

You can use date - R Check the current time zone situation. If you did not select the wrong time zone during installation, there is no need to change it here

How VMware installs and optimizes Rocky Linux server systems

timedatectl set-timezone Asia/Shanghai

ssh password-free for yourself

ssh-keygen -t rsa
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

The first step ssh-keygen -t rsa and press Enter all the way

Optimize network settings and modify DNS

vim /etc/sysconfig/network-scripts/ifcfg-ens160

If installed by default, the name of the network card is ens160

How VMware installs and optimizes Rocky Linux server systems

If there is no network connection after restarting the server, you can consider checking whether ONBOOT is no. You can add another DNS2. If you want to change to a static fixed IP, set it as follows:

BOOTPROTO=static
IPADDR=192.168.5.30
GATEWAY=192.168.5.1
NETMASK=255.255.255.0

How VMware installs and optimizes Rocky Linux server systems

:wq后保存,重启服务器,我发现重启NetworkManager无效????,记得ip改了后Finalshell需要重新设置连接

添加tailf命令

这个命令在查看日志中十分有用,虽然Rocky Linux有tail -f命令,但是对于用惯了tailf命令的我来说,缺了这个命令实在是太难受了。解决方法:使用CentOS7的tailf命令,丢到Rocky Linux的/usr/bin目录下即可

*可选,ElasticSearch方面修改

作为搞Java后端的程序猿,ES是常用工具,这里可以加一下ES的相关服务器配置

vim /etc/security/limits.conf

添加:

* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536

效果如图:

How VMware installs and optimizes Rocky Linux server systems

然后执行:

vim /etc/sysctl.conf

在文末添加:

vm.max_map_count=655360

然后执行:

sysctl -p

The above is the detailed content of How VMware installs and optimizes Rocky Linux server systems. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete