Elasticsearch 6 (install and basic configuration)

Sunka

Well-known member
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
 

rfc0001

Well-known member
What is the purpose of this step?:

Code:
Code:
cp -a /path/to/xenforoinstall/library/XenES/_scripts/*.groovy /etc/elasticsearch/scripts/
I don't see that being referenced anywhere after copying them. Thanks.
 

rfc0001

Well-known member
Also confused by cluster.name being the same as the index name in XF ES configuration. Isn't the hierarchy Cluster > Node > Index, therefore Cluster name and Index name are not the same thing?
 

Sunka

Well-known member
What is the purpose of this step?:

Code:
Code:
cp -a /path/to/xenforoinstall/library/XenES/_scripts/*.groovy /etc/elasticsearch/scripts/
I don't see that being referenced anywhere after copying them. Thanks.
Needed before. Do not know is it by default replaced with painless, so it is no hurt to copy it there
Also confused by cluster.name being the same as the index name in XF ES configuration. Isn't the hierarchy Cluster > Node > Index, therefore Cluster name and Index name are not the same thing?
You add cluster name as you want, so same name you want, add into elasticsearch configuration and then into xenforo.


Do what you want, I just wrote this basic tutorial so users with little knowledge about linux and sys administration (like me) can install and reinstall elasticsearch on their servers.
 

PJK

Active member
What is the purpose of this step?:

Code:
Code:
cp -a /path/to/xenforoinstall/library/XenES/_scripts/*.groovy /etc/elasticsearch/scripts/
I don't see that being referenced anywhere after copying them. Thanks.
Did you ever get passed that part? The Elastic Search download from Xenforo doesn't have library/XenES, it only has src/addons/xfes. I'm getting stuck at the part above as no _scripts folder exists.
 
Top