Article Directory
Preface
This article mainly records the preparation of the big data environment and the construction of hadoop and zookeeper clusters. The server is not short of money and can directly buy Alibaba Cloud's ecs. Here we use the VmWare virtual machine as an example.
Tip: The following is the content of this article, the following cases are for reference
1. Installation of three linux servers
1. Install VmWare
-
VMWare virtual machine software is a "virtual PC " software, which allows you to run two or more Windows , DOS , LINUX systems on one machine at the same time . Compared with the "multi-start" system, VMWare uses a completely different concept.
-
We can install our linux virtual machine through Vmware, and then install the cluster through the linux virtual machine. After double-clicking the installation of Vmware, we can go all the way to the next step. Try not to install it on the operating system disk. The Vmware installation steps are omitted. .
2. Install the first linux machine through Vmware
- We can install our first linux machine through Vmware. Next, let’s see how to create a linux virtual machine through VMWare and mount the operating system to our virtual machine.
1: Double-click Vmware to open, click to create a new virtual machine
2: Choose a custom installation configuration
3: Choose to install the operating system later
5: Choose the installation path,Try not to put it on the C drive, and the remaining space of the drive letter should be as large as possible
6: The number of CPU cores, the default is
7: The virtual machine memory can be adjusted according to its own windows computer.
For example, if windows is 8GB memory, then each virtual machine memory is given 2048M memory, if windows is 16GB memory, then each virtual machine can give 4096M memory is enough (16G is strongly recommended, and it is easy to hang when you don’t interface with a large amount of data)
8: The network configuration must be selectedNAT
9: The disk size should be 40GB or above as much as possible.
Note: Ten millionDon'tCheck "Allocate all disk space immediately"
10: Finish
3. Mount the operating system for the linux virtual machine we created
- We now have a virtual computer, just like we just bought a computer back, but the difference is that our virtual computer does not yet have an operating system. We need to hang on the operating system for this computer.
1: Pass Set up to mount the operating system. You
need to download the 64-bit Centos7 operating system yourself.
2: Just press Enter to start the installation
3: Set the keyboard to English keyboard
4: Next configure these three items
(1) Set the time zone to Asia/Shanghai
(2) Setting ②INSTALATION DESTINATION
(3) Setting ③NETWORK & HOST NAME
5: Set the root user password
6: After the installation is complete, restart the reboot and the process will take a little longer, wait patiently
4. Set up the network configuration for our linux virtual machine
- Our linux virtual machine has been created and mounted with the operating system. Next, we can set the network address for our first virtual machine. Setting the network address is more troublesome.
1: Set the network segment of the virtual machine
2: ViewNAT modeGateway, subnet IP and subnet mask
3: set the VMNet8 network address in the window
4: set the network in linux
-
We have configured the network in Vmware and the network in windows;
-
The rest is to configure the network in the linux virtual machine. After configuring the network in linux, our linux can be used online
-
Log in to linux
Edit configuration file
vi /etc/sysconfig/network-scripts/ifcfg-ens33
Add the four elements of networking
IPADDR=192.168.52.100
NETMASK=255.255.255.0
GATEWAY=192.168.52.1
DNS1=8.8.8.8
For details, please refer to the figure below. After
changing the configuration, restart the network service
systemctl restart network
Install some commonly used software
yum -y install vim
yum -y install net-tools
Shut down
init 0
5. Clone the first machine
-
Now that we have a seed machine, we can use the seed machine to copy or clone three machines
-
Shut down the linux seed machine and prepare to clone
Choose to create a full clone
6. Change the IP address of the cloned machine
-
The ip addresses of the three machines are
192.168.52.100、192.168.52.110、192.168.52.120
-
The IP address of the cloned machine is the same as the IP address of the seed, we can change the IP address of the second machine to 192.168.52.110
-
Start the virtual machine and log in through the root user with a password of 123456, and then change the IP address of the linux machine
vi /etc/sysconfig/network-scripts/ifcfg-ens33
IPADDR=192.168.52.110
NETMASK=255.255.255.0
GATEWAY=192.168.52.1
DNS1=8.8.8.8
- Follow the steps above, then clone the third machine and set the IP address of the third machine to
192.168.52.120
Suggestion: After the three machines are ready, take a snapshot for easy recovery after errors
to sum up
Tip: At this point, the big data server environment is all ready, and then you can start to build a 3-node hadoop and zookeeper cluster.