1. 程式人生 > >ElasticSearch 5.4 Linux安裝教程

ElasticSearch 5.4 Linux安裝教程

首先新建使用者,es規定root使用者不能啟動es,所以必須新建使用者

groupadd es

useradd -g es es

chown es:es elasticsearch-5.4.1.zip

su es 切換到es使用者執行以下命令操作

unzip elasticsearch-5.4.1.zip 解壓縮

如果你只想玩玩單機版的話,解壓縮直接就可以使用了

如果你想做叢集測試,請繼續往下看

ln -s elasticsearch-5.4.1 es生成一個快捷方式,方便記憶路徑

cd es/config 進入es的配置資料夾,其實在linux上的很多開源軟體都喜歡把配置檔案放在config/conf資料夾下面

修改叢集配置,下面是完整的elasticsearch.yml配置檔案

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       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: edgeserver #叢集名稱,要部署為同一個叢集,這個名稱必須相同
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1 #節點名稱,節點名稱不能相同,是節點的標識
#
# 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: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: false  #這兩個配置最好配置上,否則會報錯
bootstrap.system_call_filter: false  #這兩個配置最好配置上,否則會報錯
#
# 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 -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 10.100.124.205 #要對外開放的IP地址
#
# Set a custom port for HTTP:
#
http.port: 9200 #restful介面呼叫埠
transport.tcp.port: 9300  #叢集內部傳輸埠
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
# #叢集裡所有的ip地址和埠
discovery.zen.ping.unicast.hosts: ["10.100.124.205:29300", "10.100.124.206:29300", "10.100.124.207:29300", "10.100.124.208:29300"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
xpack.security.enabled: false #如果你安裝了xpack,這個要配置上,否則叢集的節點之間無法通訊,因為要登入密碼

# ======================== Elasticsearch Configuration =========================

把elasticsearch拷貝到其他叢集節點上,修改上面配置檔案的節點名稱(node.name)即可

啟動叢集

在各節點上進入es/bin

執行:./elasticsearch -d

測試

curl "http://10.100.124.205:29200/"

{
  "name" : "node-1",
  "cluster_name" : "edgeserver",
  "cluster_uuid" : "n8My_gsHR6GYLdvCHV1-Ug",
  "version" : {
    "number" : "5.4.0",
    "build_hash" : "780f8c4",
    "build_date" : "2017-04-28T17:43:27.229Z",
    "build_snapshot" : false,
    "lucene_version" : "6.5.0"
  },
  "tagline" : "You Know, for Search"
}

像類似的返回,表示啟動節點成功

curl "http://10.100.124.205:29200/_cat/nodes"

10.100.124.205 37 93 8 1.01 1.04 1.02 mdi * node-1
10.100.124.207 37 95 0 0.00 0.00 0.00 mdi - node-3
10.100.124.208 56 85 0 0.13 0.08 0.02 mdi - node-4
10.100.124.206 57 99 0 0.17 0.12 0.09 mdi - node-2

根據返回結果,可以知道叢集的4個節點都啟動好了

聽說,打賞我的人最後都找到了真愛。

相關推薦

ElasticSearch 5.4 Linux安裝教程

首先新建使用者,es規定root使用者不能啟動es,所以必須新建使用者 groupadd es useradd -g es es chown es:es elasticsearch-5.4.1.zip su es 切換到es使用者執行以下命令操作 unz

qt 5.3 linux安裝教程

今天試用QT 5.3 for linux,發現很多功能無法正常使用。 例如不能正常編譯,不能自動檢測編譯環境,原來需要進行環境適配: 命令列匹配:Debian/Ubuntu (apt-get) s

5.4 Linux 安裝2個tomcat

sna image 一個 linu shu false 1.3 同時 src Linux系統下怎樣配置多個Tomcat同時運行呢,首先第一個tomcat配置不變,然後修改第二個tomcat啟動的腳本 拷貝第一個tomcat的目錄到第二個tomcat目錄 [root@esh

ElasticSearch 5.4 安裝

nload text 學習 master mas nbsp 自動 table 安裝包 1. 前期準備    環境準備 IP地址 操作系統 內存 192.168.1.10 centos 7 16 192.168.1

Elasticsearch入門二:Elasticsearch.5.4.3+kibana5.4.3+word分詞叢集linux搭建

一.軟體版本 jdk-8u191-linux-x64.tar.gz elasticsearch-5.4.3.tar.gz kibana-5.4.3-linux-x86_64.tar.gz word-master.zip 二.環境搭建

Linux mysql-5.7.17安裝 教程

1.下載安裝檔案 #mkdir /data #mkdir /data/software #cd  /data/software #wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-linux-gl

ElasticSearch 6.5.4 RPM安裝

最近釋出的ElasticSearch版本6.5.4基本不釋出tar.gz包了(被官網隱藏了),只發布DEB、RPM、MSI和Mac上的軟體包,確實比較容易安裝多了。 下載rpm包: #wget https://artifacts.elastic.co/downloads/elasticsearc

Weblogic12c for Linux安裝教程

weblogic linux Weblogic for Linux軟件安裝流程3.1 主機環境要求本次環境使用一臺CentOS6.5服務器安裝weblogic12c,在同一臺主機上運行管理服務器和受管理服務器,共建立兩臺受管理服務器new_ManagedServer_1、new_ManagedServ

Elasticsearch 5.4.3實戰--Java API調用:搜索

fas ack 聚合 turn result ets str iterator ise ES有多種查詢方式,我自己的業務是需要對多個字段進行查詢,具體實現類代碼如下。 1 package com.cs99lzzs.elasticsearch.service.imp

MySQLzip archive版本(5.7.19)安裝教程

引擎 sta bold col ews 之前 mysql5 操作 -i 1. 從官網下載zip archive版本http://dev.mysql.com/downloads/mysql/ 2. 解壓縮至相應目錄,並配置環境變量(將*\bin添加進path中); 3.

ElasticSearch 5.4 自定義插件

pro rac script 倉庫 函數定義 數據 col alt .cn   ElasticSearch 做為數據倉庫處理速度確實很強,但是很多和業務相關的函數ElasticSearch怎麽支持的,通過查詢發現,ElasticSearch支持自定義插件(相當於自定義函數)

mac 下搭建Elasticsearch 5.4.3分布式集群

kdt arch 技術 知識庫 ica add software 軟件 nts 一、集群角色 多機集群中的節點可以分為master nodes和data nodes,在配置文件中使用Zen發現(Zen discovery)機制來管理不同節點。Zen發現是ES自帶的默認發現

elasticsearch-5.6.0安裝錯誤摘記

5.6 需要 with oot 用戶組 pre nta arch exc    [2017-09-17T06:00:22,511][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught except

Elasticsearch 5.4.3 聚合分組

fail ast 原因 商品 不用 rom 需求 屬性 讓我 第一個分析需求:計算每個tag下的商品數量 GET /ecommerce/product/_search { "aggs": { "group_by_tags": { "

Elasticsearch 5.4 Mapping詳解

targe AI ref last OS clas class 5.4 blog 這裏面講解的mapping說的很清楚了。 http://blog.csdn.net/napoay/article/details/73100110 修改mapping就比較坑了:

elasticsearch-5.1.1 安裝的問題

問題 str oca 內容 error: 編輯 clas 遇到 trap elasticsearch 5.1 安裝過程中遇到了一些問題做一些記錄。 問題一:警告提示 [2016-12-20T22:37:28,543][INFO ][o.e.b.BootstrapCheck

最詳細的虛擬機器linux安裝教程

Linux安裝 一、概要 介紹 Linux的安裝、常用命令、遠端訪問等入門級知識。學完本課程,具備初級軟體工程師對Linux知識的要求。 Linux 學習過程: 首先在 Windows下安裝虛擬機器管理軟體VMWare Workstation Pro 1

5.第5講-linux視訊教程5講 檔案許可權 使用者組1

檔案許可權 使用者組1 ### 1. 檔案所有者、所有組和其他組 ### ###2.檔案所有者、所在組和其他組### ** 如何在linux中新增組** -groupadd policeman 檢視linux中所有組的資訊 -vi /etc/group 看了可以修改 -cat

ElasticSearch-6.4.1安裝中文分詞器Analysis-ik.

一:使用背景和安裝過程.         1. ElasticSearch-6.4.1.(Windows環境下)         &nbs

Elasticsearch-5.4.0叢集搭建

1、Elasticsearch-5.4.0 安裝包下載地址:https://www.elastic.co/downloads/past-releases/elasticsearch-5-4-0 2、解壓檔案:tar -zxvf /home/elasticsearch-5.4.0.tar.gz -