chown -R ela.ela /opt/elasticsearch-6.3.2/
ls -l /opt/elasticsearch-6.3.2/
切换到ela用户,编辑配置文件,准备启动es
su ela
[ela@localhost ~]$ cd /opt/elasticsearch-6.3.2/config/
[ela@localhost config]$ sudo vim elasticsearch.yml
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: abner //打开设定es群集名称
#
# ------------------------------------ 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: /data/es-data //修改数据目录,此目录为自定义,需要在root用户下创建,且属主属组更改为ela
#
# Path to log files:
#
path.logs: /var/log/elasticsearch //日志目录位置,需自己创建,方式同上
//yum安装则系统自定义,在软件版本或者系统升级时会被删除,所以建议修改
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: true //elasticsearch官网建议生产环境需要设置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: 0.0.0.0 //监听访问地址为任意网段
#
# Set a custom port for HTTP:
#
http.port: 9200 //服务监听端口
#