Elasticsearch官网: https://www.elastic.co/products/elasticsearch
单节点安装
es操作需要在非root下进行
1.解压,启动
bin/elasticsearch
2.验证:
REST API
curl -XGET 'localhost:9200/_cat/health?v&pretty'
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1550960314 06:18:34 elasticsearch green 1 1 0 0 0 0 0 0 - 100.0%
看到status是 green,证明启动成功。
- Green - 一切运行正常(集群功能齐全)
- Yellow - 所有数据是可以获取的,但是一些复制品还没有被分配(集群功能齐全)
- Red - 一些数据因为一些原因获取不到(集群部分功能不可用)
3.在 elasticsearch-6.1.1路径下创建 data 和 logs 文件夹:
mkdir data
mkdir logs
4.修改配置文件config/elasticsearch.yml
# ---------------------------------- Cluster -------------------------------------
cluster.name: my-application
# ------------------------------------ Node -------------------------------------