环境:
ubuntu 18.04,ubuntu 16.04(本次实验操作环境,如果系统是CentOS8 内核4.4一样可以用)
在 linux 操作系统中,查看内核版本的命令是: uname -a
我习惯使用 lsb_release查看。
ElasticSearch6.X 版本要求 JDK 版本至少是 1.8.0_131。 提供 1.8.0_161JDK 安装包。
默认已经装好jdk。
软件具体版本:

部署es(单机,集群)
ElasticSearch 在 Linux 中安装部署的时候,需要系统为其提供若干系统配置。如:应用可启动的线程数、应用可以在系统中划分的虚拟内存、应用可以最多创建多少文件等。
1 配置操作系统环境:
1.1 修改限制信息
vi /etc/security/limits.conf
系统中允许应用最多创建多少文件等的限制权限。Linux 默认来说,一般限制应 用最多创建的文件是 65535 个。但是 ElasticSearch 至少需要 65536 的文件创建权限。修 改后的内容为:
soft nofile 65536
hard nofile 65536
1.2 修改线程开启限制
vi /etc/security/limits.conf
系统中允许用户启动的进程开启多少个线程。默认的 Linux 限制 root 用户开启 的进程可以开启任意数量的线程,其他用户开启的进程可以开启 1024 个线程。必须修改限 制数为 4096+。因为 ElasticSearch 至少需要 4096 的线程池预备。ElasticSearch 在 5.x 版本之后,强制要求在 linux 中不能使用 root 用户启动 ElasticSearch 进程。所以必须使用 其他用户启动 ElasticSearch 进程才可以。
soft nproc 4096
root soft nproc unlimited
注意:Linux 低版本内核为线程分配的内存是 128K。4.x 版本的内核分配的内存更大。 如果虚拟机的内存是 1G,最多只能开启 3000+个线程数。至少为虚拟机分配 1.5G 以上的 内存
我的limits.conf文件内容:
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - a user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
# - NOTE: group and wildcard limits are not applied to root.
# To apply a limit to the root user, <domain> must be
# the literal username root.
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes

本文档详细介绍了如何在Ubuntu 16.04和18.04上安装和配置Elasticsearch 6.8.4以及部署Kibana。首先,调整系统配置,包括修改`limits.conf`和`sysctl.conf`以允许更多文件和线程。接着,解压缩Elasticsearch并更改其所有者,配置网络访问,然后启动和测试服务。对于集群部署,通过修改配置文件设置发现的节点IP和最小集群数。最后,安装Kibana,配置并启动服务,通过浏览器访问进行验证。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



