zoukankan      html  css  js  c++  java
  • 给Elasticsearch 5.2.2 设置用户权限 how to setting security for elasticsearch on windows

    1. download the plugin of elasticsearch: 

    下载 readonlyrest-1.14.0_es5.2.2.zip

    2. install readonlyrest plugin: 

    C:UsersAdministratorDownloadselasticsearch-5.2.2inelasticsearch-plugin.bat install file:///d:/readonlyrest-1.14.0_es5.2.2.zip

    3. open elasticsearch.yml add blow code:

    readonlyrest:
        enable: true
        response_if_req_forbidden: Sorry, your request is forbidden.
        access_control_rules:
        - name: Full access with HTTP auth
          auth_key: admin:123456  #user: admin, password:123456
          type: allow
    

    4. restart elasticsearch service.

    5. done;

    logstash配置:

    input {  
          file {
              path => "D:/logstash-5.2.2/bin/testdata.txt"
              start_position => "beginning"
              sincedb_path => "D:/logstash-5.2.2/bin/sincedb"
              codec => json {
                charset => "UTF-8"
            }       
          }
    }
    filter {  
       json{
       source => "message"
       }
    
       
        mutate
        {
            remove_field => [ "message","path","@version","@timestamp","host","_id","value"]
        }
    }
    output {  
        elasticsearch {
            action => "index"
            hosts => ["http://localhost:9100/"] 
            user => "admin"
            password => "123456"
         
            index => "testdb"
            document_type => "user"
            workers => 1
        }
         #stdout {
             #codec => rubydebug
             #codec => json_lines
         #}
    } 
  • 相关阅读:
    清空
    从一个例子看现代C++的威力
    C++11实现一个自动注册的工厂
    REST RPC架构思想
    thinking in object pool
    worksteal thread pool
    check member function
    C# string 常用功能的方法扩展
    C#设计模式总结
    JAVA过滤器和拦截器的区别
  • 原文地址:https://www.cnblogs.com/haoliansheng/p/6544124.html
Copyright © 2011-2022 走看看