Prepare the environment before big data: Install three Linux servers on a MAC
1. Preparation before class
- Prepare a COMPUTER with at least 8 GB memory (16 GB recommended) and i7 4-core CPU
Second, class theme
- Install the virtualization software VMware
- Three Linux VMS are available
Third, class objectives
- You have installed the three VMS on the MAC
4. Key points of knowledge
Documentation:
- In the whole course of learning big data, we are required to keep the same operating system, software version and environment Settings as the teacher
VMware Fusion Version:
- VMware is recommended to use a later version, such as VMware Fusion 11.5
Linux version
Linux uses centos7.6 64-bit version
Seed file download address: mirrors.aliyun.com/centos/7.6….
For details, please refer to the video
1. About the VMware
- VMware virtual Machine software is a “virtual PC” software that allows you to run two or more Windows, DOS, and LINUX systems simultaneously on a single machine. VMWare uses a completely different concept than a “multi-boot” system.
- We can use VMware to install our Linux virtual machine, and then use Linux virtual machine to install the cluster
- On the MAC, we use VMware Fusion virtualization software
2. Prepare vmware Fusion software
3. Install vmware Fusion
- Double-click on the
VMware_Fusion_Pro_11.5.1.15018442_WaitsUn.com.dmg
- The following window is displayed. Drag “VMware Fusion” to “Applications”
- In the application shown below, double-click to open VMware Fusion
-
== If reminded to update software, do not update ==
-
Automatic popup window
4. Configure the vmware network
1. Add a virtual NIC on the GUI
- Open VMwa Re Fusion preferences
- Pop-up window, select 1 discount ️ network; Click 2 discount ️ to unlock 🔓; When unlocking, enter the password if prompted.
- After unlocking the lock, click the ➕ number on the lock, and a VMnet2 network will be added by default. Pay attention to the check as shown in the figure. After completing the lock, click Apply first and then lock
2. Open the terminal and access the directory
/Library/Preferences/VMware Fusion
3. Use sudo vim to modify networking in the directory
sudo vim networking
Copy the code
- Modify the file and save it
4. Go to the vmnet2 directory and modify the nat.conf file
cd vmnet2
sudo vim nat.conf
Copy the code
-
Save, exit
-
== note: there is a pit above the gateway IP address 192.168.77.2 fourth byte set to 2, do not set to other; Because it is found that when the network is applied, the fourth byte is automatically restored to 2==
5. Reapply vmnet2
-
Note: Exit vmware Fusion and then open it again ==
-
Go back to the preferences of vmware software, == select VMnet2 ==, then unlock, uncheck the options shown in the picture, and then check again, then the apply button can be clicked. And then lock it
- The effect is shown below; And then close the window
5. Create a VM
6. Configure the VM
Because the centos7 ISO file is not associated with the VM, stop the VM first
1. Configure cpus and memory resources for the VM
2. Set the network adapter to VMnet2
3. Set the disk space
4. Connect the CD-ROM drive and select the image file
5. Use the CD-ROM drive to start the vm
7. Install centos7
1. Start the installation
- Use the arrow keys on the keyboard to select Install CentOS 7 and press Enter to start the installation
- Press enter again
2. Set the language
- Set the keyboard to English
3. Set the date and time
- Next, configure these three items
- (1) Set the time zone to Asia/Shanghai
4. Configure disks
- (2) Set ②INSTALATION DESTINATION
5. Set the network
- (3) Set ③NETWORK & HOST NAME
6. Set the password of user root
7. Restart reboot
- This process takes a little longer, so be patient
8. Log in as user root
9. Modify the nic configuration file
- Editing a Configuration File
vi /etc/sysconfig/network-scripts/ifcfg-ens33
Copy the code
- Change BOOTPROTO to static and save and exit
- The configuration is complete and the network service is restarted
systemctl restart network
Copy the code
- Ping the VM IP address on a MAC terminal. If the ping fails, restart the VM
Ping 192.168.77.100Copy the code
- Install common software
#Check whether the ping succeeds
ping www.baidu.com
yum -y install vim
yum -y install net-tools
Copy the code
- To turn it off
init 0
Copy the code
10. Set the VM to boot from the hard disk
8. Clone three Linux VMS
- Clone three Linux VMS and name them respectively
Centos7.6_001, CentoS7.6_002, and CentoS7.6_003
- The IP addresses of the three machines are
192.168.77.100, 192.168.77.110, 192.168.77.120
- The IP address of the first cloned machine was the same as the IP address of the seed. Change the IP address of the second machine to 192.168.77.110
- Start the VIRTUAL machine, log in as root user with password 123456, and change the IP address of the Linux machine
vi /etc/sysconfig/network-scripts/ifcfg-ens33
Copy the code
IPADDR = 192.168.77.110 NETMASK = 24 DNS1 255.255.255.0 PREFIX = = 8.8.8.8Copy the code
-
Follow the steps above to clone the third machine and set the IP address of the third machine to
192.168.77.120
-
Suggestion: After the three machines are ready, make a snapshot for easy recovery after errors
-
For example, perform the following operations to create a snapshot for Centos7.6_001
10. Summary
-
The three Linux VMS running on the MAC are created.
-
Next, the operations of building a Hadoop cluster and a ZooKeeper cluster on three VMS are the same as the operations of building a Cluster on three Linux VMS under Windows, which will not be described again
-
Reference: