saltstack执行state.sls后无法返回,卡住进程
目录结构:
[root@salt_master srv]# tree -Cv salt/base/lnmp_yum/
salt/base/lnmp_yum/
├── mysql
│ ├── files
│ │ ├── mysql-5.6.repo
│ │ └── mysql-5.7.repo
│ └── mysql_install.sls
├── nginx
└── php
salt中的mysql_install.sls文件内容:
[root@salt_master srv]# cat salt/base/lnmp_yum/mysql/mysql_install.sls
repo_init:
file.managed:
- name: /etc/yum.repos.d/mysql-{{pillar['mysql_version']}}.repo
- source: salt://lnmp_yum/mysql/files/mysql-{{pillar['mysql_version']}}.repo
- user: root
- group: root
- mode: 644
mysql_install:
pkg.installed:
- names:
- mysql
- mysql-server
- mysql-devel
- require:
- file: repo_init
service.running:
- name: mysqld
- enable: True
pillar中的mysql_info.sls内容:
[root@salt_master srv]# cat pillar/base/lnmp_yum/mysql/mysql_info.sls
mysql_version: 5.6
执行state.sls操作
[root@salt_master ~]# salt 'lnmp_base' state.sls lnmp_yum.mysql.mysql_install -l debug
执行输出日志
一直在打印以下内容
[DEBUG ] Checking whether jid 20170526144936867490 is still running
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'salt_master_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG ] Passing on saltutil error. This may be an error in saltclient. 'retcode'
[DEBUG ] Checking whether jid 20170526144936867490 is still running
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'salt_master_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG ] Passing on saltutil error. This may be an error in saltclient. 'retcode'
[DEBUG ] Checking whether jid 20170526144936867490 is still running
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'salt_master_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG ] Passing on saltutil error. This may be an error in saltclient. 'retcode'
我在node端查看,即lnmp_base机器上看,发现mysql已经完成了安装并已经启动了
[root@lnmp_base ~]# ps -ef|grep mysql
root 2860 1 0 14:52 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 3064 2860 0 14:52 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 3378 3362 0 15:03 pts/1 00:00:00 grep mysql
但master端就是一直在执行,无法退出,这是为什么的?
我前几天安装jboos也是这样情况,不知道为咋的。
我的环境,master,node是两台kvm机器,master内存512M,node内存2G。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你好。请问怎么解决的。。。我也遇到了这个问题