当前位置:网站首页>Canal configuration 01
Canal configuration 01
2022-07-23 09:35:00 【Cynhard_ Cheung】
1.Linux Create users and user groups
There is only one default root The super user , Its authority is great , If you delete a file by mistake , The use of the whole system may be
There will be problems , There is a big security problem , therefore , We need to create users separately , Then on this user
Related operations .( There may be a problem , Some operation permissions are insufficient , Just configure sudo Permission or switch to root
Just execute it under the user )
Create user group :groupadd hadoop
Create user :useradd hadoop –g hadoop
establish hadoop After user ,hadoop By default, the user's directory is home Under the table of contents .
Be careful : By default, a user group with the same name will be created when creating users .
2. Set user password
For example hadoop User set password :passwd hadoop, Then press enter to enter the password twice ,”password
–help” Check the command usage .
3 Set user sudo jurisdiction
When users execute some system commands, there will be insufficient user permissions , Need to switch to root Execute under the user , frequency
Complicated switching will be troublesome , And it can easily lead to permission problems . So it's best to configure for users sudo jurisdiction . be-all
All operations can be operated under this user , In case of insufficient permissions, you only need to add sudo that will do .
by hadoop User Settings sudo jurisdiction ,
stay root User input visudo, Add at the end of the file hadoop ALL=(ALL) NOPASSWD:ALL You can verify sudo Whether the permission is configured successfully
If in hadoop Use by user sudo visudo Successful operation , explain sudo Permission configuration succeeded .
4. View host name
You can see the hostname directly from the command prompt .
adopt hostname The command can also display the hostname .
5 Modify hostname
Temporary modification
Carry out orders hostname [ Host name ]( Hostname to be modified )
Be careful : The method of temporary modification will not take effect when the virtual machine is restarted , And it will not change the main... In the command prompt
The name of the plane , So it is a temporary modification .
Permanent modification
Enter the command vi /etc/sysconfig/network, Then modify it in this file .
Be careful : The host name will not show the change immediately after modification , Need to enter reboot Command restart linux operating system .
6. View firewall status
adopt service iptables status command , View firewall status .
When the following information appears, it indicates that the firewall is on .
7 Turn off firewall
Temporary closure
Input service iptables stop command , Turn off firewall temporarily .
Be careful : The effect of temporarily closing the firewall is the same as that of temporarily modifying the hostname , When restarting linux After virtual machine
It doesn't work .
Permanent closure
Input chkconfig iptables off command , Permanently shut down firewall .
Be careful : After permanently closing the firewall , Reboot required linux operating system , The input reboot Orders take effect .
8.openssh-clients service
You need this service to log in without password .
Enter the command :yum install -y openssh-clients, You can install openssh-clients service
9. Host name and IP mapping
Generally, virtual machines cannot be accessed through host names , Need to pass through IP Address can access the virtual machine . however IP
The address is not easy to remember , At this time, you can configure the host name and IP Address mapping , Thus, the host name can be used to
Access virtual machine .
Through the command :vi /etc/hosts You can modify the host name and IP The mapping relation of .
IPv4: It's the Internet protocol (Internet Protocol,IP) The fourth edition , It was the first to be widely used , Constitute the present
The basic protocol of Internet technology .
IPv6: yes Internet Protocol Version 6 Abbreviation .IPv6 yes IETF( Internet Engineering Task Force ,Internet
Engineering Task Force) Designed to replace the current version IP agreement (IPv4) The next generation of IP agreement , Claimed to be
Make a website for every grain of sand in the world .
IPv4 And IPv6 difference :
IPv4: Address length :32 position , Number of addresses :2^32( about 4×10^9)
IPv6: Address length :128 position , Number of addresses :2^128( about 3.4×10^38)
# The Internet IP Address Corresponding host name Host name . domain name Hostname alias Hostname alias . domain name
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 Want to be IPv6 Of locahost Corresponding IP Address , Be similar to IPv4 Of 127.0.0.1
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.SSH Password free login ( Each machine here only trusts itself )
SSH Is a protocol that can provide secure communication in applications , adopt SSH Network data can be carried out safely
transmission , Its main principle is to use asymmetric encryption system , Encrypt all data to be transmitted , Make sure the data is in
Transmission will not be maliciously damaged 、 Divulge or tamper .
however hadoop Use ssh It is not mainly used for data transmission ,hadoop Mainly when starting and stopping
You want the master node to pass SSH The protocol will start or stop from the process on the node . That is, if you do not configure SSH Password free
Login pair hadoop The normal use of has no impact , Just start and stop hadoop You need to input every
The password of the user name of the slave node is ok , But we can imagine , When the cluster scale is large , Than
As many as a hundred , If you have to enter the password of each slave node every time , That must be more troublesome , So this method must
Is not desirable , So we're going to do SSH Password free configuration , And at present, the most commonly used in remote management environment is
SSH(Secure Shell).
Identify target users
First of all, it is necessary to make clear for which user to create password free login , For example, we do it for hadoop The user to create SSH Password free login .
stay hadoop Under the user , Switch to hadoop User's home directory ( namely /home/hadoop Catalog ).
Generate secret key
Enter the command :ssh-keygen -t rsa Generate secret key , Then press enter all the time .ssh-keygen yes ssh Secret key generator ,
-t Is the specified parameter ,rsa It's an encryption algorithm .
Generate authentication file
Switch to .ssh Under the table of contents : Input cd /home/hadoop/.ssh, Then input “ll” Command view , Found a public key ,
There is a private key ,(ssh The generated secret key pairs are stored in .ssh In this directory )
Enter the command :cp id_rsa.pub authorized_keys, Public key copy To the certification document .
by .ssh To give permission
Return to hadoop Home directory , by .ssh To give permission
# Expressed as .ssh Catalog assignment 700 Authority
chmod 700 .ssh
# Expressed as .ssh All files in the directory are assigned 600 Authority
chmod 600 .ssh/*
Be careful :700、600 What do you mean ? Such as file permissions "-rw-------" The first “
-” Indicates that the document is in common
Pieces of , Next 9 Characters 3 One for a group , The first group represents the user's reading 、 Write 、 Executive authority , The second group represents users
Group , The third group represents other users . Reading of files 、 Write and execute permissions , The corresponding letters are W/r/x Corresponding number
The words are 4/2/1, that 700 It means that the user has read 、 Write 、 Executive authority (7=4+2+1), User groups and others use
The user has no authority .( In fact, the two steps of granting permission can also be omitted )
ssh verification
use ssh Sign in hadoop01, The first time you log in, you need to enter yes, After the second time, there is no need to enter the password , If we can achieve
This effect means SSH Password free login setting succeeded , When logging in ssh hadoop01 This command .
11.FileZilla Tool use
FileZilla It's a free and open source FTP Software , You can easily upload and download files .
边栏推荐
- 复盘:一副牌(54张),三人斗地主,大小王在同一家的概率是多少
- 微信小程序设置背景图片不显示问题解决方法
- Tidb 3.0安装
- Judge whether the two types are the same
- pytorch简单示例汇总
- Déterminer s'il s'agit d'un type vide
- Selenium.webdriver gets the result and converts it to JSON format
- 肽核酸(PNA)偶联穿膜肽(CCPs)(KFF)3K形成CCPs-PNA|肽核酸的使用方法
- C#之winform窗体的最大化、最小化、还原、关闭以及窗体的移动
- Read-committed has no interval lock
猜你喜欢
随机推荐
MATLAB之优劣解距离法Topsis模型
C language classic exercise (1) - "daffodil number"“
Repeatable-read RR mode interval lock
不同类型的字段、集合list/set/map、对象如何判空null
购买股票开户安全吗,会亏钱吗?
Emmet 语法简结
Easyv semi annual ranking of "popular content on official websites"
EasyV半年度“官方网站热门内容”排行榜盘点
申请炒股账户在手机开户安全吗?
READ-COMMITTED没有区间锁
Solve the greatest common divisor and the least common multiple
Server memory performance tuning
1059 Prime Factors
xmpp 服务研究(一)
BGP機房的優點
pytorch简单示例汇总
从零开始的C
canal 第五篇
[MySQL from introduction to proficiency] [advanced chapter] (VII) design an index scheme in index & InnoDB
肽核酸PNA-多肽suc-Ala-Ala-Pro-Aaa-pNa|Suc-Ala3-pNA|Pyr-Phe-Leu-pNA
![[LeetCode]剑指 Offer 61. 扑克牌中的顺子](/img/ca/1756f1c33cf9b18d0c88d46bac636e.png)







