• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Elasticsearch 6 (install and basic configuration)

Sunka

Well-known member
#1
This is tutorial for installing (not upgrading) elasticsearch 6 on centos.
If I am missing something, please post here.

Delete first old one if you have installed and install fresh new one elasticsearch v6
Code:
yum remove elasticsearch

Installing elasticsearch 6

Code:
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Code:
nano /etc/yum.repos.d/elasticsearch.repo
insert this:
Code:
[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
If you do not have java installed (at least v8), install it

Code:
yum -y install java-1.8.0-openjdk
Code:
yum -y install elasticsearch
Code:
nano /etc/elasticsearch/elasticsearch.yml
at the end of file add this:

Code:
cluster.name: CUSTOM NAME OF YOUR CLUSTER (same name should be inserted into your XenForo field in Admin Control Panel in field Elasticsearch Index Name)
network.host: localhost
http.port: 9200
set how much ram you will add for elasticsearch - 512 megabytes is set in example (both Xms and Xmx must have same value)

Code:
nano /etc/elasticsearch/jvm.options
Code:
-Xms512m
-Xmx512m

Code:
mkdir /etc/elasticsearch/scripts/
Code:
cp -a /path/to/xenforoinstall/library/XenES/_scripts/*.groovy /etc/elasticsearch/scripts/
Code:
service elasticsearch start
Code:
systemctl daemon-reload
Code:
systemctl enable elasticsearch.service
Code:
systemctl start elasticsearch.service
test if everything OK (give 1-2 minute after restarting elasticsearch)

Code:
curl -XGET 'localhost:9200'
If everything OK, you will see something like this in your CLI
Code:
# curl -XGET 'localhost:9200'
{
  "name" : "xxxxxx",
  "cluster_name" : "xxxxx",
  "cluster_uuid" : "ZLDl3yghRIa6MBvRGLBPzg",
  "version" : {
    "number" : "6.0.0",
    "build_hash" : "8f0685b",
    "build_date" : "2017-11-10T18:41:22.859Z",
    "build_snapshot" : false,
    "lucene_version" : "7.0.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
Minimum version of XenForo Enhanced Search you have installed for elasticsearch 6 is 1.1.8

After you installed elastic search, configure relevant options for enhanced search in your Xenforo ACP and rebuild index (all)

acpoption.png


And how it looks in elasticsearch setup page in xenforo ACP

acp.png