A, jdk installation
1. Download the JDK
.JDK Download: Click direct link to the official website to download add description
2. Extract and install
tar -zxvf the JDK-11.0.4_linux-x64_bin.tar.gz
mkdir -p / usr / local / the JDK /
Music Videos JDK-11.0.4 / usr / local / JDK /
3. configure the environment variables
VI / etc / Profile
Export the JAVA_HOME = / usr / local / JDK / JDK-11.0.4
Export the JAVA_HOME $ the PATH = / bin: $ the PATH
Export = the CLASSPATH:. $ the JAVA_HOME / lib / Dt.jar: $ the JAVA_HOME / lib
4. compile
Source / etc / Profile
5. The view
java -version
two, es install and configure
1. Download
wget https://artifacts.elastic.co /downloads/elasticsearch/elasticsearch-7.3.0-linux-x86_64.tar.gz
2. extract the
tar -zxvf elasticsearch-7.3.0-linux- x86_64.tar.gz
-
New account and authorize
Elasticsearch # requires super user root can not be used to run, so we set up a test account
groupadd testesuseradd testesuser -g testes -p 123456 然后,给testesuser用户elasticsearch目录的授权。 chown -R testesuser:testes /usr/local/es/ 切换至elasticsearch目录,并以testesuser用户运行 su testesuser 这个用户专门用来给es操作的,如启动,暂停等。。。 4.启动服务 在es安装目录下进入bin文件夹 运行elasticsearch,如果想后台运行后面加 -d,es默认会启动http 9200端口,tcp 9300端口 5.防火墙添加 firewall-cmd --zone=public --add-port=9200/tcp --permanent firewall-cmd --zone=public --add-port=9300/tcp --permanent firewall-cmd --reload 6.测试 方法1 直接通过浏览器测试
Test Method 2 curl
curl HTTP: // localhost: 9200
Third, the directory structure
• home directory: Use $ ES_HOME expressed
• bin /: location $ ES_HOME / bin, contains elasticsearch and elasticsearch-plugin scripting
• conf /: $ Location ES_HOME / config, and contains the profile elasticsearch.yml log4j2.properties, using path.conf specified
• data /: location $ ES_HOME / data, comprising for each index / shard data file, a plurality of positions can be specified, using the path .data specified
• logs /: location $ ES_HOME / logs, use path.logs specified
• plguins /: location ES_HOME $ / plugins
• repo /: use path.repo specified, no default position, indicates the position of the shared file system repository. You can specify a plurality of positions.
• script /: location $ ES_HOME / scripts, use path.scripts specified.
Fourth, start the service being given to solve
1.curl port error
. Curl http://192.168.43.96:9200 rejected the connection
默认是通过127.0.0.1启动的 ,需要修改配置文件
network.host: 192.168.43.96
http.port: 9200
2.ERROR: bootstrap checks failed
max file descriptors [10240] for elasticsearch process likely too low, increase to at least [65536]
切换到root用户
vi /etc/security/limits.conf
#添加如下内容:
- soft nofile 65536
- hard nofile 131072
- soft nproc 4096
-
hard nproc 4096
修改/etc/sysctl.conf
#添加下面配置:
vm.max_map_count=655360
执行命令:sysctl -p
注意:如果仍然提示异常
max file **
max number **
max virtual **
The above parameters can file size can be adjusted to solve the prompts.
sysctl -p save command execution
3.the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
to modify XX-nproc.conf (different machines XX is not the same, you can view the first-cd /etc/security/limits.d/)vi /etc/security/limits.d/20-nproc.conf * soft nproc 4096(改为4096,原来为1024) 在 elasticsearch.yml中添加配置项:bootstrap.system_call_filter为false: bootstrap.memory_lock: false bootstrap.system_call_filter: false cluster.initial_master_nodes: ["node-1"]