1、从官网下载elasticsearchDownload Elasticsearch | ElasticDownload Elasticsearch or the complete Elastic Stack (formerly ELK stack) for free and start searching and analyzing in minutes with Elastic.https://www.elastic.co/cn/downloads/elasticsearch2、新建用户,赋予密码,权限
- useradd wyp -- 创建用户
- passwd wyp -- 设置密码
- chown -R wyp /opt/software/elasticsearch/elasticsearch-8.5.0 -- 授权
- su wyp -- 切换用户
3、如果启动报错,There is insufficient memory for the Java Runtime Environment to continue
修改 /config/jvm.options 文件
- -Xms512m
- -Xms512m
4、设置 /config/elasticsearch.yml
xpack.security.enabled: false
5、进入到bin目录下,后台启动elasticsearch
./elasticsearch -d
6、查看 elasticsearch 是否启动成功
ps -ef | grep elasticsearch
7、输入命令 curl http://localhost:9200,出现以下内容,说明ES启动成功
- {
- "name" : "aliyun",
- "cluster_name" : "elasticsearch",
- "cluster_uuid" : "AAzU8FMzQvW8gC6rwhelVQ",
- "version" : {
- "number" : "8.5.0",
- "build_flavor" : "default",
- "build_type" : "tar",
- "build_hash" : "c94b4700cda13820dad5aa74fae6db185ca5c304",
- "build_date" : "2022-10-24T16:54:16.433628434Z",
- "build_snapshot" : false,
- "lucene_version" : "9.4.1",
- "minimum_wire_compatibility_version" : "7.17.0",
- "minimum_index_compatibility_version" : "7.0.0"
- },
- "tagline" : "You Know, for Search"
- }