ELK 6.4.3 OSS 버전 설치 구성

5864 단어 elasticsearch
OSS 버전은 준수Apache 2.0 licensed하며 오픈 소스 프로젝트에 속합니다.

Elasticsearch OSS 역인덱스 서비스


Elasticsearch OSS 6.4.3 다운로드 주소:https://www.elastic.co/downloads/past-releases/elasticsearch-oss-6-4-3
구성 파일의 압축을 풀려면 다음과 같이 하십시오.
#  
path.data: /data/disk/data/elasticsearch
#  
path.logs: /data/disk/log/elasticsearch
#  , ,centos6 。
bootstrap.memory_lock: false
#  , ,centos6 。
bootstrap.system_call_filter: false
#  
network.host: 0.0.0.0
#  
http.port: 9200

root 아래su ekl로 전환하고 bin/elasticsearch 실행합니다.결과를 보려면 다음과 같이 하십시오.
curl http://localhost:9200/

elasticsearch analysisik 분사 플러그인


elasticsearch-analysis-ik 다운로드 주소:https://github.com/medcl/elasticsearch-analysis-ik/releases

설치:


새 ik 디렉토리를 만들고 ik 디렉토리의 압축을 풉니다.
mkdir your-es-root/plugins/ik
unzip  elasticsearch-analysis-ik-6.4.3.zip -d your-es-root/plugins/ik

새 색인:
curl -XPUT http://localhost:9200/index

새 매핑
curl -XPOST http://localhost:9200/index/doc/_mapping -H 'Content-Type:application/json' -d'
{
        "properties": {
            "content": {
                "type": "text",
                "analyzer": "ik_max_word",
                "search_analyzer": "ik_max_word"
            }
        }

}'

Kibana OSS 시각 형상 개발 도구


Kibana OSS 6.4.3 다운로드 주소:https://www.elastic.co/downloads/past-releases/kibana-oss-6-4-3
설정elasticsearch.url부터 es:실행bin/kibana까지.http://localhost:5601에서 인터페이스를 볼 수 있습니다.

Logstash OSS에서 mysql을 ES로 동기화


Logstash OSS 6.4.3 다운로드 주소:https://www.elastic.co/downloads/past-releases/logstash-oss-6-4-3
파일 구성
input {
    jdbc {
      jdbc_driver_library => "mysql-connector-java-5.1.33-bin.jar"
      jdbc_driver_class => "com.mysql.jdbc.Driver"
      jdbc_user => "user"
      jdbc_password=> "password"
      jdbc_connection_string => "jdbc:mysql://192.168.0.100:3306/db"
      jdbc_validate_connection => "true"
      schedule => "* * * * *"
      use_column_value => true
      tracking_column => "id"
      last_run_metadata_path => "/data/.logstash_shandian_last_run"
      statement => "SELECT a.id, a.title, a.keywords, d.content FROM table_article a JOIN table_data d ON a.id=d.id WHERE a.id > :sql_last_value AND a.status=100 ORDER BY id ASC"
      jdbc_paging_enabled =>true
      jdbc_page_size => 10000
    }
}
filter {
    date {
      match => ["addline", "yyyy-MM-dd HH:mm:ss,SSS", "UNIX"]
      target => "@timestamp"
      locale => "cn"
    }
}
output {
    elasticsearch {
      hosts => ["http://192.168.0.200:9200"]
      index => "suoyin"
      document_id => "%{id}"
    }    
    stdout {
        codec => line {
            format => "suoyin: %{id} %{title}"
        }
    }
}


실행
bin/logstash -f logstash.conf

좋은 웹페이지 즐겨찾기