Want to subscribe to topics you're interested in?
Become a Member

Xenforo How To Install Elasticsearch 6.x for Xenforo

Discussion in 'Centmin Mod User Tutorials & Guides' started by Sunka, Nov 30, 2017.

  1. Sunka

    Sunka Active Member

    932
    243
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +394
    Local Time:
    2:29 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    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 (Text):
    yum remove elasticsearch


    Installing elasticsearch 6

    Code (Text):
    rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    

    Code (Text):
    nano /etc/yum.repos.d/elasticsearch.repo
    

    insert this:
    Code (Text):
    [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 (Text):
    yum -y install java-1.8.0-openjdk
    

    Code (Text):
    yum -y install elasticsearch
    

    Code (Text):
    nano /etc/elasticsearch/elasticsearch.yml
    

    at the end of file add this:
    Code (Text):
    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 (Text):
    nano /etc/elasticsearch/jvm.options
    

    Code (Text):
    -Xms512m
    -Xmx512m
    


    Code (Text):
    mkdir /etc/elasticsearch/scripts/
    

    Code (Text):
    cp -a /path/to/xenforoinstall/library/XenES/_scripts/*.groovy /etc/elasticsearch/scripts/
    

    Code (Text):
    service elasticsearch start
    

    Code (Text):
    systemctl daemon-reload
    

    Code (Text):
    systemctl enable elasticsearch.service
    

    Code (Text):
    systemctl start elasticsearch.service
    


    test if everything OK (give 1-2 minute after restarting elasticsearch)
    Code (Text):
    curl -XGET 'localhost:9200'
    

    If everything OK, you will see something like this in your CLI
    Code (Text):
    # 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
     
    • Like Like x 3
    • Informative Informative x 1
  2. Chris

    Chris Member

    34
    5
    8
    Feb 27, 2015
    Ratings:
    +8
    Local Time:
    8:29 PM
    1.7
    10
    Thank you!
     
    • Like Like x 1
    • Friendly Friendly x 1