皮皮网

【ste社交源码】【jquery 弹出层 源码】【挂机加粉源码】nettypromise源码

来源:javapms 1.3源码 时间:2024-11-23 12:15:52

1.netty源码解析(三十五)---Netty启动3 成功bind 等待连接
2.Hbase - kerberos认证异常

nettypromise源码

netty源码解析(三十五)---Netty启动3 成功bind 等待连接

       Netty启动过程中的源码bind操作在AbstractBootstrap类中启动,由于异步特性,源码ChannelFuture在register0方法后交给事件执行器处理,源码此时isDone返回为false。源码在sync同步等待时,源码ste社交源码主线程会阻塞在PendingRegistrationPromise上,源码jquery 弹出层 源码等待绑定完成。源码

       PendingRegistrationPromise的源码创建和ChannelFuture的监听器是为了在绑定成功后执行后续操作。当bind0方法中的源码safeSetSuccess成功后,会触发监听器,源码进一步调用AbstractChannel的源码bind方法。这个过程会通过DefaultChannelPipeline的源码tail处理,最后在AbstractChannelHandlerContext的源码挂机加粉源码HeadContext中,调用handler的源码bind方法,其中HeadContext的源码unsafe.bind方法会调用到NioServerSocketChannel的unsafe的dobind方法。

       在NioServerSocketChannel中,真正的spark sql源码分析绑定操作是调用原生的jdk的bind方法。当绑定成功后,AbstractChannel的dobind方法会设置promise为success,从而唤醒主线程,继续执行后续代码。pb 上传文件 源码至此,Netty的bind操作等待连接的到来。

       总结整个流程:Bootstrap创建Promise等待,然后通过管道传递到AbstractChannel,通过HeadContext调用unsafe.bind,最终在NioServerSocketChannel中调用原生bind,主线程等待并处理bind结果。当连接到来时,整个绑定过程结束。

Hbase - kerberos认证异常

       > 之前怎么认证都认证不上,问题找了好了,发现它的异常跟实际操作根本就对不上,死马当活马医,当时也是瞎改才好的,给大家伙记录记录。

        ```

        KrbException: Server not found in Kerberos database (7) - LOOKING_UP_SERVER

        >>> KdcAccessibility: remove storm1.starsriver.cn

        at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:)

        >>> KDCRep: init() encoding tag is req type is

        at sun.security.krb5.KrbTgsReq.getReply(KrbTgsReq.java:)

        >>>KRBError:

        at sun.security.krb5.KrbTgsReq.sendAndGetCreds(KrbTgsReq.java:)

        cTime is Fri Aug :: CST

        sTime is Tue Jul :: CST

        at sun.security.krb5.internal.CredentialsUtil.serviceCreds(CredentialsUtil.java:)

        suSec is

        error code is 7

        at sun.security.krb5.internal.CredentialsUtil.acquireServiceCreds(CredentialsUtil.java:)

        error Message is Server not found in Kerberos database

        at sun.security.krb5.Credentials.acquireServiceCreds(Credentials.java:)

        cname is hbase/lake.dounine.com@dounine.com

        at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:)

        sname is hbase/...@dounine.com

        msgType is

        at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:)

        at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:)

        at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:)

        at org.apache.hadoop.hbase.security.AbstractHBaseSaslRpcClient.getInitialResponse(AbstractHBaseSaslRpcClient.java:)

        at org.apache.hadoop.hbase.security.NettyHBaseSaslRpcClientHandler$1.run(NettyHBaseSaslRpcClientHandler.java:)

        at org.apache.hadoop.hbase.security.NettyHBaseSaslRpcClientHandler$1.run(NettyHBaseSaslRpcClientHandler.java:)

        at java.security.AccessController.doPrivileged(Native Method)

        at javax.security.auth.Subject.doAs(Subject.java:)

        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:)

        at org.apache.hadoop.hbase.security.NettyHBaseSaslRpcClientHandler.handlerAdded(NettyHBaseSaslRpcClientHandler.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:)

        at org.apache.hadoop.hbase.ipc.NettyRpcConnection.saslNegotiate(NettyRpcConnection.java:)

        at org.apache.hadoop.hbase.ipc.NettyRpcConnection.access$(NettyRpcConnection.java:)

        at org.apache.hadoop.hbase.ipc.NettyRpcConnection$3.operationComplete(NettyRpcConnection.java:)

        at org.apache.hadoop.hbase.ipc.NettyRpcConnection$3.operationComplete(NettyRpcConnection.java:)

        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:)

        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:)

        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:)

        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:)

        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:)

        at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:)

        at org.apache.hbase.thirdparty.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:)

        at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:)

        at java.lang.Thread.run(Thread.java:)

        Caused by: KrbException: Identifier doesn't match expected value ()

        at sun.security.krb5.internal.KDCRep.init(KDCRep.java:)

        at sun.security.krb5.internal.TGSRep.init(TGSRep.java:)

        at sun.security.krb5.internal.TGSRep.<init>(TGSRep.java:)

        at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:)

        ... more

        ```

        此错误需要将线上服务器的域名映射放入Client中的`/etc/hosts`

        ```

        ..0.2 h1.demo.com

        ..0.3 h2.demo.com

        ..0.4 h3.demo.com

        ```

        ---

        ![](https://upload-images.jianshu.io/upload_images/-bb8dadcd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/)