Skip to content

Instantly share code, notes, and snippets.

@sjb9774
Last active March 3, 2020 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjb9774/9f69c77418d0b8e29fa6db216d83fe6d to your computer and use it in GitHub Desktop.
Save sjb9774/9f69c77418d0b8e29fa6db216d83fe6d to your computer and use it in GitHub Desktop.
Update ElasticSearch 2.4.3 to 6.x
# on VM
sudo su
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
touch /etc/yum.repos.d/elasticsearch.repo
echo "[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md" >> /etc/yum.repos.d/elasticsearch.repo
yum install elasticsearch
# remove old elasticsearch data and directory structure
rm -rf /var/lib/elasticsearch/*
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch
# kill old elastic search process (systemctl won't work since the service should now be pointed at the es6 install)
kill $(cat /var/run/elasticsearch/elasticsearch.pid) && rm /var/run/elasticsearch/elasticsearch.pid
systemctl start elasticsearch.service
# leave sudo
exit
cd /var/www/sites/<project-directory>
bin/magento indexer:reindex catalogsearch_fulltext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment