In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Part IV: the functions of establishing nfs shared storage, installing virtual machines and testing clusters
Establish a nfs storage source
Prepare a centos7/8 server and install the nfs service
Create a new virtual machine in the host VMware-workstation
Select Linux and centos7 67 bits for operating system type
The virtual machine name is set to centos-nfs, and the location selection is in the same directory as the previous esxi host for management
Cpu4 core memory 4096m network temporarily select the bridge network, the hard disk first create a 20g to install the system, and then add a large hard disk as a nfs shared disk (actually need to add 2 shared disks, do not add here, then add later)
Delete the sound card and printer after creation, and change the bridged network to custom, and connect to the storage network VMNet1.
Mount the installation iso of centos and install the centos system. The installation process will not be discussed here.
If you need to connect to the external network during the installation process, you can add another network card and choose the bridging mode.
After installing the system, configure the hostname, network, selinux, firewall, etc.
Hostname: centos-nfs
Ip:192.168.10.254/24,10.8.20.254/24 (required to connect to the public network)
Close selinux
Turn off the firewall
Update the system
Add a 500g hard disk to this centos server
After restarting the server, partition, format, mount it to the nfs directory under the root directory, and write it to fstb to achieve automatic mount.
Zoning
Fdisk / dev/sdb
N
P
Enter twice
W
Formatting
Mk2fs.ext4 / dev/sdb1
Mounting
Mkdir / nfs
Mount / dev/sdb1 / nfs
Power on and mount automatically
Vi / etc/fstab
Add the following to the end of the file:
/ dev/sdb1 / nfs ext4 defaults 0 0
After configuration, follow these steps to install the nfs service:
Step1: install NFS server-side software
Yum-y install nfs-utils rpcbind
Step2: configuring the NFS directory
Vi / etc/exports
Add the following:
/ nfs 192.168.10.0 Compact 24 (rw,sync,no_root_squash)
Export nfs directory
Exportfs-rav
Step3: start the service
Systemctl enable rpcbind
Systemctl start rpcbind
Systemctl enable nfs-server
Systemctl start nfs-server
Nfs service installation completed
Add nfs Stora
Right-click in vCenter's cluster Cluster1 and select "Storage" → "create a new datastore."
Open the wizard
→ Select nfs
→ version nfs 4.1
→ data store name: share-datastore-nfs
Folder: / nfs
Server: 192.168.10.254
→ does not use kerberos authentication
→ host accessibility Select all 3 hosts
→ completed
The completed data storage is shown below:
At the same time, this nfs storage can be seen in the data store of each host.
Indicates that the shared storage was established successfully.
Open the function of the cluster
Now you can create a new virtual machine to test the effect of the cluster.
Enable the DRS and HA functions of the cluster
Finally, there will be the following prompt that you need to add a shared storage for the esxi host for data detection
Create another shared directory on the centos server. For simplicity, we directly use the first disk (system disk) of centos as the share (normally we should add another hard disk and mount it to the / nfs1 directory below)
Mkdir / nfs1
Modify .etc / exports to add a line
/ nfs 192.168.10.0 Compact 24 (rw,sync,no_root_squash)
/ nfs1 192.168.10.0 Compact 24 (rw,sync,no_root_squash)
Restart the nfs service
Systemctl restart rpcbind
Systemctl restart nfs-server
Then add the second shared storage disk to vCenter, named share-datastore-nfs1
Then modify the settings of HA
So there will be no hints.
Test cluster
Create an iso directory on the shared storage share-datastore-nfs to store the iso image where the virtual machine operating system is installed, and upload the iso file to it
When uploading a file, the following prompt appears
Let's solve it.
The browser enters https://10.8.20.250, the address of vCenter, and downloads the trusted root certificate on the right
Will get win/linux/mac3 certificates.
Import the win version of the certificate into the browser
Open the browser Settings → Privacy Settings and Security → Management Certificate → import, find the certificate you just downloaded, and import the xxx.crt import under the win folder.
After the import is complete, restart the browser, and then open vcenter to upload the file.
Install a centos virtual machine to test the functionality of the cluster
Note that when installing virtual machines to choose storage, be sure to choose to install on the shared storage share-datastore-nfs.
The specific process of installing a virtual machine will not be described in detail.
Migration during virtual machine shutdown
You can migrate from one host to another, changing only computing resources.
The network card configuration of the virtual machine selects the VM Network,IP address set to the 10.8.20.0 network segment, which can connect to the external network.
Install CentOS8 from the network
Installation succeeded
You can then test the cluster for DRS automatic migration, manual migration, simulated host unresponse, and so on.
The full text is over.
Welcome to my technical blog: memories in autumn
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.