How about closing index before moving files? Does it fit your need?

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html

meilian zhu於 2014年4月28日星期一UTC+8下午5時44分27秒寫道:
>
> my local disk is very small,just can store one day index files.So i wanted 
> to move my index file to another fs path.
> This is my sh.It excute everyday.
> #!/bin/bash
> #copy the index files form elasticsearch to clusterFS now
> ddate=`date -d "1 days ago" +%Y.%m.%d`
> clustername="mams_online_log"
> indexdir="/data/soft/logmonitor/elasticsearch-1.1.0/data"
> ipip=$(hostname)
> dstdir=/mnt/lego-log/$ipip
> echo "Start time: $(date "+%Y.%m.%d %H:%M:%S")"
> echo "$dstdir"
> # copy the old index file;
> mkdir $dstdir
> cp -r $indexdir/$clustername/nodes/0/indices/logstash-$ddate $dstdir/
> mv $indexdir/$clustername/nodes/0/indices/logstash-$ddate 
> $indexdir/$clustername/nodes/0/indices/tmp
> ln -s $dstdir/logstash-$ddate 
> $indexdir/$clustername/nodes/0/indices/logstash-$ddate
> rm -rf $indexdir/$clustername/nodes/0/indices/tmp
> echo "ok"
> echo "End time: $(date "+%Y.%m.%d %H:%M:%S")"
>
>
> But when i "lsof" this is always so many files used by the es pid.
> So how i can do for this ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/2590b704-6e43-4166-bbbc-6ec36b29adca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to