Learn about Centmin Mod LEMP Stack today
Register Now

Xenforo How To Install Elasticsearch 6.x for Xenforo

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

  1. sepulchre

    sepulchre Member

    163
    22
    18
    Dec 22, 2014
    Ratings:
    +28
    Local Time:
    3:14 AM
    Can I use this tutorial for installing ES 7.4?

    Do I need to change anything? Will be my first go for ES.
     
  2. rdan

    rdan Well-Known Member

    4,988
    1,186
    113
    May 25, 2014
    Ratings:
    +1,808
    Local Time:
    10:14 AM
    Mainline
    10.2
  3. Andy

    Andy Premium Member Premium Member

    477
    77
    28
    Aug 6, 2014
    Ratings:
    +109
    Local Time:
    10:14 PM
    Updated to php 7.4.1 and elastic 7.5.1 and it fails to start.
    Anyone with issue?
     
  4. rdan

    rdan Well-Known Member

    4,988
    1,186
    113
    May 25, 2014
    Ratings:
    +1,808
    Local Time:
    10:14 AM
    Mainline
    10.2
     
  5. eva2000

    eva2000 Administrator Staff Member

    45,434
    10,311
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,991
    Local Time:
    12:14 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yeah that is because Centmin Mod configures /tmp with noexec permissions for security
     
  6. Andy

    Andy Premium Member Premium Member

    477
    77
    28
    Aug 6, 2014
    Ratings:
    +109
    Local Time:
    10:14 PM
    It wasn't a problem until recently i believe. version 7.4 or so.
     
  7. modder

    modder Member

    44
    5
    8
    Dec 6, 2019
    Ratings:
    +8
    Local Time:
    10:14 AM
    Followed the procedure but I got error upon starting of elasticsearch..

    I got a fresh CentOS with CentminMOD and xenforo installed.

    Do I have do anything with firewall (csf)?
     
  8. pamamolf

    pamamolf Premium Member Premium Member

    3,858
    379
    83
    May 31, 2014
    Ratings:
    +731
    Local Time:
    4:14 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    If you are using Elastic on the same server as Xenforo then you don't have to open any ports.

    You may need to check the logs first and see what's the problem...

    Check at:
    Code:
    /var/log/elasticsearch/
    and run also:
    Code:
    journalctl -u elasticsearch --no-pager
    You should be able to get some info why it is not starting.
     
  9. modder

    modder Member

    44
    5
    8
    Dec 6, 2019
    Ratings:
    +8
    Local Time:
    10:14 AM
    Thanks for your reply.

    I started the test from a fresh server again.

    Code (Text):
    # yum remove elasticsearch
    Loaded plugins: fastestmirror, priorities, versionlock
    No Match for argument: elasticsearch
    No Packages marked for removal


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


    Create a file
    Code (Text):
    /etc/yum.repos.d/elasticsearch.repo
    with the following content:

    Code (Text):
    cat /etc/yum.repos.d/elasticsearch.repo
    [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


    No java installed:

    Code (Text):
    # java -version
    -bash: java: command not found


    Now install java:

    Code (Text):
    # yum -y install java-1.8.0-openjdk
    Loaded plugins: fastestmirror, priorities, versionlock
    Loading mirror speeds from cached hostfile
     * base: mirror.0x.sg
     * centos-sclo-rh: mirror.0x.sg
     * centos-sclo-sclo: mirror.0x.sg
     * epel: epel.dionipe.id
     * extras: mirror.newmediaexpress.com
    ...
    ...
    ...
    
    Installed:
      java-1.8.0-openjdk.x86_64 1:1.8.0.242.b08-0.el7_7                                          
    
    Dependency Installed:
      copy-jdk-configs.noarch 0:3.3-10.el7_5                                                    
      giflib.x86_64 0:4.1.6-9.el7                                                                
      java-1.8.0-openjdk-headless.x86_64 1:1.8.0.242.b08-0.el7_7                                
      javapackages-tools.noarch 0:3.4.1-11.el7                                                  
      libXtst.x86_64 0:1.2.3-1.el7                                                              
      lksctp-tools.x86_64 0:1.0.17-2.el7                                                        
      pcsc-lite-libs.x86_64 0:1.8.8-8.el7                                                        
      python-javapackages.noarch 0:3.4.1-11.el7                                                  
      python-lxml.x86_64 0:3.2.1-4.el7                                                          
      ttmkfdir.x86_64 0:3.0.9-42.el7                                                            
      tzdata-java.noarch 0:2019c-1.el7                                                          
      xorg-x11-fonts-Type1.noarch 0:7.5-9.el7                                                    
    
    Complete!
    


    Now install elasticsearch:

    Code (Text):
    # yum -y install elasticsearch
    Loaded plugins: fastestmirror, priorities, versionlock
    Loading mirror speeds from cached hostfile
     * base: mirror.0x.sg
     * centos-sclo-rh: mirror.0x.sg
     * centos-sclo-sclo: mirror.0x.sg
    
    ...
    ...
    ...
    
    Installed:
      elasticsearch.noarch 0:6.8.7-1                                                            
    
    Complete!
    


    Add the following 3 lines at the end of the file /etc/elasticsearch/elasticsearch.yml:

    Code (Text):
    # tail /etc/elasticsearch/elasticsearch.yml
    #
    # ---------------------------------- Various -----------------------------------
    #
    # Require explicit names when deleting indices:
    #
    #action.destructive_requires_name: true
    
    cluster.name: my_elastic
    network.host: localhost
    http.port: 9200


    I skipped the RAM setup in post #1 for now.

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


    Then:

    Code (Text):
    # cp -a /home/nginx/domains/mydomain.com/public/library/XenES/_scripts/*.groovy /etc/elasticsearch/scripts/
    cp: cannot stat ‘/home/nginx/domains/mydomain.com/public/library/XenES/_scripts/*.groovy’: No such file or directory
    


    There's no such directory "library/XenES/.." in /public/ or /public/forum

    Skipped the above.

    Start elasticsearch:

    Code (Text):
    # service elasticsearch start
    Starting elasticsearch (via systemctl):                    [  OK  ]


    Then:
    Code (Text):
    # systemctl daemon-reload


    Then:
    Code (Text):
    # systemctl enable elasticsearch.service
    Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
    


    Then:
    Code (Text):
    # systemctl start elasticsearch.service


    Then: (after waiting for 3 minutes according to post #1)
    Code (Text):
    # curl -XGET 'localhost:9200'
    {
      "name" : "L7Ob0XF",
      "cluster_name" : "my_elastic",
      "cluster_uuid" : "BhSLEiweRvxxxxutopkJWw",
      "version" : {
        "number" : "6.8.7",
        "build_flavor" : "default",
        "build_type" : "rpm",
        "build_hash" : "c63e621",
        "build_date" : "2020-02-26T14:38:01.193138Z",
        "build_snapshot" : false,
        "lucene_version" : "7.7.2",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }
    


    HEY it actually WORKS this time!!!

    QUESTION:

    1) What's the purpose of the cp -a line above for? Can I just skip it? If not, how do I fix it?

    2) Is it necessary for me to upgrade to elasticsearch 7.6 if what I'm doing with elasticsearch is installing enhancedsearch add-on and other add-ons that might depend on it? Any significant performance gain or features gain? How do I upgrade from 6.x to 7.x?

    3) is it really necessary to setup the RAM? how much is advised?

    MANY thanks for your help!!!!

    TIP: If you want to do the CODE with black background and white text, you have to use the CODEb tag:

    CODEb]text text text[/CODEb
     
    Last edited: Mar 5, 2020
  10. Sunka

    Sunka Well-Known Member

    1,142
    313
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +510
    Local Time:
    3:14 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    It is needed for xf1, you can skeep it if you have xf2

    I installed v.7 few days ago, after many, many tries, errors.
    For me, it is better to do clean install. rRemoving older elasticsearch before. Also I updated java to v11
    If I find time, I will write my tutorial for version 7

    It depends how much, but 512 mb os enough for site with 1 million posts
     
  11. modder

    modder Member

    44
    5
    8
    Dec 6, 2019
    Ratings:
    +8
    Local Time:
    10:14 AM
    Any quick hint? I may try to do it on a fresh server tomorrow.
     
  12. Sunka

    Sunka Well-Known Member

    1,142
    313
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +510
    Local Time:
    3:14 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    I will try to post it tonight
     
  13. modder

    modder Member

    44
    5
    8
    Dec 6, 2019
    Ratings:
    +8
    Local Time:
    10:14 AM
    Yaah. Make a new thread for 7.x please.
     
  14. Sunka

    Sunka Well-Known Member

    1,142
    313
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +510
    Local Time:
    3:14 AM
    Nginx 1.17.9
    MariaDB 10.3.22