使用Puppet运行Karaf Client的问题

韦维加

我正在尝试运行一个脚本来使用puppet安装某些功能,但出现一个奇怪的错误(恰好是NullPointerException)。但是,如果我从我的用户在计算机上运行脚本,则一切都将正常运行。我正在使用Apache Karaf3.0.0和Puppet2.7。

我的脚本非常简单:

#!/bin/bash
####
#### A init script for Karaf
####

# Repos
for REPO in <%= repos.sort.join(' ') %>
do
   /opt/karaf/bin/client -a 8101 -h 127.0.0.1 -v feature:repo-add $REPO
done

# Features
for FEATURE in <%= features.sort.join(' ') %>
do
   /opt/karaf/bin/client -a 8101 -h 127.0.0.1 -v feature:install $FEATURE
done

为了运行它,Puppet我只使用以下内容:

exec {
'/opt/karaf/bin/init.sh' :
  user        => 'root',
  path        => ["/usr/bin", "/usr/sbin"],
  logoutput   => true,
  require     => [Service['karaf'],File['/opt/karaf/bin/init.sh']];
}

这是我Puppet在机器上运行时得到的输出

info: /Stage[main]/Karaf/File[/opt/karaf/bin/init.sh]: Filebucketed /opt/karaf/bin/init.sh to puppet with sum 7687821cc06d43754a4f44aa9b9a69ff
notice: /Stage[main]/Karaf/File[/opt/karaf/bin/init.sh]/content: content changed '{md5}7687821cc06d43754a4f44aa9b9a69ff' to '{md5}6bb98d2e1079c66a7b9e16fff5ec1860'
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: 30 [main] INFO org.apache.sshd.common.util.SecurityUtils - BouncyCastle not registered, using the default JCE provider
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: 519 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Session created...
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: java.lang.NullPointerException
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns:   at org.apache.karaf.client.Main.main(Main.java:83)
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: 20 [main] INFO org.apache.sshd.common.util.SecurityUtils - BouncyCastle not registered, using the default JCE provider
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: 386 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Session created...
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: java.lang.NullPointerException
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns:   at org.apache.karaf.client.Main.main(Main.java:83)
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: 27 [main] INFO org.apache.sshd.common.util.SecurityUtils - BouncyCastle not registered, using the default JCE provider
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: 497 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Session created...
notice: /Stage[main]/Karaf/Exec[/opt/karaf/bin/init.sh]/returns: java.lang.NullPointerException

但是,如果我在我的用户或root下运行它:

