Upgrade Elasticsearch from 2.4.6 to 5.6.8 for Graylog 2.4.3
I know this is a bit messy but I wanted to get this onto somewhere before I forget.
So there are some new features in Graylog 2.4 that I wanted to use so I finally broke down and decided to upgrade my elasticsearch cluster to 5.6 the latest support version for graylog.
- Make sure you are up to date with all other updates before you start OS and Graylog
- I prefer to do everything through repos so on centos:
- nano /etc/yum.repos.d/elasticsearch.repo
- Past the following
- [elasticsearch-5.x] name=Elasticsearch repository for 5.x packages baseurl=https://artifacts.elastic.co/packages/5.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md
- Save and exit
- yum clean all and reboot
- Do this to all of your elasticsearch nodes
- Shutdown your elasticsearch cluster
- Timing is key with this if you do not want to lose logs. This is why I always give myself a good size on the graylog journal so that if I have to do something to the cluster it will write everything to the journal space if it can't contact the elasticsearch cluster
- So when you are ready shutdown your elasticsearch cluster.
- You can do this through curl commands or just simply stop the service on all nodes
- systemctl stop elasticsearch
- Now run updates
- yum update
- Hit yes when you see your shiny new elasticsearch version
- wait for the update to finish
- Since this is an update it will bring over your existing yml files. The problem is some of your settings in 2 will prevent elasticsearch from starting and the logs will be useless
- Before continuing elasticsearch has some changes from 2 to 5 that will cause the cluster to fail to start if you set them
- In particular you need to comment out:
- #discovery.zen.ping.multicast.enabled: false
- #bootstrap.memory_lock: true
- #script.inline: false #script.indexed: false #script.file: false #indices.store.throttle.max_bytes_per_sec: 150mb
- Now set your jvm options
- nano /etc/elasticsearch/jvm.options
- You really only need to set whatever you had before for memory for -xmx and xmx, leave everything else alone
- Now systemctl start elasticsearch
- It will take some time to start up
- To watch it happen
- tail -50 /mnt/elasticsearch/logs/graylog.log
- /mnt/elasticsearch is a seperate disk where I have elasticsearch data and logs stored. If you went with a default install it should be in /var/log/elasticsearch
- You can also curl "bindaddress":9200/_cat/health once you are green you are good to go.
- graylog green 3 3 760 760 0 0 0 0 - 100.0%