简体   繁体   中英

Searchkick: Elasticsearch not indexing "FORBIDDEN/12/index read-only"?

I've setup a new development environment on my iMac and moved my rails app from a macbook air. It was working fine and indexing the data as well. Using the same version of gems. When indexing it gives following error.

Searchkick::ImportError: {"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"} on item with id '74'

Is there any way I can solve this issue by modifying my elasticsearch.yml?

来自https://github.com/ankane/searchkick/issues/1040 上的salihsagdilekon 的这个解决方案为我解决了同样的问题:

curl -XPUT -H "Content-Type: application/json" > http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

我今天遇到了同样的问题,以下对我有用:

Model.search_index.clean_indices

You can execute the following in rails console:

MyModel.reindex

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM