elasticsearch官网
chmod 755 /home/elastic/.ssh && chmod 644 authorized_keys && chmod 644 id_rsa.pub && chmod 600 id_rsa
sshfs [email protected]:/data/backup /data/bak -o allow_other
curl -XPUT 'http://172.20.8.171:9200/_snapshot/backup0615' -H 'Content-Type: application/json' -d '{
"type": "fs",
"settings": {
"location": "/home/data/kfesdatabak",
"compress": true
}
}'
curl -XGET 'http://10.3.5.61:9200/_snapshot/_all?pretty'
curl -XDELETE 'http://10.3.5.61:9200/_snapshot/backup0622?pretty'
curl -XPUT 'http://172.20.8.171:9200/_snapshot/backup0615/snapshot_1?wait_for_completion=true&pretty'
curl -XPUT 'http://172.20.8.171:9200/_snapshot/backup0615/snapshot_1?pretty' -H 'Content-Type: application/json' -d'
{
"indices": "newindex,.marvel-es-data-1,test,fujiovmthw1856091935,biurrdwslo4876782488,qdzqjpisiq4211779427,jsvkxhdqtg1878285484,dfndsfyfsr0835468931,nfhevbnubp6817406919,ysjjececio3237427125",
"ignore_unavailable": true,
"include_global_state": false
}
'
curl -XGET 'http://172.20.8.171:9200/_snapshot/backup0615/snapshot_1?pretty'
curl -XGET "http://172.20.4.239:9200/_snapshot/my_backup/snapshot_1"
curl -XDELETE "http://172.20.4.238:9200/_snapshot/my_backup/snapshot_1"
rm -rf authorized_keys && cat id_rsa222.pub >> authorized_keys && cat id_rsa236.pub >> authorized_keys && cat id_rsa237.pub >> authorized_keys && cat id_rsa238.pub >> authorized_keys && cat id_rsa244.pub >> authorized_keys
chmod 755 /home/wzx/.ssh && chmod 644 authorized_keys && chmod 644 id_rsa.pub && chmod 600 id_rsa
chmod -R 777 /data/esbak/backup
chown -R wzx:gwzx /data/esbak/backup
sshfs [email protected]:/data/databak /data/esbak/backup -o allow_other
拷贝上文备份后数据至244服务器/data/databak目录下
curl -XPUT 'http://172.20.4.236:9200/_snapshot/backup0615' -H 'Content-Type: application/json' -d '{
"type": "fs",
"settings": {
"location": "/work/datasnap",
"compress": true
}
}'
curl -XPOST 'http://172.20.8.222:9200/_snapshot/my_backup/snapshot_1/_restore?pretty'
curl -XPOST 'http://172.20.8.222:9200/_snapshot/my_backup/snapshot_1/_restore?pretty' -H 'Content-Type: application/json' -d'
{
"indices": "newindex,.marvel-es-data-1,test,fujiovmthw1856091935,biurrdwslo4876782488,qdzqjpisiq4211779427,jsvkxhdqtg1878285484,dfndsfyfsr0835468931,nfhevbnubp6817406919,ysjjececio3237427125",
"ignore_unavailable": true,
"include_global_state": true,
}
'
curl -XGET 'http://172.20.4.236:9200/_snapshot/backup0615/snapshot_1/_status?pretty'
./bin/plugin install https://github.com/elastic/elasticsearch-migration/releases/download/v2.0.4/elasticsearch-migration-2.0.4.zip
http://localhost:9200/_plugin/elasticsearch-migration
curl -XPUT 'http://172.20.4.238:9211/_cluster/settings?pretty' -H 'Content-Type: application/json' -d'
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}
'
curl -XPOST 'http://172.20.4.238:9211/_flush/synced?pretty'
https://github.com/mobz/elasticsearch-head
安装node和npm
https://nodejs.org/en/download/
wget https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.xz
xz -d node-v6.10.3-linux-x64.tar.xz
tar xvf node-v6.10.3-linux-x64.tar
mkdir -p /usr/local/node
mv node-v6.10.3-linux-x64 /usr/local/node/
npm install
npm install -g grunt-cli
export NODE_PATH=/usr/local/node/node-v6.10.3-linux-x64
export PATH=$NODE_PATH/bin:$PATH
curl -XPUT 'http://172.20.4.238:9222/test/_settings?pretty' -H 'Content-Type: application/json' -d'
{
"index" : {
"number_of_replicas" : 2
}
}
'
curl -XPUT 'http://172.20.8.171:9200/_snapshot/backup0615/snapshot_1?pretty' -H 'Content-Type: application/json' -d'
{
"ignore_unavailable": true,
"include_global_state": false
}
'
curl -XPOST 'http://10.3.5.69:9200/_cluster/reroute?pretty' -H 'Content-Type: application/json' -d'
{
"commands" : [ {
"move" :
{
"index" : "fujiovmthw1856091935",
"shard" : 2,
"from_node" : "yc236",
"to_node" : "yc237"
}
}]
}'