Intro
Advices¶
- 合理设定filesystem cache: es+hbase/mysql
- 用预热subsystem 预热数据
- 冷热分离
- document 模型设计,避免join/nested/parent-child
- 不允许深度分页
- 使用scroll,不要缓存长时间。
Install¶
Server¶
- Downloading
- Installing
- Starting
- Configuring
Docker¶
$ docker pull docker.elastic.co/elasticsearch/elasticsearch:7.14.0
$ docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.14.0
$ curl -s localhost:9200/_nodes/_all/http | jq .nodes[].http.publish_address
Problems¶
- sniffing-docker
curl -XGET http://192.168.59.103:9200/_nodes/http?pretty
# get publish_address
solved-to_verify:
If you're using Boot2Docker, get the ip address of the virtual machine (boot2docker ip). If you are not using Boot2Docker, get the IP address of the machine running the Docker daemon.
Grab an elasticsearch.yml config from the Elasticsearch release archive.
Update the config file to set network.publish_host to the IP address from step one.
Start an Elasticsearch container using your custom config file by mounting the directory containing the config file:
docker run -d -v "$PWD/config":/usr/share/elasticsearch/config elasticsearch
Verify that publish_address is the IP address from step one when you run
curl -XGET http://<IPAddress>:9200/_nodes/http?pretty
dump and move¶
with elasticdump
# index name: index1 elasticdump --input=http://elastic:zyslASD2401@10.92.12.37:9200/index1 --output=http://elastic:zyslASD2401@10.92.12.128:9200/index1 --type=analyzer elasticdump --input=http://elastic:zyslASD2401@10.92.12.37:9200/index1 --output=http://elastic:zyslASD2401@10.92.12.128:9200/index1 --type=settings elasticdump --input=http://elastic:zyslASD2401@10.92.12.37:9200/index1 --output=http://elastic:zyslASD2401@10.92.12.128:9200/index1 --type=mapping elasticdump --input=http://elastic:zyslASD2401@10.92.12.37:9200/index1 --output=http://elastic:zyslASD2401@10.92.12.128:9200/index1 --type=data