我是SaltStack新手,我正在构建一个将tomcat和tomcat war文件部署到Ubuntu16.04系统的版本。在我第一次尝试使用tomcat.war_deployed部署war文件之前,我没有遇到任何问题。如果任何有更多SaltStack经验的人能给我提供任何反馈,我将不胜感激。
/srv/pillar/top.sls
base:
'*':
- tomcat-manager/srv/tomcat/tomcat-manager.sls
tomcat-manager:
user: 'myuser'
passwd: 'mypassword'salt '*' pillar.test的输出
tomcat-manager:
------------
passwd:
mypassword
user:
myusermystate.sls
# 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.confsalt '*' state.sls mystate的输出
----------
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时:
myminion:
Apache Tomcat/7.0.68 (Ubuntu)
myminion2:
Apache Tomcat/8.0.32 (Ubuntu)salt '*' tomcat.status的输出
myminion:
False
myminion1:
Falsesalt '*' tomcat.serverinfo的输出
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的输出
[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 requestsalt-call test.versions的输出
[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发布于 2017-06-30 19:31:10
对我来说起作用的是在minion上重新启动tomcat实例。
tomcat实例可以使用旧的用户参数运行。
https://stackoverflow.com/questions/43770756
复制相似问题