Prepare three computers for the big data environment (using virtual machines)
CPU name | Ip address | root account password | Remarks |
---|---|---|---|
node1 | 192.168.72.11 | 12345678 | Focus on configuring this one first |
node2 | 192.168.72.12 | 12345678 | After node1 is configured, clone it out |
node3 | 192.168.72.13 | 12345678 | After node1 is configured, clone it out |
1. Configuration information
node1 example
2. Configure root account login without password (optional)
Use passwordless login ssh node1 successfully. Easy for us to log in
3. Bind ip and hostname
Modify the file /etc/hosts (vi /etc/hosts) into the following associations
192.168.72.11 node1
192.168.72.12 node2
192.168.72.13 node3
4. The firewall is turned off-don't do this in the production environment, it is very insecure
Off: systemctl stop firewalld.service
does not start after booting: systemctl disable firewalld.service
5. Turn off write security check
Modify the file /etc/selinux/config (vi /etc/selinux/config)
and change the SELINUX attributes of these files to the following value: SELINUX=disabled
6. Create groups and users
Create a group, the group name is hadoop: groupadd hadoop
Create a user and join the hadoop group: useradd -g hadoop hduser
modify hduser password: passwd hduser
set password: 1234567
Note: When the password is too simple, there will be related security tips, you can ignore it , After entering twice, the password is successfully changed
7. Set permissions for users
Attach root level permissions to hduser users
1. Modify the file to be in a modifiable state chmod 777 /etc/sudoers
2. Execute file modification vi /etc/sudoers
Tip: In the vi command state, enter /root to quickly locate here.
3. Restore file state (must restore read-only state) chmod 440 /etc/sudoers
4. Reboot the system under restart
8. Auxiliary-use of ntp time synchronization component (optional)
Software installation:
installation: sudo yum install ntp ntpdate -y
start: sudo systemctl start ntpd
self-start: sudo systemctl enable ntpd
setting:
adopt master-slave mode.
We make node1 the master. node2, node3 is used as
the configuration from 8.1, node1 (master)
sudo vi /etc/ntp.conf
set your own ip as the host: 192.168.72.11
set the ip range of the client you accept: 192.168.72.0
8.2. The configuration of node2 and node3 (from)
sudo vi /etc/ntp.conf
set the time server host ip 192.168.72.11
8.3. Update time
All nodes start time synchronization sudo timedatectl set-ntp yes
manual-update the time immediately sudo ntpdate -u Time server example: sudo ntpdate -u 192.168.72.11
9. Auxiliary-common commands
title | command | Remarks |
---|---|---|
Restart command | reboot | |
Shut down using command | shutdown | |
Modify hostname | hostnamectl set-hostname the new hostname | |
Query ip related | ip addr | |
View firewall commands | firewall-cmd --state |