storm nimbus不能启动 ------zookeeper、storm踩过的坑

在单机中配置完成zookeeper和storm后,启动zookeeper,没报错,有进程;启动storm的nimbus,会出现一会进程,后面有没有了,一直在找storm的问题,后来看日志,发现是2181的端口不能通信,可能是zookeeper的问题,(后来改zoo.cfg中的设置)增加一个服务器的设置,最后正确的配置如下:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
#存放数据文件
dataDir=/home/shuiyinyu/zookeeper-3.4.14/dataDir
#存放日志文件
DataLogDir=/home/shuiyinyu/zookeeper-3.4.14/dataLogDir
server.1=machine74:2888:3888 #node74为自己机器的名称
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
将一个 JWK 转换为 X509Certificate 是不可能的,因为它们是不同的密钥格式。JWK 是 JSON Web Key 的缩写,它是一种用于表示密钥的 JSON 格式。而 X509Certificate 是一种常用的公钥证书格式,用于证明公钥的合法性和身份。 如果你需要将 JWK 转换为 X509Certificate,你需要先将 JWK 转换为一个 Java 的密钥对象,然后再使用 Java 的密钥工具将其转换为 X509Certificate,具体实现步骤如下: 1.使用 Nimbus JOSE+JWT 库将 JWK 转换为 Java 的密钥对象: ```java import com.nimbusds.jose.jwk.JWK; import com.nimbusds.jose.jwk.RSAKey; import java.security.interfaces.RSAPublicKey; JWK jwk = JWK.parse(jwkJsonString); RSAKey rsaJWK = (RSAKey) jwk; RSAPublicKey publicKey = rsaJWK.toRSAPublicKey(); ``` 2.使用 Java 的密钥工具将密钥对象转换为 X509Certificate: ```java import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateEncodingException; import java.security.cert.Certificate; public static X509Certificate getCertificateFromPublicKey(RSAPublicKey publicKey) throws CertificateEncodingException, CertificateException { CertificateFactory cf = CertificateFactory.getInstance("X.509"); byte[] certBytes = publicKey.getEncoded(); Certificate cert = cf.generateCertificate(new ByteArrayInputStream(certBytes)); return (X509Certificate) cert; } ``` 请注意,这里的代码示例仅为示范代码,实际使用时需要根据具体情况进行调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值