Line 1: |
Line 1: |
| How to set elastic search on SME | | How to set elastic search on SME |
| == install and configure== | | == install and configure== |
| + | <tabs container style="display: inline-block;" ><tab name="For SME 10"> |
| installl elastic repo | | installl elastic repo |
− | {{:Elastic_repo}}
| + | yum install smeserver-extrarepositories-elastic |
| + | signal-event yum-modify |
| | | |
| + | install elastic and dependencies (which are not explicits). You now need to choose the version you want ! 8.x, 7.x, 6.x, 5.x, 2 or 1 |
| + | |
| + | yum install elasticsearch java-1.8.0-openjdk --enablerepo=elastic6.x |
| + | allow updates |
| + | db yum_repositories setprop elastic6.x status enabled TCPPort 9200 access localhost |
| signal-event yum-modify | | signal-event yum-modify |
| | | |
− | install elastic and dependencies (which are not explicits). You now need to choose the version you want ! 6, 5 or 1.6 | + | if you wanted a specific release you can use versionlock |
− | yum install elasticsearch java-1.8.0-openjdk --enablerepo=elastic1 | + | yum install yum-plugin-versionlock -y |
| + | yum install elasticsearch-7.10.2 java-1.8.0-openjdk --enablerepo=elastic6.x |
| + | yum versionlock add elasticsearch-7.10.* |
| + | |
| + | configure and start |
| + | config set elasticsearch service status enabled |
| + | mkdir -p /etc/e-smith/templates-custom/etc/systemd/system-preset/49-koozali.preset/ |
| + | echo '{ |
| + | push @list,qw(elasticsearch); |
| + | $OUT.=""; |
| + | } |
| + | '> /etc/e-smith/templates-custom/etc/systemd/system-preset/49-koozali.preset/06elasticsearch |
| + | expand-template /etc/systemd/system-preset/49-koozali.preset |
| + | /etc/e-smith/events/actions/systemd-default |
| + | systemctl start elasticsearch |
| + | </tab><tab name="For SME 9"> |
| + | installl elastic repo |
| + | yum install smeserver-extrarepositories-elastic |
| + | signal-event yum-modify |
| | | |
| + | install elastic and dependencies (which are not explicits). You now need to choose the version you want 6.x, 5.x, 2 or 1 |
| + | yum install elasticsearch java-1.8.0-openjdk --enablerepo=elastic6.x |
| + | allow updates |
| + | db yum_repositories setprop elastic6.x status enabled |
| + | signal-event yum-modify |
| | | |
| make it start at every boot | | make it start at every boot |
Line 16: |
Line 46: |
| start it for the first time | | start it for the first time |
| service elasticsearch start | | service elasticsearch start |
| + | </tab></tabs> |
| | | |
| == migration from 1.x to higher == | | == migration from 1.x to higher == |
Line 24: |
Line 55: |
| ./bin/plugin install https://github.com/elastic/elasticsearch-migration/releases/download/v2.0.4/elasticsearch-migration-2.0.4.zip | | ./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"> | + | </syntaxhighlight>run a tunnel from your computer<syntaxhighlight lang="bash"> |
| ssh -L 9200:localhost:9200 user@yourserver | | 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> | | </syntaxhighlight>use your favourite browser to fix things and migrate <nowiki>http://localhost:9200/_plugin/elasticsearch-migration</nowiki> |
Line 42: |
Line 73: |
| chown elasticsearch:elasticsearch /home/e-smith/db/elasticsearch/ | | chown elasticsearch:elasticsearch /home/e-smith/db/elasticsearch/ |
| echo "">> /etc/elasticsearch/elasticsearch.yml | | echo "">> /etc/elasticsearch/elasticsearch.yml |
− | echo "path.repo: ["/home/e-smith/db/elasticsearch"]" >> /etc/elasticsearch/elasticsearch.yml | + | echo 'path.repo: ["/home/e-smith/db/elasticsearch"]' >> /etc/elasticsearch/elasticsearch.yml |
| service elasticsearch restart | | service elasticsearch restart |
| curl -XPUT 'http://localhost:9200/_snapshot/my_backup' -H 'Content-Type: application/json' -d '{ | | curl -XPUT 'http://localhost:9200/_snapshot/my_backup' -H 'Content-Type: application/json' -d '{ |
Line 64: |
Line 95: |
| ---- | | ---- |
| [[Category:Howto]] | | [[Category:Howto]] |
| + | [[Category:Database]] |