• 當前位置:首頁 > IT技術 > 其他 > 正文

    ES的安裝及Kibana的安裝配置
    2022-04-25 23:07:10

    一、安裝ES

    es不能以root用戶啟動,需要創建一個新用戶

    密碼復雜點不要使用elasticsearch

    adduser elasticsearch
    passwd elasticsearch

    安裝ElasticSearch:文件上傳置:/home/soft/elk為例

    解壓:

    tar -zxvf elasticsearch-7.14.0-linux-x86_64.tar.gz

    修改配置文件/elasticsearch-7.14.0/cofng/elasticearch.yum中找到以下每一行修改:

    node.name: node‐1
    network.host: 0.0.0.0
    http.port: 9200
    discovery.seed_hosts: ["127.0.0.1"]
    cluster.initial_master_nodes: ["node‐1"]

    二、安裝kibana:文件上傳置:/home/soft/elk為例

    解壓:

    tar -zxvf kibana-7.14.0-linux-x86_64.tar.gz

    修改配置文件/kibana-7.14.0/cofng/kibana.yum中找到以下每一行修改:

    server.port: 5601
    server.host: "0.0.0.0"
    elasticsearch.url: "http://127.0.0.1:9200"
    kibana.index: ".kibana"

    三、啟動ES及Kibana給elasticsearch用戶分配目錄權限

    chown -R elasticsearch:elasticsearch /home/soft/elk

    啟動elasticsearch及kibana

    su elasticsearch
    #啟動ES
    cd elasticsearch/bin
    ./elasticsearch -d
    #啟動kibana
    cd kibana/bin
    nohup ./kibana &

    注意:如果ES出現如下錯誤:則切入到root用戶

    1、65535錯誤

    ?修改文件/etc/security/limits.conf

    最后加入:

    # End of file
    root soft nofile 65535
    root hard nofile 65535
    * soft nofile 65535
    * hard nofile 65535
    root soft nofile 65535
    root hard nofile 65535
    * soft nofile 65535
    * hard nofile 65535

    2、262114錯誤

    max virtual memory areas vm.max_map_count [65530] is too low, increase to at least[262144]

    執行以下命令:

    sysctl -w vm.max_map_count=262144

    查看命令是否已執行:

    sysctl -a|grep vm.max_map_count

    修改配置文件

    vm.max_map_count=262144

    立即啟用生效

    sysctl -p

    四、安裝IK分詞器

    • 下載對應版本的ik分詞器
    • 在plugins文件夾下創建ik文件夾
    • 將解壓后的壓縮包里面的內容拷貝到ik下

    五、安裝ingest-attachment管道

    bin目錄下執行以下命令

    ./elasticsearch-plugin install ingest-attachment

    定義文本抽取管道:fileContent定義的接受字段的名稱

    PUT /_ingest/pipeline/attachment
    {
        "description": "Extract attachment information",
        "processors": [
            {
                "attachment": {
                    "field": "fileContent",
                    "ignore_missing": true
                }
            },
            {
                "remove": {
                    "field": "fileContent"
                }
            }
        ]
    }

    六、基本操作命令

    #刪除索引 data_parse
    DELETE data_parse #查詢索引data_parse中所有數據 GET data_parse
    /_search { "query": { "match_all": {} } } #刪除索引data_parse中_id的數據。_doc是_type的值 DELETE data_parse/_doc/1508795797896953856 #查詢所有的索引 GET _cat/indices

    ?

    本文摘自 :https://www.cnblogs.com/

    開通會員,享受整站包年服務
    国产呦精品一区二区三区网站|久久www免费人咸|精品无码人妻一区二区|久99久热只有精品国产15|中文字幕亚洲无线码