zoukankan      html  css  js  c++  java
  • nginx的role理解

    1.整体文件框架

     2.调用主机和目标任务

    [root@ks-allinone myansible_roles]# cat elasticsearch_service.yml 
    ---
    - hosts: huidu
      roles:
      - role: elasticsearch

    3.es配置

    [root@ks-allinone elasticsearch]# cat files/elasticsearch.yml 
    cluster.name: do1
    node.name: node-1
    path.data: /wxqyh/component/elasticsearch-6.2.2/data
    path.logs: /wxqyh/component/elasticsearch-6.2.2/logs
    network.host: 0.0.0.0
    http.port: 9200

    4.安装es步骤

    [root@ks-allinone elasticsearch]# cat tasks/main.yml 
    - include_tasks: install.yml
    - include_tasks: config.yml
    - include_tasks: start.yml
    [root@ks-allinone elasticsearch]# cat tasks/install.yml 
    - name: useradd esuser
      shell: useradd esuser
    
    - name: unpackage software
      shell: tar -zxf /wxqyh/soft/elasticsearch-6.2.2.tar.gz -C /wxqyh/component/
    
    - name: mkdir -p data
      shell: mkdir -p  /wxqyh/component/elasticsearch-6.2.2/data
    
    - name: mkdir -p logs
      shell: mkdir -p /wxqyh/component/elasticsearch-6.2.2/logs
    
    - name: change permission
      shell: chown -R esuser.esuser /wxqyh/component/elasticsearch-6.2.2/
    
    - name: max map count
      shell: grep "vm.max_map_count" /etc/sysctl.conf || echo "vm.max_map_count = 655360" >> /etc/sysctl.conf
    
    - name: soft nofile
      shell: grep 'esuser soft nofile 65535' /etc/security/limits.conf || sed -i '$i esuser soft nofile 65536' /etc/security/limits.conf
    
    - name: hard nofile
      shell: grep 'esuser hard nofile 65535' /etc/security/limits.conf || sed -i '$i esuser hard nofile 65536' /etc/security/limits.conf
    
    - name: sysctl -p
      shell: sysctl -p
    
    - name: plugin install
      shell: /wxqyh/component/elasticsearch-6.2.2/bin/elasticsearch-plugin install file:////wxqyh/soft/elasticsearch-analysis-ik-6.2.2.zip
    [root@ks-allinone elasticsearch]# cat tasks/start.yml 
    - name: start es service
      shell: su esuser -c "/wxqyh/component/elasticsearch-6.2.2/bin/elasticsearch -d &"
    [root@ks-allinone elasticsearch]# 

     参考: http://www.zhangblog.com/2020/01/09/ansible-12/

  • 相关阅读:
    Yii2 使用 Beanstalk 队列系统
    Yii2 注册表单验证规则 手机注册时候使用短信验证码
    Yii2 高级模板 多域名管理问题
    PHP生成缩略图,控制图片质量,支持.png .jpg .gif
    yii2-lock-form 也许这就是你想要的,阻止表单多次提交
    PHP日期与时间戳转换
    PHP/Yii2操作Cookie,常见问题以及注意事项
    对称加密,API加密
    yii2弹出层
    两种不同的Context
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/12964306.html
Copyright © 2011-2022 走看看