1、elasticsearch磁盘满导致read-only,新数据不可入库
执行
curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
解除lock状态,即使更换磁盘也需要执行该命令
2、ES单机状态内存配置32G最大处理文档数据量为118亿,每条文档平均大小1.4K,占用磁盘空间16T数据。?尚存在疑问!
这个是我在项目实际运行过程遇到过一次,后续没有在没有遇到,所以我标记为尚存在疑问
3、删除一个不存在的索引
返回 no such index Exception
4、查询一个不存在的索引的mapping、setting、别名
返回 no such index Exception
5、往一个不存在的索引插入数据
自动创建索引和相应的mapping,并不会报任何异常
6、假设一个索引原来是5个shards,插入一批数据后,我现在要把这个索引改为3个shard,或者增加为8个shards,这个变换过程中副本数不变。
shards不可更改,如果强行更改setting,报异常illegal_argument_exception ;必须更改using the _shrink and _split APIs。比较麻烦耗时
7、Each Elasticsearch shard is a Lucene index. There is a maximum number of documents you can have in a single Lucene index. As of LUCENE-5843, the limit is 2,147,483,519 (= Integer.MAX_VALUE - 128) documents. You can monitor shard sizes using the _cat/shards API.
经验证上述是正确的。超过上限在插数据报
java.lang.IllegalArgumentException: number of documents in the index cannot exceed 2147483519
8、[WARN ][o.e.d.z.ZenDiscovery ] [node3.com] not enough master nodes discovered during pinging (found [[Candidate{node={node3.com}{eT19CeA7QNqiXaZ2VUbzkQ}{-Z5iQbEARPGsQLCVDWdL6w}{192.168.8.127}{192.168.8.127:9300}{ml.machine_memory=1019797504, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, clusterStateVersion=-1}]], but needed [2]), pinging again
这个集群模式下的通信出现了问题,可能是selinux或者防火墙的原因。
9、出现 java.lang.IllegalArgumentException: Limit of total fields [1000] in index [eventaction_20190708] has been exceeded 的问题
解决方案:
PUT apievent_20190619/_settings
{
"index.mapping.total_fields.limit": 2000
}
或
curl -XPUT "http://127.0.0.1:9200/apievent_20190827/_settings" -H 'Content-Type: application/json' -d'
{
"index.mapping.total_fields.limit": 2000
}'
10、安装nlpchina elasticsearch-sql时如果kibana和xpack后,在页面执行sql语句报错
Error:Error occured! response is not avalible.
解决方案:
修改elasticsearch配置文件,添加cors和xpack:
http.cors.enabled: true
http.cors.allow-credentials: true
http.cors.allow-origin: "/.*/"
http.cors.allow-headers: WWW-Authenticate,X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
pack.security.enabled: false