Line 17: |
Line 17: |
| service elasticsearch start | | service elasticsearch start |
| | | |
| + | == migration from 1.x to higher == |
| + | upgrade to 2.4 and install plugin<syntaxhighlight lang="bash"> |
| + | yum upgrade elasticsearch --enablerepo=elastic2 |
| + | service elasticsearch restart |
| + | cd /usr/share/elasticsearch |
| + | ./bin/plugin install https://github.com/elastic/elasticsearch-migration/releases/download/v2.0.4/elasticsearch-migration-2.0.4.zip |
| + | |
| + | </syntaxhighlight>run a tunnel to your computer<syntaxhighlight lang="bash"> |
| + | ssh -L 9200:localhost:9200 user@yourserver |
| + | </syntaxhighlight>use your favourite browser to fix things and migrate <nowiki>http://localhost:9200/_plugin/elasticsearch-migration</nowiki> |
| + | |
| + | then delete plugin and upgrade to 5.x or 6.x<syntaxhighlight lang="bash"> |
| + | cd /usr/share/elasticsearch |
| + | rm plugin/elasticsearch-migration -rf |
| + | yum update elasticsearch --enablerepo=elastic5.x |
| + | service elasticsearch restart |
| + | </syntaxhighlight> |
| + | |
| + | reference https://github.com/elastic/elasticsearch-migration/tree/2.x |
| + | |
| + | == Snapshots == |
| + | preparing for snapshots<syntaxhighlight lang="bash"> |
| + | mkdir /home/e-smith/db/elasticsearch |
| + | chown elasticsearch:elasticsearch /home/e-smith/db/elasticsearch/ |
| + | echo "">> /etc/elasticsearch/elasticsearch.yml |
| + | echo "path.repo: ["/home/e-smith/db/elasticsearch"]" >> /etc/elasticsearch/elasticsearch.yml |
| + | service elasticsearch restart |
| + | curl -XPUT 'http://localhost:9200/_snapshot/my_backup' -H 'Content-Type: application/json' -d '{ |
| + | "type": "fs", |
| + | "settings": { |
| + | "location": "/home/e-smith/db/elasticsearch", |
| + | "compress": true |
| + | } |
| + | }PUT /_snapshot/my_backup' |
| + | |
| + | </syntaxhighlight>making a snapshot. <syntaxhighlight lang="bash"> |
| + | curl -XPUT 'http://localhost:9200/_snapshot/my_backup/snapshot1?wait_for_completion=true' |
| + | </syntaxhighlight>restore all indices, but not the state.<syntaxhighlight lang="bash"> |
| + | curl -XPUT 'http://localhost:9200/_snapshot/my_backup/snapshot1/_restore' |
| + | </syntaxhighlight> |
| + | |
| + | references and more options : https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html |
| | | |
| ==notes== | | ==notes== |