記一次生產環境Hbase填坑之路、Hbase客戶端登陸、kerberos認證、端口列表、Pod上手撕代碼【Hbase最佳實踐】

背景

1、軟件系統(轉儲系統)需要向生產環境遷移:遷到國產操作系統、國產資源池(Hbase存儲不變)

2、老環境上的轉儲系統本身存在寫入hbase的性能問題、及部分省份寫入hbase失敗的問題(20%失敗)

3、全國31個省寫入數據量大

4、向國產環境遷移沒有成功,該工程(6年前的工程)作者之前從來沒有參與過

5、新的環境遷移涉及主機端口開通、及網絡端口打通等諸多事項

環境

?1、Oracle JDK8u202(Oracle JDK8最后一個非商業版本)? ?下載地址:Oracle JDK8u202

?2、Hbase 1.1.2.2.5 ?Apache HBase – Apache HBase Downloads(多年前的項目,所以其版本較舊, 該版本已歸檔:???Index of /dist/hbase?)

?3、Hadoop?2.7.1.2.5? Apache Hadoop?(該版本已歸檔: Central Repository: org/apache/hadoop/hadoop-common/2.7.1)

?4、Kerberos 1.10.3-10? ?MIT Kerberos Consortium? (該版本已歸檔:Historic MIT Kerberos Releases)

Hbase測試代碼

話不多說,先看代碼作者在POD上手撕的測試代碼,這是指登陸代碼(因為只要登陸成功就能解決所有問題):

主類

package com.asiainfo.crm.ai;import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.security.UserProvider;
import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;
import org.apache.hadoop.hbase.util.Strings;
import org.apache.hadoop.net.DNS;/***  export LIB_HOME=/app/tomcat/webapps/ROOT/WEB-INF/lib/javac -d ../classes -cp $LIB_HOME\*:. Transfer2Application.javajava -cp $LIB_HOME\*:. Transfer2Application*/
public class Transfer2Application
{public static void main(String[] args){try {System.out.println("##################  hello world! 1 ");//初始化Hbase信息initHbase();} catch (Exception e) {e.printStackTrace();}}/*** 系統啟動時初始化Hbase連接信息,包括kerberos認證** @throws Exception*/private static void initHbase() throws Exception{System.out.println("##################  hello world! initHbase  ");System.getProperties().setProperty("hadoop.home.dir", "/app/tomcat/temp/hbase");System.setProperty("java.security.krb5.conf", "/app/tomcat/krb5.conf");Configuration conf = HBaseConfiguration.create();conf.set("hbase.keytab.file", "/app/tomcat/gz**.app.keytab");conf.set("hbase.kerberos.principal", "gz***/gz**-***.dcs.com@DCS.COM");UserProvider userProvider = UserProvider.instantiate(conf);// login the server principal (if using secure Hadoop)if (userProvider.isHadoopSecurityEnabled() && userProvider.isHBaseSecurityEnabled()){String machineName = Strings.domainNamePointerToHostName(DNS.getDefaultHost(conf.get( "hbase.rest.dns.interface", "default"),conf.get( "hbase.rest.dns.nameserver", "default")));String keytabFilename = conf.get( "hbase.keytab.file" );Preconditions.checkArgument(keytabFilename != null && !keytabFilename.isEmpty(),"hbase.keytab.file"+ " should be set if security is enabled");String principalConfig = conf.get( "hbase.kerberos.principal" );Preconditions.checkArgument(principalConfig != null && !principalConfig.isEmpty(),"hbase.kerberos.principal" + " should be set if security is enabled");userProvider.login( "hbase.keytab.file" , "hbase.kerberos.principal", machineName);System.out.println("########## login success! #######");}else{System.out.println("不具備登陸條件!");System.out.println("userProvider.isHadoopSecurityEnabled() :"+userProvider.isHadoopSecurityEnabled() );System.out.println("userProvider.isHBaseSecurityEnabled():"+userProvider.isHBaseSecurityEnabled());}}
}

POD上手撕代碼的幾條重要命令

# 應用pod上 lib目錄路徑,用于設置java classpath
export LIB_HOME=/app/tomcat/webapps/ROOT/WEB-INF/lib/
# 進入src目錄并創建主類源文件
cd src
# 編譯主類,并將lib目錄下所有jar加入到classpath中
javac -d ../classes -cp $LIB_HOME\*:. Transfer2Application.java
# 進入classes目錄
cd ../classes
# 運行二進制文件
java -cp $LIB_HOME\*:. Transfer2Application

運行成功效果日志(基于shell)

##################  hello world! 1 
##################  hello world! initHbase  
14:23:01.194 [main] DEBUG org.apache.hadoop.util.Shell - setsid exited with exit code 0
14:23:01.207 [main] DEBUG org.apache.hadoop.security.Groups -  Creating new Groups object
14:23:01.234 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Trying to load the custom-built native-hadoop library...
14:23:01.235 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path
14:23:01.235 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
14:23:01.235 [main] WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
14:23:01.235 [main] DEBUG org.apache.hadoop.util.PerformanceAdvisory - Falling back to shell based
14:23:01.235 [main] DEBUG org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback - Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping
14:23:01.285 [main] DEBUG org.apache.hadoop.security.Groups - Group mapping impl=org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback; cacheTimeout=300000; warningDeltaMs=5000
14:23:01.338 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginSuccess with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of successful kerberos logins and latency (milliseconds)])
14:23:01.345 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginFailure with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of failed kerberos logins and latency (milliseconds)])
14:23:01.345 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.getGroups with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[GetGroups])
14:23:01.346 [main] DEBUG org.apache.hadoop.metrics2.impl.MetricsSystemImpl - UgiMetrics, User and group related metrics
14:23:01.556 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - hadoop login
14:23:01.557 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - hadoop login commit
14:23:01.558 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - using kerberos user:gz***/gz***-ctdfs01.dcs.com@DCS.COM
14:23:01.558 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - Using user: "gz***/gz***-ctdfs01.dcs.com@DCS.COM" with name gz***/gz***-ctdfs01.dcs.com@DCS.COM
14:23:01.558 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - User entry: "gz***/gz***-ctdfs01.dcs.com@DCS.COM"
14:23:01.558 [main] INFO org.apache.hadoop.security.UserGroupInformation - Login successful for user gz***/gz***-ctdfs01.dcs.com@DCS.COM using keytab file /app/tomcat/gz***.app.keytab
########## login success! #######

