windows下elasticsearch安装配置及ik分词器安装

下载elasticsearch最新版本(当前最新版本6.4.1):https://www.elastic.co/cn/downloads/elasticsearch
解压压缩包至指定路径,程序启动入口 elasticsearch-6.4.0\bin\elasticsearch.bat
elasticsearch 启动闪退解决:elasticsearch 依赖JDK,必须是1.8以上版本JDK
安装配置1.8版本以上JDK,为 elasticsearch 指定JDK 路径。
配置JDK1.8环境变量 ES_JDK : C:\Program Files\Java\jdk1.8.0_181
打开 elasticsearch-6.4.0\bin\elasticsearch-env

# now set the path to java
if [ -x "$ES_JDK/bin/java" ]; then
  JAVA="$ES_JDK/bin/java"
else
  set +e
  JAVA=`which java`
  set -e
fi

大概在39 - 40 行 将JAVA_HOME换成刚刚配置的ES_JDK。
打开 elasticsearch-6.4.0\bin\elasticsearch-env.bat

rem now set the path to java
if defined JAVA_HOME (
  set JAVA="%ES_JDK%\bin\java.exe"
) else (
  for %%I in (java.exe) do set JAVA="%%~$PATH:I"
)
在19 - 20 行 将set JAVA="%JAVA_HOME%\bin\java.exe" 改成 set JAVA="%ES_JDK%\bin\java.exe"

elasticsearch 程序启动成功。
elasticsearch 基本配置,打开 elasticsearch-6.4.0\config\elasticsearch.yml

 # ---------------------------------- Cluster -----------------------------------
    # Use a descriptive name for your cluster:集群名称
    cluster.name: xxx
    # ------------------------------------ Node ------------------------------------
    # Use a descriptive name for the node:节点名称
    node.name: xxx
    # Add custom attributes to the node:
    #node.attr.rack: r1
    # ----------------------------------- 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 -----------------------------------
# Set the bind address to a specific IP (IPv4 or IPv6):
#network.host: 192.168.0.1 
network.host: 127.0.0.1
# Set a custom port for HTTP:
http.port: 9200
#transport.tcp.port: 9300
# For more information, consult the network module documentation.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值