一、通过playbook安装与设置zookeeper
--- #必须字段,类同于#/bin/bash
- hosts: test #远程操作主机
remote_user: cedar #远程操作用户
become: yes #是否sudo
tasks:
- name: "安装zookeeper" #任务命名
command: yum -y install mesosphere-zookeeper #远程执行命令安装zook
- name: "启动zookeeper" #任务命名
service: #service模块
name: zookeeper #服务名zookeeper
state: started #动作started
- name: "设置开机启动" #任务命名
service: #service模块
name: zookeeper #服务名zookeeper
enabled: yes #enabled参数为YES开机启动