Go ahead and do the whole thing!
This paper intends to build a set of own multi-node Linux system environment step by step from 0, which will be the cornerstone of learning Linux, using Linux, programming Linux environment, application and project deployment, tool experiment and a series of learning and practice, I hope it will be helpful to friends.
It is very important to prepare the Linux programming experiment environment in advance. It is recommended to have a set of Linux programming experiment environment, so that when you need to practice after learning a theoretical knowledge, you can take it to practice immediately.
So this article first to build up the environment!
Software to prepare
VMware
Virtual machine software: Used in this articleVMware Fusion 10.1.0
versionCentOS
The operating systemISO
Mirror:CentOS 7.4 64
- SSH terminal software:
SecureCRT
- SFTP file transfer tool:
Transmit
- Physical host system:
MacOS Catalina 10.15.4
Install the Linux operating system
1. Create a VM
2. Select firmware type
The default can be
3. Select Custom Settings
4. Go to Custom Settings
We initially need to customize the main is the processor, memory, hard disk, can be allocated according to the host performance on demand.
5. Start the VM
If a permission prompt is displayed, remember to enable permission, otherwise an error may be reported
Officially click the start button, in the process of all kinds of prompts permission to allow action, it is recommended to pass.
6. Go to the system installation page
7. Select an installation language
8. Select the preinstalled software
9. Configure partitions
There is no special need to choose automatic partition, you can customize the partition if necessary.
10. Enter the installation process
11. The installation is complete and restart
12. Enter the new system
The system is installed, but we still have a few problems
Fault 1: The Linux operating system on the VM cannot communicate with the Internet
Fault 2: The Linux operating system on the VM cannot communicate with the external host
For example, the IP address of my physical host is 192.168.31.35
Fault 3: Linux nodes in the VM cannot communicate with each other (if multiple Linux nodes are installed).
Network configuration (extremely important!)
1. Check the IP address of the VM system
Run the ifconfig command to query information. We will find that the installed system does not have an IP address for it.
2. Set the network connection between the VM and the physical host
Firstly, I choose the bridge mode. In addition, since my physical host connects to the router through WiFi and finally accesses the Internet, I choose Wi-Fi here
Friends can choose according to the actual situation.
3. Configure a fixed static IP address for the VM
First use the DHClient tool to assign an IP address available in the network to the host:
Then edit the VM system nic configuration and add the IP address assigned above:
Run the vim /etc/sysconfig/network-scripts/ifcfg-ens33 command to edit
Modify the configuration as follows:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=824ec4bd-a9AE-4410-8346-17ce7f3DD111 DEVICE=ens33 ONBOOT=yes IPADDR=192.168.31.110 NETMASK=255.255.255.0 GATEWAY=192.168.31.1 DNS1 = 119.29.29.29Copy the code
Pay particular attention to the configuration marked in red below:
After editing, restart network Settings
systemctl restart network.service
Check the installation and configuration
1. Check the IP address configuration
2. Check the vm network connectivity
This includes checking connectivity to the Internet, to the physical host, and to sibling nodes (if you have multiple virtual machine system nodes installed)
3. Reverse check the network connectivity between the physical host and the VIRTUAL machine
At this point, you’re done!
SSH Remote Connection
Connect to the Linux operating system on the VM using SSH on the host. Success!
SFTP File Transfer
You can use the SFTP tool to access the Linux node on the host to transfer files between the local host and the server
Now you have a usable Linux node!
Why not get a few more nodes?
You can repeat the above steps to create multiple Linux nodes, but it is easier to clone the existing virtual machine nodes and quickly create other nodes.
After cloning is complete, you only need to configure the network of the new node.
Afterword.
Well, now the multi-node Linux environment has finally been built, the follow-up is no matter learning Linux, using Linux, Linux environment programming, application and project deployment, tool experiments, there are hands-on practice.