centos初次安装Elasticsearch,以及问题汇总

1 安装elasticsearch-7.1.1

官网下载elasticsearch,官网地址:Past Releases of Elastic Stack Software | Elastic

1.1 安装环境:

        centos7

        jdk-9.0.1

        elasticsearch-7.1.1

1.2 拷贝到服务器的/opt文件夹下并解压,然后修改配置文件

#
# 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: myes
#
# ------------------------------------ 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: 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):

# ip地址
network.host: 192.168.0.1
#
# Set a custom port for HTTP:

# 端口
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:

# 7.x 之后新增的配置,初始化一个新的集群时需要此配置来选举master,单节点时只需写当前节点
cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation 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

2 安装过程中问题记录

2.1 不能以root管理员账号启动,需要用普通账号启动

解决:创建普通账号,切换到普通账号之后启动即可

[root@192 /]# adduser kuiyou
[root@192 /]# passwd kuiyou
Changing password for user kuiyou.
New password: 

2.2 普通账号启动报错 

 解决:查询es宿主

[kuiyou@192 elasticsearch-1]$ ll config/

es的宿主是root账号,需要切换es的宿主机,用root账号切换

[root@192 elasticsearch-1]# chown -R kuiyou:kuiyou /opt/elasticsearch-1

 然后再查询

[kuiyou@192 elasticsearch-1]$ ll config/

2.3 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]问题

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

解决:修改/etc/security/limits.conf,增加以下内容

* soft nofile 65536
* hard nofile 65536

2.4 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]问题

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决:修改/etc/sysctl.conf,加入vm.max_map_count=655360

 重新加载/etc/sysctl.conf配置,使之生效

[root@192 etc]# sysctl -p

2.5 Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release 问题

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

垃圾回收器版本过低,进入 elasticsearch config配置文件中修改jvm.options

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值