1.准备工作
2、zookeeper的一键部署脚本
zookeeper-file: file.managed: - source: salt://zookeeper/zookeeper-3.4.6.tar.gz - name: /opt/zookeeper-3.4.6.tar.gz - include_empty: True - user: root - group: root zookeeper-install: cmd.run: - name: 'cd /opt && tar -xf zookeeper-3.4.6.tar.gz && ln -s /opt/zookeeper-3.4.6 /opt/zookeeper && chown -R hadoop:hadoop /opt/zookeeper*' - unless: 'test -d /opt/zookeeper-3.4.6' - require: - file: zookeeper-file zookeeper-rmtgz: file.absent: - name: /opt/zookeeper-3.4.6.tar.gz - require: - cmd: zookeeper-install /etc/profile: file.append: - text: - export ZK_HOME=/opt/zookeeper - export PATH=$ZK_HOME/bin:$PATH - require: - file: zookeeper-rmtgz source-profile: cmd.run: - name: 'source /etc/profile' - require: - file: /etc/profile
3、和前面的jdk和python的操作类似。