Read Catalogue
- Order
- Check List
- Common Linux Commands
- Build the Environment
- Series Index
This article is copyright Mephisto and Blog Park is shared, welcome reprint, but must retain this paragraph statement, and give the original link, thank you for your cooperation.
The article is written by elder brother (Mephisto), Sourcelink
Order
In the previous step, we have prepared 4 virtual machines, namely h30,h31,h32,h33. where H30 for our Ambari server, H31 for Namenode server, h32,h33 for our Datanode server.
Next, we have to prepare the Linux environment for these virtual machines.
Check List
1. Network access
2. Firewall
3. Hosts
4. Vim
5. Yum
6. SSH
7. JDK
8. Time synchronization
Common Linux Commands
1. Enter the catalogue cd/etc
A slash is an absolute path, and if not, it goes to the subdirectory under the current directory.
2. Enumerate the directory structure Ls-al
3. View the contents of the file cat/etc/hosts
4. Modify a file vi/etc/hosts
Vim/etc/hosts
5. Restart reboot
6. Right to power Su root
Sudo
7. Start Service ntpd start
8. View service status Services NTPD status
9. Close Service NTPD Stop
10. Boot from Chkconfig ntpd on
11. Delete Files Rm/var/www/html/abc
12. Delete Folder Rm-rf/var/www/html/aa
13. SSH login ssh [email protected]
SSH h31
14, modify files, folder permissions chmod 700/VAR/WWW/HTML/AA
15. Copy file and rename cat id_rsa.pub >>authorized_keys
16. View Package Status Rpm-qa|grep SSH
17. Yum Installs yum install SSH
18. Copy files and folders to other machines scp/root/.ssh [email protected]:/root/.ssh/
19. Check the machine name hostname
20, check IP and other information ifconfig
Build the Environment
One: Using Xshell 4 Login h30-New Session Xshell is a powerful secure terminal emulation software that supports SSH1, SSH2, and the Telnet protocol of the Microsoft Windows platform. Two: Use Xshell 4 login h30-Connect session Three: Use Xshell 4 login h30-Enter password Remember login name, remember password (play with your own deployment, remember password very save time) Four: Modify the font size, encoding format and other shortcut bar, click the icon like the ball, select UTF-8 Click the letter icon on the shortcut bar, and change the font to 14. The word small too hurts the eye, according to oneself appropriate change. Five: Turn off the firewall
#关闭防火墙service iptables stop# Permanently shut down the firewall chkconfig iptables off# View firewall status service iptables status
Vi.: Close SELinux
/etc/selinux/config# Change State selinux=disabled
If you are unfamiliar with VI vim here, check the command on the Internet. I'll just do a brief introduction:
Vim divided into 3 modes, browse, edit, input commands
Shift+i or shift+o can enter edit mode, ESC can exit edit mode
In the browse mode input: Is can enter the command, for example: Q exit,: q! do not save exit,: Wq Save exit
Seven: Uninstall OpenJDK, install Sun's JDK (now called Oracle)
-qa| grep Java
#卸载openJDK
Rpm-e--nodeps file name
We can't check the installation here, so we can install the JDK directly.
/varmkdir -P www/html
Use xftp 4 to upload the downloaded JDK to H30, or click the Xshell xftp link.
/var/www/-IVH jdk-7u67-linux-x64.rpm
#查看版本
Java-version
Eight: Modify the hosts
This is to be changed in every system.
#编辑hosts /etc/hosts
Nine: SSH settings
Enter H30 to see if SSH is installed, and if so, continue without installation.
rpm-qa| grep SSH
Create the. SSH directory. Viewing the file, the first letter D is a directory, followed by permissions, such as the creator, the average person, we are interested in checking the Linux file permissions.
/root# create the. SSH directory mkdir . SSH #设置权限 chmod . SSH #检查 ls -al
Start creating SSH Keys
#创建, Rear 3 return Ssh-keygen -t RSA
Copy Id_rsa.pub to Authorized_keys
CD. SSH
Cat id_rsa.pub >> Authorized_keys
Copy ssh to h31-h34, login, found that you can not enter the password, even if the SSH settings successfully
SSH [email protected] #copy SCP /root/. ssh/authorized_keys [email protected]:/root/. ssh/#loginssh [email protected]
This period of content is more, divided into two parts.
Series Index
"Source" Self-Learning Hadoop series index from zero
This article is copyright Mephisto and Blog Park is shared, welcome reprint, but must retain this paragraph statement, and give the original link, thank you for your cooperation.
The article is written by elder brother (Mephisto), Sourcelink
"Source" self-learning Hadoop from zero: Linux preparation