Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ES personal virtual machine cluster installation steps

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "ES personal virtual machine cluster installation steps", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the "ES personal virtual machine cluster installation steps"!

ES personal virtual machine cluster installation

Environmental configuration

Operating system selection

System environment settin

Jvm environment variable

Elasticsearch installation configuration

Kibana installation configuration

Recommend centos7.x or ubuntu18.x

Command: configuration file: / etc/sysctl.conf

# disable swapping between memory and hard disk, which needs the help of operation and maintenance. Different environments may have different settings

Vm.swappiness=1

# set virtual memory size

Vm.max_map_count=262144

Command: configuration file: / etc/security/limits.conf; asterisk represents the user

# number of process threads

* soft nproc 131072

* hard nproc 131072

# number of file handles

* soft nofile 131072

* hard nofile 131072

# memory Lock swap

* soft memlock unlimited

* hard memlock unlimited

Command:

# create an ES account, such as elastic

Useradd elastic

# authorize ES program directory elastic account permissions

# assume that the ES program directory, data directory and log directory are all under the / gpes directory

Chown-R elastic:elastic gpes/*

Disable memory swapping to prevent insufficient memory and swap to disk, resulting in disk IO usage and performance degradation of memory locking

Mmpfile storage memory is required, and it may not work without configuration.

Set process thread limit. ES process has built-in multiple thread pools with a large number of threads.

Set the value of file handle. The ES index consists of many files, and a large number of files are opened.

Security restrictions for non-root accounts under Linux

Command

ES related programs need to open many ports http and tcp

Service firewalld stop

Chkconfig firewalld off

After the configuration is complete, you need to restart the system.

1. Fire prevention must be turned off:

two。 Set virtual memory size

Command: configuration file: / etc/profile; pay attention to the correct format in the configuration such as semicolon and java_home location

# the latest version of ES comes with jdk version, which does not need to be configured by default. It is recommended to install other java programs to assist you.

# JDK14.X is required to be installed in this content

Export JAVA_HOME=/gpes/jdk.xxx.xx

Export JRE_HOME=$JAVA_HOME/jre

Export PATH=$JAVA_HOME/bin;$PATH

Export CLASSPATH=.;$JAVA_HOME/lib;$JRE_HOME/lib

Responsible for not being able to use common custom java commands, such as jconsole,jps, etc.

Cd ${ES_HOME} / jdk/bin

. / java-version

ES comes with JDK by default. In the default environment, there is no need to set it. Check the OPEN JDK version that comes with it.

It is recommended to set the Java environment variable

Java environment variable: personal settings must be consistent with the officially recommended jdk version

Elasticsearch.yml core profile, node instance property parameters

Jvm.options configuration stack parameters, etc.

General configuration of log4j2.properties logs, default is fine.

Other

Cluster name: it does not need to be set by default. It is recommended.

Node name: no setting is required for a single instance. It must be set differently under the cluster. It is recommended to set it.

IP address: must be set. Default is local access only.

Access port: http port does not need to be set by default, tcp port, default requirement setting

Cluster Discovery:

Data catalog

Log directory

Memory locking

Number of threads or processors: recommended values for cpu and memory are 1:4

Discovery.xxx single node does not need to be configured

Cluster.xxx single node default recognition does not require configuration

Multi-disk directory setting, path.data can set array, can optimize points

Default directory, production environment pointing to disk

It is not set by default. It is recommended that you must set it.

Default parameters do not need to be modified

The number of processors is set carefully to determine the thread pool size.

Command: configuration file: {ES_HOME} / config/elaticsearch.yml

# Cluster name, which can not be modified by default. It is recommended to set it.

Cluster.name:gpes01

# Node name, which must be modified. It is changed to the current machine name by default, and must be set differently under the cluster.

Node.name:gpes_$ {HOSTNAME}

# IP address, default is local, local access only, public network is not accessible. General practice of setting 0.0.0.0

Network.host:0.0.0.0

# access port. Default http is 9200 and TCP is 9300. It is recommended to specify it explicitly.

Http.port:9200

Transport.port:9300

# data directory and log directory. By default, under the current running program, the production environment needs to be established.

# path.data:/path/to/data

# path.logs:/path/to/logs

# memory swap lock. Operating system settings are required to take effect.

Bootstrap.memory_lock:true

# prevent bulk deletion of indexes

Action.destructive_requires_name:true

# set the number of processors. It does not need to be set by default. Multiple instances on a single machine need to be set.

Node.processors:4

# Cluster Discovery configuration

# discovery.seed_hosts: ["192.168.86.102 discovery.seed_hosts 9300"]

Cluster.initial_master_nodes: ["192.168.86.102 9300"]

JDK selection

GC selection

Stack size

GC log

Gc.log path Settin

Self-configuration or self-configuration. The version of self-configuration must be the same as the version of JDK that comes with it.

7.8.1 G1 has been collected; the principle is to use G1MAI above and below G1MAI 14 to use CMS

No more than 1max 2 system memory

Free 1x2 free memory

The online memory should not exceed 32 GB and cannot be equal to 32 GB due to JVM reasons.

Command: configuration file: {ES_HOME} / config/jvm.options

# memory stack size, which cannot exceed 1x2 system memory. Be careful with multiple instances.

-Xms 1g

-Xmx 1g

# garbage collector CMS and G1, current CMS is still the best

8-13:-XX:+UseConcMarkSweepGC

14:-XX:+UseG1GC

# GC.log directory to facilitate troubleshooting of gc problems. Production needs to modify the path direction.

8:-Xloggc:logs/gc.log

Account Security / dynamic Generation / keystore Security File

Start the ES script

Current window launch:. / elasticsearch

Background process starts:. / elasticsearch-d

Wins system: elasticsearch.bat

Linux system:

Bin

Config

Jdk

Lib/modules

Plugins

Other

Startup scripts, common tool scripts

Configuration

Automatic jdk, optional, is openjdk

Program package

Own plug-ins and tripartite plug-ins

Data, default data

Logs, default log

ES file directory

Script command

Configuration file

Bin: startup scripts, common tool scripts

Config: file configuration: {KIBANA_HOME} / config/kibana.yml

# access port, which does not need to be modified by default

Server.port:5601

# access address IP. Default is local.

Server.host: "192.168.86.102"

# ES service is directed, and multiple configurations are configured under the cluster

Elasticsearch.hosts: ["http://192.168.86.102:9200"]

# Kibana metadata store index name. Default. Kibana does not need to be modified, dots cannot be removed, and suffixes can be modified.

Kibana.index: ".kibana"

Other: default, no need to care

Note:

Current window:. / kibana

Background startup: nohup. / kibana &

Start command

Winds system: kibana.bat

Linux system:

Security, language, others

Configuration is not required by default. Configuration modification is recommended.

IP address must be configured. Local access is limited by default.

Must be configured. Default is local only.

ES configuration points to

IP+PORT Settin

Metadata index silence

Other settin

You must delete the logs generated by the root account in ${ES_HOME} / logs

Rm-rf *

Cd logs/

Elasticsearch.keystore in ${ES_HOME} / config must be deleted

Rm elasticsearch.keystore

Cd config/

1. If you start with root for the first time, it will fail. For the second time, if you want to start with another user, delete some files that are automatically generated when you start with root.

File directory

Download address

Download software

Installation mode

Official address: https://www.elastic.co/cn/downloads

Elasticsearch: 7.8.1

Kibana: 7.8.1 is consistent with ES version

Chrome plug-in (unofficial): elasticsearch-head

It is not recommended for the time being, because the data storage will be stored in the physical machine directory rather than in the container

1. Buy SAAS products, Tencent Cloud / Aliyun / ES Cloud

two。 Offline package, recommended. It is recommended that xx.gz is similar to green version.

3. On-line packet

4. Container docker

1. Selection of installation mode

two。 System environment variable configuration

At this point, I believe you have a deeper understanding of the "ES personal virtual machine cluster installation steps". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report