運行成功效果日志(基于動態庫)

sh-4.2# java -cp $LIB_HOME\*:. Transfer2Application
##################  hello world! 1 
##################  hello world! initHbase  
17:46:05.469 [main] DEBUG org.apache.hadoop.util.Shell - setsid exited with exit code 0
17:46:05.481 [main] DEBUG org.apache.hadoop.security.Groups -  Creating new Groups object
17:46:05.504 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Trying to load the custom-built native-hadoop library...
17:46:05.504 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Loaded the native-hadoop library
17:46:05.504 [main] DEBUG org.apache.hadoop.security.JniBasedUnixGroupsMapping - Using JniBasedUnixGroupsMapping for Group resolution
17:46:05.505 [main] DEBUG org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback - Group mapping impl=org.apache.hadoop.security.JniBasedUnixGroupsMapping
17:46:05.553 [main] DEBUG org.apache.hadoop.security.Groups - Group mapping impl=org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback; cacheTimeout=300000; warningDeltaMs=5000
17:46:05.604 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginSuccess with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of successful kerberos logins and latency (milliseconds)])
17:46:05.611 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginFailure with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of failed kerberos logins and latency (milliseconds)])
17:46:05.611 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.getGroups with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[GetGroups])
17:46:05.612 [main] DEBUG org.apache.hadoop.metrics2.impl.MetricsSystemImpl - UgiMetrics, User and group related metrics
17:46:05.818 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - hadoop login
17:46:05.819 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - hadoop login commit
17:46:05.820 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - using kerberos user:gzcrm/gzcrm-ctdfs01.dcs.com@DCS.COM
17:46:05.820 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - Using user: "gzcrm/gzcrm-ctdfs01.dcs.com@DCS.COM" with name gzcrm/gzcrm-ctdfs01.dcs.com@DCS.COM
17:46:05.820 [main] DEBUG org.apache.hadoop.security.UserGroupInformation - User entry: "gzcrm/gzcrm-ctdfs01.dcs.com@DCS.COM"
17:46:05.821 [main] INFO org.apache.hadoop.security.UserGroupInformation - Login successful for user gzcrm/gzcrm-ctdfs01.dcs.com@DCS.COM using keytab file /app/tomcat/gzcrm.app.keytab
########## login success! #######

