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

Install Xenforo CentOS 7.x How To Install Elasticsearch 7.x for Xenforo

Discussion in 'Centmin Mod User Tutorials & Guides' started by Sunka, Mar 6, 2020.

  1. eva2000

    eva2000 Administrator Staff Member

    47,551
    10,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,774
    Local Time:
    10:04 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    you lock whatever elasticsearch packages that were installed only

     
  2. pamamolf

    pamamolf Premium Member Premium Member

    3,952
    402
    83
    May 31, 2014
    Ratings:
    +782
    Local Time:
    2:04 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    On the net there are some info to use this:
    Code:
    yum versionlock elasticsearch
    Your recommendation if i got it correctly is to use it with the version and architecture as this is the package that i installed?
    Code:
    yum versionlock elasticsearch-7.6.2-1.x86_64
    or i need to versionlock any other related packages/dependencies to the above installation also?

    Confused......
     
    Last edited: Nov 18, 2020
  3. Itworx4me

    Itworx4me Member

    246
    23
    18
    Mar 14, 2017
    Ratings:
    +40
    Local Time:
    4:04 AM
    Nginx 1.17.X
    MariaDB 10.3.X
    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
    node.name: ANOTHER CUSTOM NAME
    cluster.initial_master_nodes: ANOTHER CUSTOM NAME (same as line above, and use all lowercase)

    What do people usually name there cluster. New to installing Elastic Search.

    Thanks,
    Itworx4me
     
  4. duderuud

    duderuud Member

    39
    10
    8
    Dec 5, 2020
    The Netherlands
    Ratings:
    +23
    Local Time:
    1:04 PM
    Nginx 1.21.4
    MariaDB 10.4
    It really doesn't matter. I use an abbreviation of my website with the addition of "search" :)
     
  5. modder

    modder Member

    70
    9
    8
    Dec 6, 2019
    Ratings:
    +14
    Local Time:
    8:04 PM
  6. deltahf

    deltahf Premium Member Premium Member

    461
    199
    43
    Jun 8, 2014
    Ratings:
    +352
    Local Time:
    7:04 AM
    Thanks so much for this guide, @Sunka!

    One issue I ran into was not being able to start Elasticsearch:

    Code (Text):
    $ service elasticsearch start
    Starting elasticsearch (via systemctl):  Job for elasticsearch.service failed because the control process exited with error code. See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
                                                               [FAILED]
    


    After further investigation in my logs (specifically, /var/log/elasticsearch/my_xenforo_index.log), I noticed there was a message related to possible file permissions errors. The problem turned out to be an issue with the permissions on the /var/lib/elasticsearch/nodes directory. Apparently removing ES6 removed the original "elasticsearch" user/group which owned that directory, so the permissions were not correct.

    This was easily fixed by simply updating the permissions on the directory:

    Code (Text):
    $ chown -R elasticsearch:elasticsearch /var/lib/elasticsearch/nodes
    


    Credit to this post on StackOverflow for originally mentioning this!

    Just for reference, this is how I deleted the index:

    Code (Text):
    $ curl -XDELETE localhost:9200/old_xenforo_index
    {"acknowledged":true}
    


    What does the --truncate option do? I would assume rebuilding the search index would "truncate" or remove the old index anyway?
     
    Last edited: Oct 28, 2021
  7. modder

    modder Member

    70
    9
    8
    Dec 6, 2019
    Ratings:
    +14
    Local Time:
    8:04 PM
    What's the recommended memory allocated for elasticsearch for a 1GB, 4GB and 8GB VPS respectively?
     
  8. rdan

    rdan Premium Member Premium Member

    5,112
    1,267
    113
    May 25, 2014
    Ratings:
    +1,936
    Local Time:
    8:04 PM
    Mainline
    10.2
    Code:
    du -msh /var/lib/elasticsearch/
    
    Set -Xms & -Xmx
    That's I always follow, on how much data I stored.
     
  9. modder

    modder Member

    70
    9
    8
    Dec 6, 2019
    Ratings:
    +14
    Local Time:
    8:04 PM
    This is what I got for a freshly installed server (1GB RAM):
    Code (Text):
    [root@server ~]# du -msh /var/lib/elasticsearch/
    42M     /var/lib/elasticsearch/
    


    1) does it mean I'll need to set Xms and Xmx to 42MB?
    2) does this value (42M) grow on the complexity of the forum? So then I'll have to adjust it from time to time?
     
  10. rdan

    rdan Premium Member Premium Member

    5,112
    1,267
    113
    May 25, 2014
    Ratings:
    +1,936
    Local Time:
    8:04 PM
    Mainline
    10.2
    Maybe x2 so you won't adjust it again for few months.
    Like 100M, not sure ES would start with that value.

    Yeah, as your forum will grow that size will grow also.
     
  11. deltahf

    deltahf Premium Member Premium Member

    461
    199
    43
    Jun 8, 2014
    Ratings:
    +352
    Local Time:
    7:04 AM
    For reference, my XF forum has 13.1 million posts and the size of that directory is 3.7GB for me.

    My -Xms and -Xmx values are both set to 16G, so I'm actually thinking that might be way too much...