运行# bin/hbase-daemon.sh start zookeeper报错
java.io.IOException: Could not find my address: VM_0_3_centos in list of ZooKeeper quorum servers
at org.apache.hadoop.hbase.zookeeper.HQuorumPeer.writeMyID(HQuorumPeer.java:149)
at org.apache.hadoop.hbase.zookeeper.HQuorumPeer.main(HQuorumPeer.java:70)
hbase-site.xml需要配置
<property>
<name>hbase.zookeeper.quorum</name>
<value>VM_0_3_centos</value>
</property>
运行# bin/hbase-daemon.sh start master报错
org.apache.hadoop.ipc.RemoteException(java.io.IOException):
File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).
There are 0 datanode(s) running and no node(s) are excluded in this operation.
查看jps是有DataNode运行的
http://111.229.129.100:50070 里却没有datanode在运行
就是多次格式化namenode造成的,需要删除data里面的数据再重新format
运行创建表语句后报错
---------------创建表 START-----------------
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 3,4 replyHeader:: 3,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 4,8 replyHeader:: 4,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 5,4 replyHeader:: 5,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 6,8 replyHeader:: 6,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Not trying to connect to VM_0_3_centos/111.229.129.100:16020 this server is in the failed servers list
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 7,4 replyHeader:: 7,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 8,8 replyHeader:: 8,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Not trying to connect to VM_0_3_centos/111.229.129.100:16020 this server is in the failed servers list
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 9,4 replyHeader:: 9,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 10,8 replyHeader:: 10,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Not trying to connect to VM_0_3_centos/111.229.129.100:16020 this server is in the failed servers list
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 11,4 replyHeader:: 11,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 12,8 replyHeader:: 12,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Not trying to connect to VM_0_3_centos/111.229.129.100:16020 this server is in the failed servers list
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 13,4 replyHeader:: 13,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 14,8 replyHeader:: 14,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 15,4 replyHeader:: 15,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 16,8 replyHeader:: 16,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 17,4 replyHeader:: 17,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 18,8 replyHeader:: 18,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 19,4 replyHeader:: 19,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Got ping response for sessionid: 0x171914b156b0007 after 85ms
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 20,8 replyHeader:: 20,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 21,4 replyHeader:: 21,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Got ping response for sessionid: 0x171914b156b0007 after 77ms
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 22,8 replyHeader:: 22,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 23,4 replyHeader:: 23,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Got ping response for sessionid: 0x171914b156b0007 after 81ms
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 24,8 replyHeader:: 24,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
INFO [hconnection-0x750e2b97-shared--pool1-t1] - Call exception, tries=10, retries=35, started=48950 ms ago, cancelled=false, msg=row 'DM_ALL_INVEST,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=vm_0_3_centos,16020,1587280560051, seqNum=0
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 25,4 replyHeader:: 25,188,0 request:: '/hbase/meta-region-server,F response:: #ffffffff0001a726567696f6e7365727665723a313630323062203bffffffb43cffffffd155fffffff150425546a19ad564d5f305f335f63656e746f7310ffffff947d18ffffffb3ffffffffffffffacffffff8affffff992e100183,s{161,161,1587280565863,1587280565863,0,0,0,0,66,0,161}
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Got ping response for sessionid: 0x171914b156b0007 after 109ms
DEBUG [main-SendThread(VM_0_3_centos:2181)] - Reading reply sessionid:0x171914b156b0007, packet:: clientPath:null serverPath:null finished:false header:: 26,8 replyHeader:: 26,188,0 request:: '/hbase,F response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table}
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Use SIMPLE authentication for service ClientService, sasl=false
DEBUG [hconnection-0x750e2b97-shared--pool1-t1] - Connecting to VM_0_3_centos/111.229.129.100:16020
INFO [hconnection-0x750e2b97-shared--pool1-t1] - Call exception, tries=11, retries=35, started=60417 ms ago, cancelled=false, msg=row 'DM_ALL_INVEST,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=vm_0_3_centos,16020,1587280560051, seqNum=0
Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Sun Apr 19 15:21:03 CST 2020, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=80549: row 'DM_ALL_INVEST,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=vm_0_3_centos,16020,1587280560051, seqNum=0
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:276)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:210)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:210)
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:327)
at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:302)
at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:167)
at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:162)
at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:797)
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:406)
at wind.HBaseGoing.createTable(HBaseGoing.java:80)
at wind.HBaseGoing.main(HBaseGoing.java:65)
Caused by: java.net.SocketTimeoutException: callTimeout=60000, callDuration=80549: row 'DM_ALL_INVEST,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=vm_0_3_centos,16020,1587280560051, seqNum=0
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:169)
at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:531)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:495)
at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupConnection(RpcClientImpl.java:416)
at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:722)
at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.writeRequest(RpcClientImpl.java:906)
at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.tracedWriteRequest(RpcClientImpl.java:873)
at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1241)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:227)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:336)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.scan(ClientProtos.java:34094)
at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:400)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:204)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:65)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:210)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:364)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:338)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:136)
... 4 more
预测是16020端口没有开放
于是使用开放语句
/sbin/iptables -I INPUT -p tcp --dport 16020 -j ACCEPT
service iptables save
service iptables restart
但是telnet 还是提示连接失败
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\01>telnet 111.229.129.100 16020
正在连接111.229.129.100...无法打开到主机的连接。 在端口 16020: 连接失败
C:\Users\01>
于是在服务器查看端口情况
[hadoop@VM_0_3_centos hbase]$ netstat -tunpl
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:50020 0.0.0.0:* LISTEN 1672/java
tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN 1588/java
tcp 0 0 127.0.0.1:38547 0.0.0.0:* LISTEN 1672/java
tcp 0 0 0.0.0.0:50070 0.0.0.0:* LISTEN 1588/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN 1672/java
tcp 0 0 0.0.0.0:50075 0.0.0.0:* LISTEN 1672/java
tcp6 0 0 :::16030 :::* LISTEN 2434/java
tcp6 0 0 :::8030 :::* LISTEN 1763/java
tcp6 0 0 :::8031 :::* LISTEN 1763/java
tcp6 0 0 127.0.0.1:16000 :::* LISTEN 2254/java
tcp6 0 0 :::8032 :::* LISTEN 1763/java
tcp6 0 0 :::8033 :::* LISTEN 1763/java
tcp6 0 0 :::2181 :::* LISTEN 2155/java
tcp6 0 0 :::41349 :::* LISTEN 1998/java
tcp6 0 0 :::8040 :::* LISTEN 1998/java
tcp6 0 0 :::16010 :::* LISTEN 2254/java
tcp6 0 0 :::8042 :::* LISTEN 1998/java
tcp6 0 0 :::3306 :::* LISTEN -
tcp6 0 0 127.0.0.1:16020 :::* LISTEN 2434/java
tcp6 0 0 :::8088 :::* LISTEN 1763/java
tcp6 0 0 ::1:25 :::* LISTEN -
tcp6 0 0 :::13562 :::* LISTEN 1998/java
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 172.17.0.3:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp6 0 0 fe80::5054:ff:fe95::123 :::* -
udp6 0 0 ::1:123 :::* -
发现127.0.0.1:16020是这样的,说明只能本地访问,0.0.0.0才是对外开放的,因此外部是无法访问到的
尝试开启防火墙
查询已开放的端口 netstat -anp
查询指定端口是否已开 firewall-cmd --query-port=16020/tcp
提示 yes,表示开启;no表示未开启。
(2)查看防火墙状态
查看防火墙状态 systemctl status firewalld
开启防火墙 systemctl start firewalld
关闭防火墙 systemctl stop firewalld
开启防火墙 service firewalld start
若遇到无法开启
先用:systemctl unmask firewalld.service
然后:systemctl start firewalld.service
依然无用,最后发现前面是tcp6的,原来是这样原因,找到配置文件禁用tcp6
在/etc/sysctl.conf文件修改如下:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
reboot