說明:

? ? 基于動態庫的方式操作hbase會得到更好的性能效果。

常見問題(FAQ):

Q1:運行時報?Kerberos krb5 configuration not found


18:39:46.030 [main] DEBUG org.apache.hadoop.util.Shell - setsid exited with exit code 0
18:39:46.041 [main] DEBUG org.apache.hadoop.security.Groups -  Creating new Groups object
18:39:46.058 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Trying to load the custom-built native-hadoop library...
18:39:46.059 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path
18:39:46.059 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
18:39:46.059 [main] WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18:39:46.059 [main] DEBUG org.apache.hadoop.util.PerformanceAdvisory - Falling back to shell based
18:39:46.059 [main] DEBUG org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback - Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping
18:39:46.113 [main] DEBUG org.apache.hadoop.security.Groups - Group mapping impl=org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback; cacheTimeout=300000; warningDeltaMs=5000
18:39:46.166 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginSuccess with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of successful kerberos logins and latency (milliseconds)])
18:39:46.172 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginFailure with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of failed kerberos logins and latency (milliseconds)])
18:39:46.172 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.getGroups with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[GetGroups])
18:39:46.173 [main] DEBUG org.apache.hadoop.metrics2.impl.MetricsSystemImpl - UgiMetrics, User and group related metrics
18:39:46.219 [main] DEBUG org.apache.hadoop.security.authentication.util.KerberosName - Kerberos krb5 configuration not found, setting default realm to empty
java.lang.IllegalArgumentException: Can't get Kerberos realmat org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:65)at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:277)at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:262)at org.apache.hadoop.security.UserGroupInformation.isAuthenticationMethodEnabled(UserGroupInformation.java:339)at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:333)at org.apache.hadoop.hbase.security.User$SecureHadoopUser.isSecurityEnabled(User.java:428)at org.apache.hadoop.hbase.security.User.isSecurityEnabled(User.java:268)at org.apache.hadoop.hbase.security.UserProvider.isHadoopSecurityEnabled(UserProvider.java:159)at Transfer2Application.initHbase(Transfer2Application.java:44)at Transfer2Application.main(Transfer2Application.java:22)
Caused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.hadoop.security.authentication.util.KerberosUtil.getDefaultRealm(KerberosUtil.java:84)at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:63)... 9 more
Caused by: KrbException: Cannot locate default realmat sun.security.krb5.Config.getDefaultRealm(Config.java:1029)... 15 more

Q2:運行時報hbase.keytab.file should be set if security is enabled

18:41:21.911 [main] DEBUG org.apache.hadoop.util.Shell - setsid exited with exit code 0
18:41:21.922 [main] DEBUG org.apache.hadoop.security.Groups -  Creating new Groups object
18:41:21.945 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Trying to load the custom-built native-hadoop library...
18:41:21.945 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path
18:41:21.945 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
18:41:21.946 [main] WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18:41:21.946 [main] DEBUG org.apache.hadoop.util.PerformanceAdvisory - Falling back to shell based
18:41:21.946 [main] DEBUG org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback - Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping
18:41:21.995 [main] DEBUG org.apache.hadoop.security.Groups - Group mapping impl=org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback; cacheTimeout=300000; warningDeltaMs=5000
18:41:22.046 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginSuccess with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of successful kerberos logins and latency (milliseconds)])
18:41:22.052 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginFailure with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[Rate of failed kerberos logins and latency (milliseconds)])
18:41:22.053 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.getGroups with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, valueName=Time, value=[GetGroups])
18:41:22.053 [main] DEBUG org.apache.hadoop.metrics2.impl.MetricsSystemImpl - UgiMetrics, User and group related metrics
java.lang.IllegalArgumentException: hbase.keytab.file should be set if security is enabledat org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)at Transfer2Application.initHbase(Transfer2Application.java:53)at Transfer2Application.main(Transfer2Application.java:22):22)

