elk-6.1.2學習筆記_elasticsearch

來源:互聯網
上載者:User
elk-6.1.2學習筆記 一、環境centos7, elasticsearch-6.1.2 安裝openjdk-1.8:
yum install java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64
配置JAVA_HOME(~/.bash_profile):
# 添加JAVA_HOME=/usr/lib/jvm/javaPATH=$PATH:$JAVA_HOME/bin
修改檔案:/etc/sysctl.conf
# 執行sysctl -p生效vm.max_map_count = 262144
修改檔案:/etc/security/limits.conf
# 重新登入生效esearch soft nofile 65536esearch hard nofile 131072esearch soft nproc 2048esearch hard nproc 4096
修改檔案/etc/security/limits.d/90-nproc.conf
esearch soft nproc 4096
添加使用者組和使用者,es不能以root使用者運行
# 添加使用者組groupadd es# 查看使用者組cat /etc/group# 添加使用者,並指定組useradd esearch -g es# 設定使用者密碼passwd esearch
elk檔案,分別解壓出來
elasticsearch-6.1.2.zip logstash-6.1.2.tar.gz kibana-6.1.2-linux-x86_64.tar.gz 二、解壓elasticsearch,進入主目錄

1.修改檔案config/elasticsearch.yml

# 修改bootstrap.memory_lock: false# 添加bootstrap.system_call_filter: false

2.啟動

bin/elasticsearch# 以後台方式啟動bin/elasticsearch -d

3.驗證:http://localhost:9200 三、解壓kibana,進入主目錄

1.啟動kibana

bin/kibana# 以後台方式啟動nohup bin/kibana > /dev/null 2>&1 &

3.驗證:http://localhost:5601 四、解壓logstash,進入主目錄

1.建立設定檔my_date.conf,從oracle中匯入資料到elasticsearch

input {  jdbc {    jdbc_driver_library => "path/to/ojdbc6.jar"    jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"    jdbc_connection_string => "jdbc:oracle:thin:@ip:1521:orasid"    jdbc_user => "orauser"    jdbc_password => "orapwd"    parameters => { "max_num" => 100 }    statement => "select level my_rowno, sysdate + level my_date from dual connect by level < :max_num"  }}output {  elasticsearch {    hosts => "localhost:9200"    index => "my_date"    document_id => "%{my_rowno}"  }}

2.啟動

/bin/logstash -f my_date.conf
tips

1.elasticsearch-6.1.2/config/elasticsearch.yml

# 配置叢集cluster.name: mst-applicationnode.name: node-2discovery.zen.ping.unicast.hosts: ["ip1", "ip2"]# 指定訪問IPnetwork.host: 0.0.0.0

2.kibana-6.1.2-linux-x86_64/config/kibana.yml

# 指定訪問IPserver.host: "0.0.0.0"

3.elasticsearch結構為: index->type->document, 版本6中一個index只允許一個type

4.index相當於database table, document相當於database row

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.