日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Elasticsearch安装(Linux)

發布時間:2024/9/30 linux 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Elasticsearch安装(Linux) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

目錄

  • 簡介
    • Elasticsearch具備以下特點:
  • 安裝
    • 文件目錄
  • 啟動

簡介

Elasticsearch 是一個分布式可擴展的實時搜索和分析引擎,一個建立在全文搜索引擎 Apache Lucene? 基礎上的搜索引擎.當然 Elasticsearch 并不僅僅是 Lucene 那么簡單,它不僅包括了全文搜索功能,還可以進行以下工作:

  • 分布式實時文件存儲,并將每一個字段都編入索引,使其可以被搜索。
  • 實時分析的分布式搜索引擎。
  • 可以擴展到上百臺服務器,處理PB級別的結構化或非結構化數據

面對這樣復雜的搜索業務和數據量,使用傳統數據庫搜索就顯得力不從心,一般我們都會使用全文檢索技術,比如Solr,Elasticsearch。

Elastic官網:https://www.elastic.co/cn/

Elastic有一條完整的產品線及解決方案:Elasticsearch、Kibana、Logstash等,前面說的三個就是大家常說的ELK技術棧。

Elasticsearch
(官網:https://www.elastic.co/cn/products/elasticsearch )是Elastic Stack 的核心技術。詳細介紹參考官網

Elasticsearch具備以下特點:

  • 分布式,無需人工搭建集群(solr就需要人為配置,使用Zookeeper作為注冊中心)
  • Restful風格,一切API都遵循Rest原則,容易上手近實時搜索,數據更新在Elasticsearch中幾乎是完全同步的。

安裝

官網下載,選擇linux版本:

https://www.elastic.co/cn/products/elasticsearch

我下載完放在了 usr/dev文件夾下

解壓

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

重命名
mv elasticsearch-7.12.0 elasticsearch

為elaticsearch創建用戶并賦予相應權限
此時在 bin/dev 文件夾下

adduser espasswd eschown -R es:es elasticsearch/chmod 770 elasticsearch/

文件目錄


配置文件都在config文件夾下

cd config vi jvm.options


編輯elasticsearch.yml修改數據和日志目錄

vi elasticsearch.yml # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please consult the documentation for further information on configuration options: # https://www.elastic.co/guide/en/elasticsearch/reference/index.html # # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # cluster.name: my-application #默認是被注釋的,并且默認有一個集群名 # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: node-1 #配置當前es節點名稱(默認是被注釋的,并且默認有一個節點名) # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # path.data: /home/es/data # 數據目錄位置 注意把這兩文件夾的權限給es用戶 # # Path to log files: # path.logs: /home/es/logs # 日志目錄位置 # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup:#bootstrap.memory_lock: true # # Make sure that the heap size is set to about half the memory available # on the system and that the owner of the process is allowed to use this # limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # ---------------------------------- Network ----------------------------------- # # By default Elasticsearch is only accessible on localhost. Set a different # address here to expose this node on the network: # network.host: 0.0.0.0 #綁定的ip:默認只允許本機訪問,修改為0.0.0.0后則可以遠程訪問 # # By default Elasticsearch listens for HTTP traffic on the first free port it # finds starting at 9200. Set a specific HTTP port here: # #http.port: 9200 # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when this node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # #discovery.seed_hosts: ["host1", "host2"] # # Bootstrap the cluster using an initial set of master-eligible nodes: # cluster.initial_master_nodes: ["node-1"] #默認是被注釋的 設置master節點列表 用逗號分隔 # # For more information, consult the discovery and cluster formation module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices:

node.name: node-1 #配置當前es節點名稱(默認是被注釋的,并且默認有一個節點名)
cluster.name: my-application #默認是被注釋的,并且默認有一個集群名
path.data: /home/es/data # 數據目錄位置
path.logs: /home/es/logs # 日志目錄位置
network.host: 0.0.0.0 #綁定的ip:默認只允許本機訪問,修改為0.0.0.0后則可以遠程訪問
cluster.initial_master_nodes: [“node-1”, “node-2”] #默認是被注釋的 設置master節點列表 用逗號分隔

啟動

此時在elasticsearch文件夾下

su es ./bin/elasticsearch

總結

以上是生活随笔為你收集整理的Elasticsearch安装(Linux)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。