A:沒有正確設置hbase.keytab.file

conf.set("hbase.keytab.file", "/app/tomcat/gzcrm.app.keytab");

Q3:運行時報Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path

18:39:46.041 [main] DEBUG org.apache.hadoop.security.Groups -  Creating new Groups object
18:39:46.058 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Trying to load the custom-built native-hadoop library...
18:39:46.059 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path
18:39:46.059 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
18:39:46.059 [main] WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18:39:46.059 [main] DEBUG org.apache.hadoop.util.PerformanceAdvisory - Falling back to shell based

A:沒有成功加載hadoop動態庫。從官方下載動態庫并拷貝到動態庫路徑中即可。官方動態庫下載地址:https://archive.apache.org/dist/hadoop/common/hadoop-2.7.1/hadoop-2.7.1.tar.gz

動態庫文件路徑:hadoop-2.7.1/lib/native

把這個目錄所有文件拷貝到:/usr/lib 目錄下 ,其為日志中提示的java.library.path的目錄之一
注意:

? ? ?默認拷貝到lib下的文件不包含可直接使用的動態庫(不會被加載),原因是默認是的文件鏈接,拷貝進去就丟失了。需要重新創建文件鏈接、或做二次拷貝、或是重命名

sh-4.2# ls -lh /usr/lib|grep hadoop
-rwxrwxrwx 1 root root 1.4M Aug 24 14:22 libhadoop.a
-rwxrwxrwx 1 root root 1.6M Aug 24 14:22 libhadooppipes.a
-rwxrwxrwx 1 root root 790K Aug 24 14:22 libhadoop.so.1.0.0
-rwxrwxrwx 1 root root 466K Aug 24 14:22 libhadooputils.a
sh-4.2# 
sh-4.2# 
sh-4.2# cd /usr/lib
sh-4.2# cp libhadoop.so.1.0.0 libhadoop.so
sh-4.2# cp libhdfs.so.0.0.0 libhdfs.so
sh-4.2# 
sh-4.2# ls -lh /usr/lib|grep hadoop
-rwxrwxrwx 1 root root 1.4M Aug 24 14:22 libhadoop.a
-rwxrwxrwx 1 root root 1.6M Aug 24 14:22 libhadooppipes.a
-rwxr-xr-x 1 root root 790K Aug 24 17:44 libhadoop.so
-rwxrwxrwx 1 root root 790K Aug 24 14:22 libhadoop.so.1.0.0
-rwxrwxrwx 1 root root 466K Aug 24 14:22 libhadooputils.a
sh-4.2# 
sh-4.2# 
sh-4.2# ls -lh /usr/lib|grep hdfs
-rwxrwxrwx 1 root root 437K Aug 24 14:22 libhdfs.a
-rwxr-xr-x 1 root root 276K Aug 24 17:45 libhdfs.so
-rwxrwxrwx 1 root root 276K Aug 24 14:22 libhdfs.so.0.0.0

本地查看:

hadoop-2.7.1

hadoop-2.10.2

Q4:運行時報各種網絡不通,包括不能訪問kerberos服務

A:打通網絡端口,開通hbase服務端主機端口,清單如下(實際大家的端口號可能不一致,但都有):

端口號客戶端是否必需打通該端口端口說明
8090資源管理頁面端口
50470https節點訪問端口
8485共享目錄端口
8020rpc端口
50070節點http訪問端口(需要打通)
2181zookeeper服務端口(需要打通)
8088RM資源管理器http端口
16000master服務端口
3888主zookeeper端口
16010master 信息端口
13562mapreduce分片服務端口
2049nfs文件系統訪問端口
16100多播端口
8080服務rest端口
16020RS區域服務端口
21ftp端口
4242nfs掛載端口
88KDC通信端口
80Kerberos服務端口
749這是一個可選的端口,主要用于Kerberos的TCP服
800這些端口用于Kerberos的KDC之間的通信,特別是在設置了跨多個KDC的環境時
801這些端口用于Kerberos的KDC之間的通信,特別是在設置了跨多個KDC的環境時
464這是Kpasswd服務的端口,用于更改Kerberos用戶的密碼。
750一些實現可能使用這個端口來支持Kpasswd服務的額外功能。
636如果Kerberos配置為使用LDAP over SSL(LDAPS),則LDAPS服務通常運行在這個端口上。雖然這不是Kerberos原生的一部分,但它常被用于管理Kerberos用戶賬戶和策略。
9090Thrift接口端口,支持非Java客戶端訪問HBase
60020RegionServer工作節點端口,處理客戶端讀寫請求
2888集群內機器通訊使用,Leader監聽此端口

