起源 Lucene
Elasticsearch 的诞生
下载地址:https://www.elastic.co/cn/downloads/elasticsearch
https://zhuanlan.zhihu.com/p/669733170
https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
1 step Install Docker.
Install Docker. Visit Get Docker to install Docker for your environment.
If using Docker Desktop, make sure to allocate at least 4GB of memory. You can adjust memory usage in Docker Desktop by going to Settings > Resources.
docker network create elastic
Pull the Elasticsearch Docker image.
3 step elastic images
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.11.3
Optional: Install Cosign for your environment. Then use Cosign to verify the Elasticsearch image’s signature.
wget https://artifacts.elastic.co/cosign.pub
cosign verify --key cosign.pub docker.elastic.co/elasticsearch/elasticsearch:8.11.3
The cosign command prints the check results and the signature payload in JSON format:
Verification for docker.elastic.co/elasticsearch/elasticsearch:8.11.3
– The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The signatures were verified against the specified public key Start an Elasticsearch container.
docker run --name es01 --net elastic -p 9200:9200 -it -m 1GB docker.elastic.co/elasticsearch/elasticsearch:8.11.3
https://gitee.com/geektime-geekbang/geektime-ELK/tree/master/part-1/2.1-Elasticsearch%E7%9A%84%E5%AE%89%E8%A3%85%E4%B8%8E%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE#%E7%9B%B8%E5%85%B3%E9%98%85%E8%AF%BB
#启动单节点
bin/elasticsearch -E node.name=node0 -E cluster.name=geektime -E path.data=node0_data
#安装插件
bin/elasticsearch-plugin install analysis-icu
#查看插件
bin/elasticsearch-plugin list
#查看安装的插件
GET http://localhost:9200/_cat/plugins?v
#start multi-nodes Cluster
bin/elasticsearch -E node.name=node0 -E cluster.name=geektime -E path.data=node0_data
bin/elasticsearch -E node.name=node1 -E cluster.name=geektime -E path.data=node1_data
bin/elasticsearch -E node.name=node2 -E cluster.name=geektime -E path.data=node2_data
bin/elasticsearch -E node.name=node3 -E cluster.name=geektime -E path.data=node3_data
#查看集群
GET http://localhost:9200
#查看nodes
GET _cat/nodes
GET _cluster/health
#启动kibana
bin/kibana
#查看插件
bin/kibana-plugin list
#启动
docker-compose up
#停止容器
docker-compose down
#停止容器并且移除数据
docker-compose down -v
#一些docker 命令
docker ps
docker stop Name/ContainerId
docker start Name/ContainerId
#删除单个容器
$docker rm Name/ID
-f, –force=false; -l, –link=false Remove the specified link and not the underlying container; -v, –volumes=false Remove the volumes associated to the container
#删除所有容器
$docker rm `docker ps -a -q`
停止、启动、杀死、重启一个容器
$docker stop Name/ID
$docker start Name/ID
$docker kill Name/ID
$docker restart name/ID
安装Logstash,并且导入Movielens的测试数据集
Small: 100,000 ratings and 3,600 tag applications applied to 9,000 movies by 600 users. Last updated 9/2018.
movielens/ml-latest-small/movies.csv movie数据
movielens/logstash.conf //logstash 7.x 配置文件,
movielens/logstash6.conf //logstash 6.x 配置文件
#下载与ES相同版本号的logstash,(7.1.0),并解压到相应目录
#修改movielens目录下的logstash.conf文件
#path修改为,你实际的movies.csv路径
input {
file {
path => "YOUR_FULL_PATH_OF_movies.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
#启动Elasticsearch实例,然后启动 logstash,并制定配置文件导入数据
bin/logstash -f /YOUR_PATH_of_logstash.conf