1.下载:建议从服务器平台提供所支持的类型下载,示例:华为云

2.创建文件夹解压目录: 示例- /home/es
cd /home
mkdir es

3.进入目录下解压
cd /es
tar -zxvf elasticsearch-7.10.0-linux-aarch64.tar.gz

4.es不能在root用户下启动,必须创建新的用户,用来启动es 示例:创建用户:es
useradd es

5.使用 root 用户对 es 用户进行授权
chown -R es:es elasticsearch-7.10.0

6、配置内存 修改config/jvm.options为内存的一半大小
cd elasticsearch-7.10.0
vi config/jvm.options
-Xms512m
-Xmx512m

7、配置资源限额 修改 max file 和 max virtual memory 参数
用root 或 sudo 用户
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p

8、 修改/etc/security/limits.conf
vi /etc/security/limits.conf

/* soft nofile 65536
/* hard nofile 65536
/* soft nproc 4096
/* hard nproc 4096
EOF

9.修改elasticsearch.yml
vi /home/es/elasticsearch-7.10.0/config/elasticsearch.yml

cluster.name: elasticsearch 集群名称,唯一确定一个集群。
node.name: node-1 #节点名称一个集群中的节点名称是唯一固定的,不同节点不能同名
network.host: 0.0.0.0
http.port: 9200
node.max_local_storage_nodes: 2 #没有可不配置
http.cors.enabled: true #没有可不配置
http.cors.allow-origin: "*" #没有可不配置

10.切换es用户启动
su es
cd /home/es/elasticsearch-7.10.0/bin
./elasticsearch -d #-d : 后台运行,不加则为运行并输入日志

注:安装后出现如下问题,致使elasticsearch无法启动

[root@zookeeper01 bin]# su - es -c '/app/elasticsearch-6.5.4/bin/elasticsearch -d
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.
Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
An error report file with more information is saved as:

配置elasticsearch下的jvm.options:
vi /etc/elasticsearch/jvm.options
-Xms256m ##启用如下两项
-Xmx256m
##-Xms2g ##关闭如下两项
##-Xmx2g

②ElasticSearch默认的对外服务的HTTP端口是9200,节点间交互的TCP端口是9300。
开放端口 9200-9300

192.168.235.154创建集群环境节点1
vi /home/es/elasticsearch-7.10.0/config/elasticsearch.yml

cluster.name: elasticsearch
node.name: node-1
http.cors.enabled: true
http.cors.allow-origin: "*"
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.235.154
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.235.154:9300","192.168.235.155:9300","192.168.235.157:9300"]

su - es -c '/home/es/elasticsearch-7.10.0/bin/elasticsearch -d'
[root@localhost logs]# cd /home/es/elasticsearch-7.10.0/logs && tail -f elasticsearch.log

192.168.235.155创建集群环境节点2
vi /home/es/elasticsearch-7.10.0/config/elasticsearch.yml

cluster.name: elasticsearch
node.name: node-2
http.cors.enabled: true
http.cors.allow-origin: "*"
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.235.155
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.235.154:9300","192.168.235.155:9300","192.168.235.157:9300"]

su - es -c '/home/es/elasticsearch-7.10.0/bin/elasticsearch -d'
[root@localhost logs]# cd /home/es/elasticsearch-7.10.0/logs && tail -f elasticsearch.log

192.168.235.157创建集群环境节点3
vi /home/es/elasticsearch-7.10.0/config/elasticsearch.yml

cluster.name: elasticsearch
node.name: node-3
http.cors.enabled: true
http.cors.allow-origin: "*"
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.235.157
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.235.154:9300","192.168.235.155:9300","192.168.235.157:9300"]

su - es -c '/home/es/elasticsearch-7.10.0/bin/elasticsearch -d'