附件一:批量驗證網絡端口連通性的腳本

Linux shell 批量驗證網絡主機端口連通性_linux shell批量測試ip連通性-CSDN博客

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/920064.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/920064.shtml
英文地址,請注明出處:http://en.pswp.cn/news/920064.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

C++知識雜項搜集

C使用如下庫優化事件的注冊和發布,ZeroMQzmqpp 通信機制,請求-應帶方式,push-pull方式,publisher-subcriber發布-訂閱模式eventpp 事件注冊和回調sockpp tcp/udp封裝threadpool 線程池Jinja 一個 python 的模板實現配置是實現…

連鎖零售排班難?自動排班系統來解決

零售、連鎖企業門店多、員工雜、班次密,排班時總有繞不開的問題:跨門店調人成本怎么算?節假日高峰期人手怎么補?全職兼職混合排班怎么平衡?其實,這些場景化難題,蓋雅自動排班系統早就有了針對性…

Android用Coil 3檢查媒體資源是否有效,Kotlin

Android用Coil 3檢查媒體資源是否有效,Kotlin WorkerThreadfun checkImage(ctx: Context, uri: Uri): Boolean {val t System.currentTimeMillis()val request ImageRequest.Builder(ctx).data(uri).memoryCacheKey(uri.toString()).precision(Precision.INEXACT)…

Seaborn數據可視化實戰:Seaborn數據可視化入門-繪制統計圖表與數據分析

使用Seaborn繪制統計圖表:從入門到精通 學習目標 通過本課程的學習,你將掌握如何使用Seaborn庫繪制各種統計圖表,包括直方圖、密度圖和箱形圖。你將了解這些圖表在數據分析中的應用,以及如何通過圖表來更好地理解數據。 相關知識點…

?Mac用戶安裝JDK 22完整流程(Intel版dmg文件安裝指南附安裝包下載)?

一、準備工作 ?確認你的 Mac 是 Intel 芯片的? 如果你的 Mac 是 2020 年及之前出的,大概率是 Intel 芯片,可以用這個 ?jdk-22_macos-x64_bin.dmg。如果是 2020 年之后出的 M1 或 M2 芯片的 Mac(就是 Apple 芯片),那…

C語言——鏈表指定區間反轉

目錄 1.創建一個鏈表 1.鏈表節點定義 2.創建新節點 3.鏈表生成(輸入) 4.鏈表輸出 2.鏈表指定區間反轉函數 1.創建啞節點 2.找到第m-1位的節點,開始 反轉 3.連接反轉后的鏈表與未反轉的鏈表 3.未使用啞節點的運行結果 這段代碼可以…

設計一個完整可用的 Spring Boot Starter

目錄 1. 創建項目結構 2. 添加核心依賴 (pom.xml) 3. 實現核心組件 (1) 配置屬性類 (2) 服務實現類 (3) 自動配置類 4. 注冊自動配置 5. 配置元數據支持 6. 打包發布 7. 其他項目引用 (1) 添加依賴 (2) 配置參數 (3) 使用服務 設計要點 要設計一個完整可用的 Spr…

Bright Data 代理 + MCP :解決 Google 搜索反爬的完整方案

個人主頁:chian-ocean 專欄 引言 人工智能技術和大數據的發展,實時訪問網頁數據成為許多應用的核心需求。相比傳統方案依賴靜態或定期更新的數據,AI可以實時抓取和分析網頁上的及時更新的信息,迅速適應變化的環境,提…

Java基礎第4天總結(多態)

package com.itheima.duotai;public class Animal {String name "動物";public void run(){System.out.println("動物會跑~~~");} }package com.itheima.duotai;public class Wolf extends Animal{String nama "狼";Overridepublic void run(…

Git克隆時遇到“Filename too long“錯誤的完美解決方案

Git克隆時遇到"Filename too long"錯誤的完美解決方案 問題描述 在使用Git克隆項目時,你是否遇到過這樣的錯誤: $ git clone gitexample.com:project.git Cloning into project... remote: Enumerating objects: 1883, done. remote: Count…

分享一個基于Python與spark大數據的護膚品市場用戶行為分析與可視化平臺,基于hadoop的護膚品使用行為追蹤與分析可視化平臺的設計與實現

💕💕作者:計算機源碼社 💕💕個人簡介:本人八年開發經驗,擅長Java、Python、PHP、.NET、Node.js、Spark、hadoop、Android、微信小程序、爬蟲、大數據、機器學習等,大家有這一塊的問題…

頁面中嵌入Coze的Chat SDK

Coze 為將 AI 聊天機器人(Bot)嵌入您的網頁提供了兩種主流方式:Web SDK 和 API 接口調用。它們分別適用于不同的場景,下面我將為您介紹這兩種方法,并提供一些選擇建議。 特性 Web SDK API 接口調用 實現方式 引入一段JS代碼,快速嵌入一個預制的聊天窗口 通過HTTP API發送…

DataEase+MaxKB:讓BI再多個“A”

一、前言當前DataEase BI更多聚焦于BI展示層,然而,在與組件Copilot 以及后續計劃替換的 Sqlbot的融合方面,目前仍存在一些亟待解決的問題,當它們嘗試與 DataEase 進行結合應用時,出現了兩種較為突出的狀況。一方面&…

VUE 的彈出框實現圖片預覽和視頻預覽

這是一個基于Vue3封裝的媒體預覽組件,主要功能包括:多格式支持:可同時預覽圖片和視頻圖片操作功能:縮放(支持滾輪縮放和按鈕控制)旋轉(90度增量旋轉)拖拽(僅在放大狀態下…

【Linux基礎知識系列】第一百零九篇 - 使用shell的輸入與輸出重定向

在 Linux 系統中,Shell 是用戶與操作系統交互的界面,通過命令行輸入命令來執行各種操作。輸入與輸出重定向是 Shell 編程中非常重要的概念,它允許用戶將命令的輸出保存到文件中,或者從文件中讀取輸入,從而實現更靈活的…

Redis面試精講 Day 30:Redis面試真題解析與答題技巧

【Redis面試精講 Day 30】Redis面試真題解析與答題技巧 在“Redis面試精講”系列的第30天,我們迎來收官之作——Redis面試真題解析與答題技巧。這一天的核心目標是:幫助你系統化梳理前29天所學知識,掌握高頻面試題的解題思路,提升…

設計模式:單例模式(Singleton Pattern)

文章目錄一、單例模式的概念二、單例模式的結構三、常見實現方式3.1 餓漢式單例3.2 懶漢式單例一、單例模式的概念 單例模式(Singleton Pattern)是一種創建型設計模式,它的核心思想是:保證在一個進程中,某個類僅有一個…

Swift 解法詳解 LeetCode 362:敲擊計數器,讓數據統計更高效

文章目錄 摘要 描述 題解答案 題解代碼分析 代碼講解 示例測試及結果 時間復雜度 空間復雜度 總結 摘要 “敲擊計數器”這道題聽上去像個小游戲里的功能,但其實它背后對應的是一個常見的需求:在過去一段時間內統計事件發生的次數。比如網站的訪問量統計、API 調用次數限制、…

coze工作流200+源碼,涵蓋AI文案生成、圖像處理、視頻生成、自動化腳本等多個領域

AI 博主風哥在github分享了 200 實用生產力coze工作流,涵蓋AI文案生成、圖像處理、視頻生成、自動化腳本等多個領域,導入即用,項目地址https://github.com/Hammer1/cozeworkflows github下載慢也可前往該地址下載https://pan.baidu.com/s/1fC…

AI與SEO關鍵詞協同優化

內容概要 人工智能(AI)技術的迅猛發展正深刻變革著搜索引擎優化(SEO)的實踐方式,特別是在關鍵詞策略這一核心領域。兩者的深度融合,為企業在數字海洋中精準導航提供了前所未有的強大工具。通過AI驅動的智能…