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/

  • 相关阅读:
    js+分布上传大文件
    java+大文件断点续传
    word粘贴图片到ekitor
    ckeditor从word粘贴图片
    word粘贴图片到ckeitor
    2g 大文件上传
    php+大视频文件上传+进度条
    java+Word图片上传控件
    断点续传管理系统
    富文本编辑器粘贴复制Word
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/12964306.html
Copyright © 2011-2022 走看看