Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell Ansible执行命令_Shell_Hadoop_Ansible_Apache Zookeeper_Ansible Playbook - Fatal编程技术网

Shell Ansible执行命令

Shell Ansible执行命令,shell,hadoop,ansible,apache-zookeeper,ansible-playbook,Shell,Hadoop,Ansible,Apache Zookeeper,Ansible Playbook,我已经使用ansible配置了一个完全分布式的hadoop集群,但是我想配置ansible来执行下一个命令 我使用next来执行zookeeper,但我有下一个错误 - name: ejecutar zkServer.sh become_user: vagrant shell: sh /opt/zookeeper-3.4.7/bin/zkServer.sh TASK: [ejecutar | ejecutar zkServer.sh] ***********************

我已经使用ansible配置了一个完全分布式的hadoop集群,但是我想配置ansible来执行下一个命令

我使用next来执行zookeeper,但我有下一个错误

- name: ejecutar zkServer.sh
  become_user: vagrant
  shell: sh /opt/zookeeper-3.4.7/bin/zkServer.sh



TASK: [ejecutar | ejecutar zkServer.sh] *************************************** 
failed: [172.16.8.211] => {"changed": true, "cmd": "sh /opt/zookeeper-3.4.7/bin/zkServer.sh", "delta": "0:00:00.006246", "end": "2016-01-18 14:28:44.181146", "rc": 2, "start": "2016-01-18 14:28:44.174900", "warnings": []}
stderr: /opt/zookeeper-3.4.7/bin/zkServer.sh: 81: /opt/zookeeper-3.4.7/bin/zkEnv.sh: Syntax error: "(" unexpected (expecting "fi")

FATAL: all hosts have already failed -- aborting

谢谢。

它的工作方式与下一个命令类似:

- name: ejecutar zkServer.sh
  become_user: vagrant
  command: "/opt/zookeeper-3.4.7/bin/zkServer.sh restart"

“下一个/上一个命令”是什么意思。这看起来像是来自终端的东西,与之无关Ansible@cricket_007是的,我想要的是使用ansible执行终端命令。不可能吗?有可能。。。你看过这里吗@板球(好的,非常感谢,如果其中一些有效,我会试试。)欢迎如果您遇到Ansible问题,请使用实际的Ansible任务更新您的问题