免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2350 | 回复: 0
打印 上一主题 下一主题

[puppet] puppet tar包 tomcat server [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-11-18 16:03 |只看该作者 |倒序浏览
在客户端上:
[root@cluster01 home]# puppet agent  --no-daemonize --verbose
notice: Starting Puppet client version 2.6.18
info: Caching catalog for cluster01.yihuacomputer.com
info: Applying configuration version '1384758080'
notice: /Stage[main]/Tomcat::Install/File[/home/tomcat_136.tar]/ensure: defined content as '{md5}3ee83388ef4e45a55e5a4b41ae2d690e'
notice: /Stage[main]/Tomcat::Install/Exec[tar -xvf /home/tomcat_136]/returns: executed successfully
notice: /Stage[main]/Tomcat::Update/File[/usr/local/tomcat/bin/update.sh]/ensure: defined content as '{md5}5c6866b09582d70a3e05bcf166b056ef'
notice: /Stage[main]/Tomcat::Update/File[/usr/local/tomcat/webapps/fish-web-yihua.war]/ensure: defined content as '{md5}2385037e6349787b4c915562c91650fb'
info: /Stage[main]/Tomcat::Update/File[/usr/local/tomcat/webapps/fish-web-yihua.war]: Scheduling refresh of Service[tomcad_service]
err: /Stage[main]/Tomcat::Service/Service[tomcad_service]/ensure: change from stopped to running failed: Could not start Service[tomcad_service]: Execution of '/usr/local/tomcat/bin/update.sh' returned 1:  at /etc/puppet/modules/tomcat/manifests/service.pp:9
notice: /Stage[main]/Tomcat::Service/Service[tomcad_service]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 160.13 seconds

在服务器端:
[root@desktop home]# vim /etc/puppet/modules/tomcat/manifests/update.pp
class tomcat::update {
        file { "/usr/local/tomcat/webapps/fish-web-yihua.war":
                ensure => present,
                require => Class["tomcat::install"],
                source => "puppet:///modules/tomcat/fish-web-yihua.war",
#               notify => Exec["update_command"]
                notify => Class["tomcat::service"],
        }
        file {"/usr/local/tomcat/bin/update.sh":
                ensure => present,
                require => Class["tomcat::install"],
                source => "puppet:///modules/tomcat/update.sh",
                mode => 0755,
}
}

[root@desktop home]# vim /etc/puppet/modules/tomcat/manifests/service.pp
class tomcat::service {
        service { "tomcad_service":
                ensure => running,
                hasstatus => false,
                hasrestart => false,
                start => "/usr/local/tomcat/bin/update.sh",###内容为kill -9 $tomcat     /usr/local/tomcat/bin/start.sh之类的内容
                stop => "/usr/local/tomcat/bin/shutdown.sh",
                #require => Class["tomcat::config"]
        }
}
=============================================================
反馈的消息大概是什么意思?有没有其他的方法看得更加易懂,这个问题怎么修改配置文件?

求教
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP