gpt4 book ai didi

tomcat - 依赖失败( puppet )

转载 作者:行者123 更新时间:2023-11-28 23:47:13 25 4
gpt4 key购买 nike

问题:当我第一次运行 puppet 来配置 box 时,我会遇到依赖失败错误以及包含这些错误的文件 (apache-solr-dataimporthandler-3.6.1. jar) 不会复制到它们的目标位置。然而,第二次进行配置时,不再存在依赖性错误,并且所有文件似乎都已正确复制。

如何在不重新配置的情况下解决依赖错误?为什么会这样?

list

file { '/var/lib/tomcat6/webapps/solr.war':
ensure => present,
owner => root,
group => root,
mode => 644,
source => 'puppet:///modules/solr/apache-solr-3.6.1.war',
notify => Service['tomcat'],
}

file { '/usr/share/solr':
ensure => present,
source => 'puppet:///modules/solr/solr',
recurse => true,
require => File['/var/lib/tomcat6/webapps/solr.war'],
notify => Service['tomcat'],
}

file { '/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml':
ensure => present,
owner => root,
group => root,
mode => 644,
source => 'puppet:///modules/solr/web.xml',
require => [ File['/var/lib/tomcat6/webapps/solr.war'], File['/usr/share/solr'] ],
}

file { '/var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar':
ensure => present,
owner => root,
group => root,
mode => 644,
source => 'puppet:///modules/solr/apache-solr-dataimporthandler-3.6.1.jar',
require => File['/var/lib/tomcat6/webapps/solr.war'],
notify => Service['tomcat'],
}

错误

←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr.war]/ensure: defined content as'{md5}ae7997a401f9d223b097f8a88259689e'←[0m
←[1;35merr: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar]/ensure: change from absent to file failed: Could not set 'file on ensure: No such file or directory - /var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar.puppettmp_4049 at /tmp/vagrant-puppet/modules-0/solr/manifests/init.pp:37←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/usr/share/solr]/ensure: created←[0m
...
...
...
←[0;36mnotice: /Stage[main]/Tomcat/Service[tomcat]: Dependency File[/var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar] has failures: true←[0m
←[0;33mwarning: /Stage[main]/Tomcat/Service[tomcat]: Skipping because of failed dependencies←[0m
←[0;36mnotice: /Stage[main]/Tomcat/Service[tomcat]: Triggered 'refresh' from 6 events←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml]/content: content changed '{md5}1b3a494d9ddefb9bef08caa5146cfd32' to '{md5}f3b9d07f7585ef8008f2bcf0407596f2'←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml]/owner: owner changed 'tomcat6' to 'root'←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml]/group: group changed 'tomcat6' to 'root'←[0m
←[0;36mnotice: Finished catalog run in 18.90 seconds←[0m

目录结构

enter image description here

最佳答案

在我看来,puppet 在尝试创建 /var 时提示目录 /var/lib/tomcat6/webapps/solr/WEB-INF/lib/ 不存在/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar.

我怀疑这个目录是在 tomcat 检测到新的 .war 时创建的,但为时已晚,您必须重新启动 puppet。

所以你可能想明确地确保创建这个目录:

file
{
'/var/lib/tomcat6/webapps/solr':
ensure => directory,
;
'/var/lib/tomcat6/webapps/solr/WEB-INF':
ensure => directory,
;
'/var/lib/tomcat6/webapps/solr/WEB-INF/lib':
ensure => directory,
;
}

(省略“require”,因为 puppet 似乎是按照定义的顺序创建的)

我不是 tomcat 专家,但您可能希望确保手动创建目录不会干扰 tomcat .war 自动检测系统。

关于tomcat - 依赖失败( puppet ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12796289/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com