outline
Build 4 Ubuntu systems,
3 server versions, and 1 desktop version. The server versions are master, slave1, and slave2 nodes. The desktop version of the virtual machine is a test machine.
1. Install the system and distribute the network
1.1 Click to jump to the server version to install the system, and to configure the network
1.2 Click to jump to the desktop version to install the system, and to configure the network
2. Connect Xshell
Failed to connect to Xshell click
2.1 Check the node machine
IP address, gateway, whether you can ping the external network, and whether you can ping the host's IP address.
If the ping fails, check the gateway and dns.
If the host IP address cannot be pinged, check the virtual network editor
2.2 Check the host
IP address, gateway, whether you can ping the external network, and whether you can ping the IP address of the virtual machine host
3. Modify the name of the virtual machine (take the master node as an example below)
3.1 Edit files
vi /etc/hostname
i Enter editing
Esc Exit
: wq Save and exit
4. Configure the hosts file
Purpose: do host mapping ip
4.1 Edit the hosts file
vi /etc/hosts
4.2 Restart the network
netplan apply
4.3 Check whether the modification is successful
ping master =ping 172.25.0.10
5. APT software source configuration
5.1 Enter the apt directory
cd / etc / apt
5.2 Before modifying the sources.list file, make a backup.
5.3 Edit the sources.list file
vi sources.list
here is a mirror file, generally there are 10 addresses. This article uses the mirror image of the 163 website. If you want to use the mirror address of other websites, modify the address. For example: using Aliyun website mirroring, change "163" in 10 URLs to "aliyun".
5.4 Update all software
apt update
5.5 View updated software
apt list --upgradable
6. Install openssh-server
Purpose: mster access to the slave node does not need to enter a password to enter the slave node.
6.1 Check whether openssh-server is installed
dpkg-query -l openssh-server The
figure above indicates that openssh-server has been installed.
The openssh-server is not installed as shown in the figure below.
version is none.
6.2 Install openssh-server
apt install openssh-server
6.3 Uninstall openssh-server
apt purge openssh-server -y
purge uninstalls more thoroughly, so use it.
7. Turn off the firewall
7.1 Check the status of the firewall
ufw status The
firewall in the figure above is closed. The
firewall in the figure below is turned on. ative
7.2 Start the firewall
ufw enable
7.3 Turn off the firewall
ufw disable
8. Modify the sshd_config file
Purpose: To connect to Xshell is to log in directly as the root user, without the need to log in as an ordinary user, and then switch the root user.
8.1 Enter the catalog
cd /etc/ssh
8.2 Modify files
vi sshd_config
Add PermitRootLogin yes to the line below PermitRootLogin prohibit-password
8.3 Restart the service
systemctl restart ssh
8.4 View ssh service status
systemctl status ssh
9. Host window system for host mapping
Path: C:\Windows\System32\drivers\etc
Edit the hosts file and add
172.25.0.10 master
172.25.0.11
slave1 172.25.0.12
slave2 172.25.0.20 bass-desktop at the end
10. Virtualization installation tool
11. Shut down and take a snapshot
The same is true for slave1, salve2, and bass-desktop, just install the above steps.