首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Tomcat部署:'tomcat.war_deployed‘错误

Tomcat部署:'tomcat.war_deployed‘错误
EN

Stack Overflow用户
提问于 2017-05-04 06:04:38
回答 1查看 347关注 0票数 0

我是SaltStack新手,我正在构建一个将tomcat和tomcat war文件部署到Ubuntu16.04系统的版本。在我第一次尝试使用tomcat.war_deployed部署war文件之前,我没有遇到任何问题。如果任何有更多SaltStack经验的人能给我提供任何反馈,我将不胜感激。

/srv/pillar/top.sls

代码语言:javascript
复制
base:
  '*':
    - tomcat-manager

/srv/tomcat/tomcat-manager.sls

代码语言:javascript
复制
tomcat-manager:
    user: 'myuser'
    passwd: 'mypassword'

salt '*' pillar.test的输出

代码语言:javascript
复制
tomcat-manager:
  ------------
    passwd:
        mypassword
    user:
        myuser

mystate.sls

代码语言:javascript
复制
# Install tomcat8 packages.
install_tomcat:
  pkg.installed:
    - pkgs:
      - tomcat8
      - tomcat8-admin

# Install postgresql packages.
install_postgresql:
  pkg.installed:
    - name: postgresql-9.5

# Start tomcat service.
start_service_tomcat:
  service.running:
    - name: tomcat8
    - enable: True
    - require:
      - pkg: install_tomcat
    - watch:
      - file: sync tomcat-users.xml

# Tomcat deploy war files.
deploy_war:
  tomcat.war_deployed:
    - name: /mywar
    - war: salt://files/tomcat/war/mywar.war
    - require:
      - service: start_service_tomcat

# Start postgresql service.
start_service_postgresql:
  service.running:
    - name: postgresql
    - enable: True
    - require:
      - pkg: install_postgresql
    - watch:
      - file: sync pg_hba.conf
      - file: sync postgresql.conf

salt '*' state.sls mystate的输出

代码语言:javascript
复制
----------
          ID: deploy_war
    Function: tomcat.war_deployed
        Name: /mywar
      Result: False
     Comment: F
              a                                                                                                                                                                                                                                                                
              i                                                                                                                                                                                                                                                                
              l                                                                                                                                                                                                                                                                
              e                                                                                                                                                                                                                                                                
              d                                                                                                                                                                                                                                                                

              t                                                                                                                                                                                                                                                                
              o                                                                                                                                                                                                                                                                

              c                                                                                                                                                                                                                                                                
              r                                                                                                                                                                                                                                                                
              e                                                                                                                                                                                                                                                                
              a                                                                                                                                                                                                                                                                
              t                                                                                                                                                                                                                                                                
              e                                                                                                                                                                                                                                                                

              H                                                                                                                                                                                                                                                                
              T                                                                                                                                                                                                                                                                
              T                                                                                                                                                                                                                                                                
              P                                                                                                                                                                                                                                                                

              r
              e
              q
              u
              e
              s
              t
     Started: 15:54:02.314254
    Duration: 1980.229 ms
     Changes:

[...]

Failed:     1
-------------
Total states run:     12
Total run time:    2.671 s
ERROR: Minions returned with non-zero exit code

更新

可以在我的助手上访问myminion:8080/manager

我还不能确定SaltStack是否正式支持Tomcat8,所以我决定用Tomcat7测试一下,它给我带来了同样的问题。

当我在小工具上运行salt '*' tomcat.version时:

代码语言:javascript
复制
myminion:
    Apache Tomcat/7.0.68 (Ubuntu)
myminion2:
    Apache Tomcat/8.0.32 (Ubuntu)

salt '*' tomcat.status的输出

代码语言:javascript
复制
myminion:
    False
myminion1:
    False

salt '*' tomcat.serverinfo的输出

代码语言:javascript
复制
myminion:
    ----------
    error:
        Failed to create HTTP request
myminion1:
    ----------
    error:
        Failed to create HTTP request

我还没有在Failed to create HTTP request搜索引擎上找到任何幸运的东西。

sudo salt-call -l debug tomcat.serverinfo的输出

代码语言:javascript
复制
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: myminion
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[WARNING ] Unable to find IPv6 record for "myminion" causing a 10 second timeout when rendering grains. Set the dns or /etc/hosts for IPv6 to clear this.
[DEBUG   ] Please install 'virt-what' to improve results of the 'virtual' grain.
[DEBUG   ] Connecting to master. Attempt 1 of 1
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'myminion', 'tcp://mymaster:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (7330)
[DEBUG   ] Setting zmq_reconnect_ivl to '7330ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'myminion', 'tcp://mymaster:4506', 'clear')
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] SaltEvent PUB socket URI: /var/run/salt/minion/minion_event_bbef5074cf_pub.ipc
[DEBUG   ] SaltEvent PULL socket URI: /var/run/salt/minion/minion_event_bbef5074cf_pull.ipc
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/minion/minion_event_bbef5074cf_pull.ipc
[DEBUG   ] Sending event: tag = salt/auth/creds; data = {'_stamp': '2017-05-04T18:14:04.328838', 'creds': {'publish_port': 4505, 'aes': '######/#####/###############################################=', 'master_uri': 'tcp://mymaster:4506'}, 'key': ('/etc/salt/pki/minion', 'myminion', 'tcp://mymaster:4506')}
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'myminion', 'tcp://mymaster:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'myminion', 'tcp://mymaster:4506')
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded tomcat.serverinfo
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'myminion', 'tcp://mymaster:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'myminion', 'tcp://mymaster:4506')
[DEBUG   ] LazyLoaded nested.output
local:
    ----------
    error:
        Failed to create HTTP request

salt-call test.versions的输出

代码语言:javascript
复制
[WARNING ] Unable to find IPv6 record for "dt-rhettvm-01" causing a 10 second timeout when rendering grains. Set the dns or /etc/hosts for IPv6 to clear this.
local:
    Salt Version:
                Salt: 2016.11.4

    Dependency Versions:
               cffi: Not Installed
           cherrypy: Not Installed
           dateutil: 2.4.2
          docker-py: Not Installed
              gitdb: Not Installed
          gitpython: Not Installed
              ioflo: Not Installed
             Jinja2: 2.8
            libgit2: Not Installed
            libnacl: Not Installed
           M2Crypto: Not Installed
               Mako: 1.0.3
       msgpack-pure: Not Installed
     msgpack-python: 0.4.6
       mysql-python: Not Installed
          pycparser: Not Installed
           pycrypto: 2.6.1
       pycryptodome: Not Installed
             pygit2: Not Installed
             Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
       python-gnupg: Not Installed
             PyYAML: 3.11
              PyZMQ: 15.2.0
               RAET: Not Installed
              smmap: Not Installed
            timelib: Not Installed
            Tornado: 4.2.1
                ZMQ: 4.1.4

    System Versions:
               dist: Ubuntu 16.04 xenial
            machine: x86_64
            release: 4.4.0-62-generic
             system: Linux
            version: Ubuntu 16.04 xenia
EN

回答 1

Stack Overflow用户

发布于 2017-06-30 19:31:10

对我来说起作用的是在minion上重新启动tomcat实例。

tomcat实例可以使用旧的用户参数运行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43770756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档