linux安装部署elasticsearch 配置账号密码 配置Ik分词器
1.安装elasticsearch
1.1下载对应安装包
我这边用的是7.17.6的安装包
1.2 对安装包进行解压
#如果需要指定目录名称 在后面追加
tar -zxvf elasticsearch-7.17.6-linux-x86_64.tar.gz
1.3.配置elasticsearch文件
配置 elasticsearch-7.17.6/config/elasticsearch.yml 文件
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: xxx-xxx
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# 节点名称
node.name: node-test
#
# 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: /usr/local/elasticsearch-7.17.6/data
#
# Path to log files:
#日志文件
path.logs: /usr/local/elasticsearch-7.17.6/logs
#
#network.host: 192.168.0.1
#如果需要外网访问设置成0.0.0.0
network.host: 0.0.0.0
#端口号
http.port: 9200
cluster.initial_master_nodes: ["node-test"]
1.4.配置jvm.options文件
配置 elasticsearch-7.17.6/config/jvm.options 文件
## IMPORTANT: JVM heap size
################################################################
##
## The heap size is automatically configured by Elasticsearch
## based on the available memory in your system and the roles
## each node is configured to fulfill. If specifying heap is
## required, it should be done through a file in jvm.options.d,
## and the min and max should be set to the same value. For
## example, to set the heap to 4 GB, create a new file in the
## jvm.options.d directory containing these lines:
##
-Xms1024m
-Xmx1024m
1.5.进入bin文件目录启动es
#使用后台启动
./elasticsearch -d