• 利用saltstack一键部署多台zookeeper


    以上是saltstack上面sls文件存放zookeeper的路径和文件

    以上是入口文件把文件夹做成包

    重要安装配置在zoo.sls,以下是该sls的内容

    zookeeper:
    file.managed:
    - name: /root/zookeeper-3.4.6.tar.gz
    - source: salt://test/zoo/zookeeper-3.4.6.tar.gz
    - user: root
    - group: root
    - mode: '644'

    install-package:
    cmd.run:
    - cwd: /opt/
    - name: tar zxvf /root/zookeeper-3.4.6.tar.gz

    configure:
    file.managed:
    - name: /opt/zookeeper-3.4.6/conf/zoo.cfg
    - source: salt://test/zoo/zoo.cfg
    - user: root
    - group: root
    - mode: '644'

    service_profile:
    cmd.run:
    - names:
    - echo -e 'export ZK_HOME=/opt/zookeeper-3.4.6' >> /etc/profile
    - echo -e 'export PATH=$ZK_HOME/bin:$PATH' >> /etc/profile
    - source /etc/profile
    - require:
    - file: zookeeper

    mkdir_log:
    cmd.run:
    - cwd: /opt/zookeeper-3.4.6
    - name: mkdir log
    - require:
    - file: zookeeper

    service_running:
     cmd.run:
     - name:
     - zkServer.sh start
     - require:
     - file: jdk

    jdk:
     file.managed:
     - name: /root/jdk-8u151-linux-x64.tar.gz
     - source: salt://test/zoo/jdk-8u151-linux-x64.tar.gz
     - user: root
     - group: root
     - mode: '0755'

    install_jdk:
     cmd.run:
     - cwd: /opt
     - name: tar zxvf /root/jdk-8u151-linux-x64.tar.gz

    然后执行 salt “zookeeper” salt.sls  test.zoo

  • 相关阅读:
    NHbiernate 配置
    NHibernate开发入门
    Thread 线程简单例子
    C#中委托和事件
    DataGridView 去掉多余的列
    ASP.NET C# 有程序集加不了解决办法
    oracle“记录被另一个用户锁住”
    Android 控件属性
    Android 入门
    MVC 视频笔记
  • 原文地址:https://www.cnblogs.com/otosis/p/10044902.html
Copyright © 2020-2023  润新知