648cb4c2
tangwang
ES docs
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
## 一、安装
### 1. 安装
```shell
# 参考install_elasticsearch.sh。
ELASTICSEARCH_VERSION="8.18.0"
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo rpm --import
yum install -y https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION-x86_64.rpm
# 设置Elasticsearch的系统服务
systemctl daemon-reload
systemctl start elasticsearch
systemctl enable elasticsearch
```
安装、配置好后验证命令: curl -X GET "http://localhost:9200"
### 3. 工程&安全方面设置
性能相关配置:
```shell
vi /etc/elasticsearch/jvm.options
堆内存大小:
-Xms32g
-Xmx32g
```
/etc/elasticsearch/elasticsearch.yml :
Fielddata Cache(用于聚合和排序操作):
indices.fielddata.cache.size: 40% # 将 fielddata 缓存大小设置为 40% 的物理内存
Query Cache(用于查询缓存):
indices.queries.cache.size: 30% # 将查询缓存设置为 30% 的物理内存
修改的系统配置:
vi /etc/sysctl.conf
```shell
# tangwang
# 调整系统句柄限制
fs.file-max = 1000000
# 优化文件描述符 可以分配的vma数量
vm.max_map_count = 655360
# 优化脏内存页,es写入削峰
vm.dirty_ratio=10
vm.dirty_background_ratio=5
vm.dirty_writeback_centisecs=200
# 优化系统回收inode cache权重
vm.vfs_cache_pressure=200
vm.dirty_expire_centisecs=6000
# 尽可能低的使用swap,内存很充裕可以设置为0,较低设置为1
vm.swappiness=0
```
vi /etc/security/limits.conf
```shell
# tangwang 修改 下面都加了10倍
# End of file
* soft nofile 655350
* hard nofile 655350
root soft nofile 655350
root hard nofile 655350
* soft nofile 655350
* hard nofile 655350
# tangwang 补充下面的
* soft nproc 102400
* hard nproc 409600
# 允许进程锁定内存
* soft memlock unlimited
* hard memlock unlimited
```
### TOOD :
配置为单节点模式,discovery.type: single-node 但是还需要其他配套改动。
用户名 密码 安全方面
kibana用户名密码
## 其他说明
ES 8.x版本特性
在 8.0版本 中,提供新的kNN 搜索 API。以前,Elasticsearch 仅支持使用script_score带有向量函数的查询进行精确的 kNN 搜索。虽然此方法可以保证准确的结果,但它通常会导致搜索速度缓慢,并且无法很好地适应大型数据集。作为索引速度较慢和准确性不完美的代价,新的 kNN 搜索 API 允许您以更快的速度对更大的数据集运行近似 kNN 搜索。
在 8.4版本中,把knn搜索加入到search API中,以支持 ANN 搜索。它由与旧 _knn_search端点相同的 Lucene ANN 功能提供支持。该knn选项可以与其他搜索功能(例如查询和聚合)结合使用。
在 8.7版本中,允许多个 KNN 搜索子句。某些向量搜索场景需要使用几个 kNN 子句进行相关性排名,例如,当基于多个字段进行排名时,每个字段都有自己的向量,或者当文档包含图像向量和文本向量时。用户可能希望获得基于所有这些 kNN 子句的组合的相关性排名。
在 8.8版本 中,将 Introducing Elastic Learned Sparse Encoder: Elastic’s AI model for semantic search — Elastic Search Labs 模型引入到我们的机器学习模型库中,您可以开箱即用。ELSER 通过启用语义搜索来提高搜索结果的相关性。这种搜索方法考虑单词的含义,而不是仅仅依赖字面术语。ELSER 是一种预训练的域外稀疏向量模型,无需对特定源数据进行微调。它从一开始就为您提供相关的搜索结果。并且在此版本中,还提升了KNN检索语法,加入了similarity参数,允许过滤给定相似性之外的最近邻结果。
在8.9版本中。text_embedding query_vector_builderkNN 搜索的扩展普遍可用。
在8.10版本中,启用跨段并行 knn 搜索,使得 knn 查询对由多个段组成的分片更快,来优化knn搜索的性能。
8.15 更为丰富的工具用于微调相关性、更高的模型灵活性、矢量搜索的改进
|