30 [main] INFO org.apache.sshd.common.util.SecurityUtils - BouncyCastle not registered, using the default JCE provider
550 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Session created...
561 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Server version string: SSH-2.0-SSHD-CORE-0.9.0
Logging in as karaf
564 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Received SSH_MSG_KEXINIT
592 [pool-2-thread-1] INFO org.apache.sshd.client.kex.DHG1 - Send SSH_MSG_KEXDH_INIT
602 [pool-2-thread-2] INFO org.apache.sshd.client.kex.DHG1 - Received SSH_MSG_KEXDH_REPLY
619 [pool-2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at /127.0.0.1:8101 presented unverified key:
620 [pool-2-thread-2] INFO org.apache.sshd.client.session.ClientSessionImpl - Received SSH_MSG_NEWKEYS
625 [pool-2-thread-2] INFO org.apache.sshd.client.session.ClientSessionImpl - Send SSH_MSG_SERVICE_REQUEST for ssh-userauth
631 [main] INFO org.apache.sshd.client.auth.UserAuthAgent - Send SSH_MSG_USERAUTH_REQUEST for publickey
643 [pool-2-thread-5] INFO org.apache.sshd.client.auth.UserAuthAgent - Received SSH_MSG_USERAUTH_SUCCESS
675 [main] INFO org.apache.sshd.client.channel.ChannelExec - Send SSH_MSG_CHANNEL_OPEN on channel 101
678 [pool-2-thread-2] INFO org.apache.sshd.client.channel.ChannelExec - Send SSH_MSG_CHANNEL_REQUEST exec
Adding feature url mvn:io.hawt/hawtio-karaf/1.2.3/xml/features
936 [pool-2-thread-5] INFO org.apache.sshd.client.channel.ChannelExec - Received SSH_MSG_CHANNEL_REQUEST on channel 101
29 [main] INFO org.apache.sshd.common.util.SecurityUtils - BouncyCastle not registered, using the default JCE provider
539 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Session created...
Logging in as karaf
552 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Server version string: SSH-2.0-SSHD-CORE-0.9.0
554 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Received SSH_MSG_KEXINIT
579 [pool-2-thread-1] INFO org.apache.sshd.client.kex.DHG1 - Send SSH_MSG_KEXDH_INIT
592 [pool-2-thread-2] INFO org.apache.sshd.client.kex.DHG1 - Received SSH_MSG_KEXDH_REPLY
609 [pool-2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at /127.0.0.1:8101 presented unverified key:
609 [pool-2-thread-2] INFO org.apache.sshd.client.session.ClientSessionImpl - Received SSH_MSG_NEWKEYS
615 [pool-2-thread-2] INFO org.apache.sshd.client.session.ClientSessionImpl - Send SSH_MSG_SERVICE_REQUEST for ssh-userauth
620 [main] INFO org.apache.sshd.client.auth.UserAuthAgent - Send SSH_MSG_USERAUTH_REQUEST for publickey
631 [pool-2-thread-5] INFO org.apache.sshd.client.auth.UserAuthAgent - Received SSH_MSG_USERAUTH_SUCCESS
668 [main] INFO org.apache.sshd.client.channel.ChannelExec - Send SSH_MSG_CHANNEL_OPEN on channel 101
670 [pool-2-thread-2] INFO org.apache.sshd.client.channel.ChannelExec - Send SSH_MSG_CHANNEL_REQUEST exec
Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.13.0/xml/features
985 [pool-2-thread-5] INFO org.apache.sshd.client.channel.ChannelExec - Received SSH_MSG_CHANNEL_REQUEST on channel 101
27 [main] INFO org.apache.sshd.common.util.SecurityUtils - BouncyCastle not registered, using the default JCE provider
515 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Session created...
526 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Server version string: SSH-2.0-SSHD-CORE-0.9.0
Logging in as karaf
528 [pool-2-thread-1] INFO org.apache.sshd.client.session.ClientSessionImpl - Received SSH_MSG_KEXINIT
553 [pool-2-thread-1] INFO org.apache.sshd.client.kex.DHG1 - Send SSH_MSG_KEXDH_INIT
562 [pool-2-thread-2] INFO org.apache.sshd.client.kex.DHG1 - Received SSH_MSG_KEXDH_REPLY
578 [pool-2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at /127.0.0.1:8101 presented unverified key:
579 [pool-2-thread-2] INFO org.apache.sshd.client.session.ClientSessionImpl - Received SSH_MSG_NEWKEYS
584 [pool-2-thread-2] INFO org.apache.sshd.client.session.ClientSessionImpl - Send SSH_MSG_SERVICE_REQUEST for ssh-userauth
590 [main] INFO org.apache.sshd.client.auth.UserAuthAgent - Send SSH_MSG_USERAUTH_REQUEST for publickey
602 [pool-2-thread-5] INFO org.apache.sshd.client.auth.UserAuthAgent - Received SSH_MSG_USERAUTH_SUCCESS
630 [main] INFO org.apache.sshd.client.channel.ChannelExec - Send SSH_MSG_CHANNEL_OPEN on channel 101
632 [pool-2-thread-2] INFO org.apache.sshd.client.channel.ChannelExec - Send SSH_MSG_CHANNEL_REQUEST exec
666 [pool-2-thread-4] INFO org.apache.sshd.client.channel.ChannelExec - Received SSH_MSG_CHANNEL_REQUEST on channel 101

Puppet在做我想念的事情吗?Karaf 3.0.0的客户端中是否有错误?谢谢,对不起,很长的帖子!

lpapp

看来此问题已在3.0.1中修复。有关详细信息,请参见下面的Jira报告:

客户端失败,出现NullPointerException

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在AEM中使用Elasticsearch Rest High Client问题

来自分类Dev

使用 activemq-client jar 与 activemq-all jar 的问题

来自分类Dev

在Notes Client中运行时,Domino Agent问题-在服务器上工作正常

来自分类Dev

在objc项目中使用Socket.IO-Client-Swift的问题

来自分类Dev

在groovy / java中使用Jira Rest Java Client(JRJC)更新问题

来自分类Dev

下面提到的使用 org.springframework.web.client.RestTemplate RestTemplate 风格的潜在问题是什么?

来自分类Dev

Apache Karaf停止订单问题

来自分类Dev

Ubuntu中的Karaf安装问题

来自分类Dev

使用 --config 运行测试的问题

来自分类Dev

Karaf freezing with log at debug when connecting with client

来自分类Dev

使用JDK 1.7运行Eureka Client

来自分类Dev

使用JDK 1.7运行Eureka Client

来自分类Dev

从 acpid 运行 awesome-client(使用 dbus)

来自分类Dev

使Apache httpcomponents HttpClient 4.3.x OSGi捆绑软件在Apache Karaf 2.3.x上运行时出现问题

来自分类Dev

使用Webpack运行react-redux的问题

来自分类Dev

使用 jupyter notebook 运行 docker image 的问题

来自分类Dev

确保使用puppet使用特定参数运行服务

来自分类Dev

使用puppet在启动时运行自定义服务

来自分类Dev

如何获取.sh文件并使用puppet自动运行它?

来自分类Dev

使用puppet在启动时运行自定义服务

来自分类Dev

使用 Puppet exec 资源直接运行 Powershell 命令

来自分类Dev

当我尝试使用AWS IAM角色连接HashiCorp Vault时,如何解决“无法解析的Vault位置[kv / my-client-service]:找不到”的问题?

来自分类Dev

制作简单 TCP_CLIENT 的问题

来自分类Dev

getManifest 问题(forge-php-client)

来自分类Dev

带有AMQP使用者的骆驼路线在Eclipse中运行正常,在karaf中挂起

来自分类Dev

运行mysqld时的问题

来自分类Dev

运行uget的问题

来自分类Dev

从CLI运行CodeIgniter的问题

来自分类Dev

从终端运行测试的问题

Related 相关文章

  1. 1

    在AEM中使用Elasticsearch Rest High Client问题

  2. 2

    使用 activemq-client jar 与 activemq-all jar 的问题

  3. 3

    在Notes Client中运行时,Domino Agent问题-在服务器上工作正常

  4. 4

    在objc项目中使用Socket.IO-Client-Swift的问题

  5. 5

    在groovy / java中使用Jira Rest Java Client(JRJC)更新问题

  6. 6

    下面提到的使用 org.springframework.web.client.RestTemplate RestTemplate 风格的潜在问题是什么?

  7. 7

    Apache Karaf停止订单问题

  8. 8

    Ubuntu中的Karaf安装问题

  9. 9

    使用 --config 运行测试的问题

  10. 10

    Karaf freezing with log at debug when connecting with client

  11. 11

    使用JDK 1.7运行Eureka Client

  12. 12

    使用JDK 1.7运行Eureka Client

  13. 13

    从 acpid 运行 awesome-client(使用 dbus)

  14. 14

    使Apache httpcomponents HttpClient 4.3.x OSGi捆绑软件在Apache Karaf 2.3.x上运行时出现问题

  15. 15

    使用Webpack运行react-redux的问题

  16. 16

    使用 jupyter notebook 运行 docker image 的问题

  17. 17

    确保使用puppet使用特定参数运行服务

  18. 18

    使用puppet在启动时运行自定义服务

  19. 19

    如何获取.sh文件并使用puppet自动运行它?

  20. 20

    使用puppet在启动时运行自定义服务

  21. 21

    使用 Puppet exec 资源直接运行 Powershell 命令

  22. 22

    当我尝试使用AWS IAM角色连接HashiCorp Vault时,如何解决“无法解析的Vault位置[kv / my-client-service]:找不到”的问题?

  23. 23

    制作简单 TCP_CLIENT 的问题

  24. 24

    getManifest 问题(forge-php-client)

  25. 25

    带有AMQP使用者的骆驼路线在Eclipse中运行正常,在karaf中挂起

  26. 26

    运行mysqld时的问题

  27. 27

    运行uget的问题

  28. 28

    从CLI运行CodeIgniter的问题

  29. 29

    从终端运行测试的问题

热门标签

归档