你这个脚本#!bin/sh
for index in $(curl -s 'http://localhost:9200/_cat/shards' | grep UNASSIGNED | awk '{print $1}' | sort | uniq); do
for shard in $(curl -s 'http://localhost:9200/_cat/shards' | grep UNASSIGNED | grep $index | awk '{print $2}' | sort | uniq); do
echo $index $shard
curl -XPOST 'http://localhost:9200/_cluster/reroute' -d "{'commands':[{'allocate':{'index':$index,'shard':$shard,'node':'node-3','allow_primary':true}}]}"
sleep 5
done
done
用不了啊,我执行一直报这种错误{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Unexpected character (''' (code 39)): was expecting double-quote to start field name\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@2eaf4f6d; line: 1, col
请问这个脚本是哪个地方有问题
评论删除后,数据将无法恢复