Want more timely Centmin Mod News Updates?
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. deltahf

    deltahf Premium Member Premium Member

    587
    265
    63
    Jun 8, 2014
    Ratings:
    +489
    Local Time:
    4:02 AM
    Thanks for the note! Updated to 7.16.2.

     
  2. Imgbi

    Imgbi New Member

    4
    1
    3
    Jan 23, 2022
    Ratings:
    +1
    Local Time:
    10:02 AM
    Nginx 1.21.5
    MariaDB 10
    I take it that Elaticsearch is not useful unless Enhance Search addon is purchased and installed to Xenforo.
     
  3. deltahf

    deltahf Premium Member Premium Member

    587
    265
    63
    Jun 8, 2014
    Ratings:
    +489
    Local Time:
    4:02 AM
    That is correct. I would highly recommend it, though, if you can afford it.
     
  4. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    5:02 PM
    Is there a tutorial for installing ElasticSearch 8.x for centmin? Or is it even recommended?
     
    Last edited: Jun 7, 2022
  5. deltahf

    deltahf Premium Member Premium Member

    587
    265
    63
    Jun 8, 2014
    Ratings:
    +489
    Local Time:
    4:02 AM
    Late reply here, but assuming you want to use it with XenForo, I don't think ES8 is officially supported for it yet:

    ES 2.2 - Elasticsearch Version: 8.0.0

    Unless there is a specific reason for wanting to use ES8 I think ES7 should be fine.
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    7:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah just stick with ES7 :)
     
  7. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    5:02 PM
    Maybe @Sunka would like to update your first post with this change?
     
  8. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    10:02 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    done
     
  9. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    5:02 PM
    Still stick with 7.17.8 now?
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    7:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yup
     
  11. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    5:02 PM
    Mainline
    10.2
    All my ES install are still on 7.17.11.
     
  12. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    5:02 PM
    This has been an ongoing problem. I've installed elasticsearch successfully but after a few days the front end of certain forums return the following screen:

    upload_2023-8-13_21-22-15.png

    Xenforo admin error log:

    Code (Text):
    Server error log
    XFES\Elasticsearch\ConnectException: cURL error 7: Failed connect to localhost:9200; Connection refused (see [URL]https://curl.haxx.se/libcurl/c/libcurl-errors.html[/URL]) src/addons/XFES/Elasticsearch/Api.php:405
    Generated by: user Aug 12, 2023 at 9:26 PM
    Stack trace
    #0 src/addons/XFES/Elasticsearch/Api.php(338): XFES\Elasticsearch\Api->request('GET', 'xyz/_search', '{
        "size": 0...')
    #1 src/addons/AL/FilterFramework/Service/ElasticSource.php(204): XFES\Elasticsearch\Api->requestFromIndex('GET', '_search', Array)
    #2 src/addons/AL/ThreadFilter/XFES/Search/Source/Elasticsearch.php(74): AL\FilterFramework\Service\ElasticSource->countFacets(Array, Array)
    #3 src/addons/AL/ThreadFilter/XF/Search/Search.php(65): AL\ThreadFilter\XFES\Search\Source\Elasticsearch->countFacetsByThreadIds(Array, Array)
    #4 src/addons/AL/ThreadFilter/Service/ContentTypeProvider.php(143): AL\ThreadFilter\XF\Search\Search->countFacetsByThreadIds(Array, Array)
    #5 src/addons/AL/FilterFramework/Service/FacetedSearchProvider.php(147): AL\ThreadFilter\Service\ContentTypeProvider->countFacetsByDiscussionIds(Array, Array)
    #6 src/addons/AL/FilterFramework/Service/ContextProvider.php(758): AL\FilterFramework\Service\FacetedSearchProvider->getFacetCounts(Array, Array, false)
    #7 src/addons/AL/ThreadFilter/XF/Pub/Controller/Forum.php(237): AL\FilterFramework\Service\ContextProvider->executeFacetedSearch(Object(SV\ThreadReplyBanTeeth\XF\Finder\Thread), Array)
    #8 src/addons/SV/RedisCache/XF/Pub/Controller/Forum.php(11): AL\ThreadFilter\XF\Pub\Controller\Forum->applyDateLimitFilters(Object(Truonglv\AnonymousPosting\XF\Entity\Forum), Object(SV\ThreadReplyBanTeeth\XF\Finder\Thread), Array)
    #9 src/XF/Pub/Controller/Forum.php(243): SV\RedisCache\XF\Pub\Controller\Forum->applyDateLimitFilters(Object(Truonglv\AnonymousPosting\XF\Entity\Forum), Object(SV\ThreadReplyBanTeeth\XF\Finder\Thread), Array)
    #10 src/addons/AL/ThreadFilter/XF/Pub/Controller/Forum.php(103): XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #11 src/addons/Andy/MembersRecentlyOnline/XF/Pub/Controller/Forum.php(74): AL\ThreadFilter\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #12 src/addons/Truonglv/AnonymousPosting/XF/Pub/Controller/Forum.php(58): Andy\MembersRecentlyOnline\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #13 src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php(37): Truonglv\AnonymousPosting\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #14 src/addons/Truonglv/PostReply/XF/Pub/Controller/Forum.php(14): Truonglv\Groups\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #15 src/addons/SV/AggregatingForums/XF/Pub/Controller/Forum.php(37): Truonglv\PostReply\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #16 src/addons/SV/StandardLib/XF/Pub/Controller/Forum.php(21): SV\AggregatingForums\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #17 src/addons/AddonFlare/GlobalIgnore/XF/Pub/Controller/Forum.php(21): SV\StandardLib\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #18 src/XF/Mvc/Dispatcher.php(352): AddonFlare\GlobalIgnore\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #19 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'Forum', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
    #20 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
    #21 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
    #22 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
    #23 src/XF.php(524): XF\App->run()
    #24 index.php(20): XF::runApp('XF\\Pub\\App')
    #25 {main}
    
    -------------
    
    Previous GuzzleHttp\Exception\ConnectException: cURL error 7: Failed connect to localhost:9200; Connection refused (see [URL]https://curl.haxx.se/libcurl/c/libcurl-errors.html[/URL]) - src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:200
    #0 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
    #1 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
    #2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
    #3 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
    #4 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
    #5 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(66): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
    #6 src/vendor/guzzlehttp/guzzle/src/Middleware.php(29): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
    #7 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
    #8 src/vendor/guzzlehttp/guzzle/src/Middleware.php(57): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
    #9 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
    #10 src/vendor/guzzlehttp/guzzle/src/Client.php(351): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
    #11 src/vendor/guzzlehttp/guzzle/src/Client.php(111): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
    #12 src/vendor/guzzlehttp/guzzle/src/Client.php(129): GuzzleHttp\Client->sendAsync(Object(GuzzleHttp\Psr7\Request), Array)
    #13 src/addons/XFES/Elasticsearch/Api.php(388): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request))
    #14 src/addons/XFES/Elasticsearch/Api.php(338): XFES\Elasticsearch\Api->request('GET', 'xyz/_search', '{
        "size": 0...')
    #15 src/addons/AL/FilterFramework/Service/ElasticSource.php(204): XFES\Elasticsearch\Api->requestFromIndex('GET', '_search', Array)
    #16 src/addons/AL/ThreadFilter/XFES/Search/Source/Elasticsearch.php(74): AL\FilterFramework\Service\ElasticSource->countFacets(Array, Array)
    #17 src/addons/AL/ThreadFilter/XF/Search/Search.php(65): AL\ThreadFilter\XFES\Search\Source\Elasticsearch->countFacetsByThreadIds(Array, Array)
    #18 src/addons/AL/ThreadFilter/Service/ContentTypeProvider.php(143): AL\ThreadFilter\XF\Search\Search->countFacetsByThreadIds(Array, Array)
    #19 src/addons/AL/FilterFramework/Service/FacetedSearchProvider.php(147): AL\ThreadFilter\Service\ContentTypeProvider->countFacetsByDiscussionIds(Array, Array)
    #20 src/addons/AL/FilterFramework/Service/ContextProvider.php(758): AL\FilterFramework\Service\FacetedSearchProvider->getFacetCounts(Array, Array, false)
    #21 src/addons/AL/ThreadFilter/XF/Pub/Controller/Forum.php(237): AL\FilterFramework\Service\ContextProvider->executeFacetedSearch(Object(SV\ThreadReplyBanTeeth\XF\Finder\Thread), Array)
    #22 src/addons/SV/RedisCache/XF/Pub/Controller/Forum.php(11): AL\ThreadFilter\XF\Pub\Controller\Forum->applyDateLimitFilters(Object(Truonglv\AnonymousPosting\XF\Entity\Forum), Object(SV\ThreadReplyBanTeeth\XF\Finder\Thread), Array)
    #23 src/XF/Pub/Controller/Forum.php(243): SV\RedisCache\XF\Pub\Controller\Forum->applyDateLimitFilters(Object(Truonglv\AnonymousPosting\XF\Entity\Forum), Object(SV\ThreadReplyBanTeeth\XF\Finder\Thread), Array)
    #24 src/addons/AL/ThreadFilter/XF/Pub/Controller/Forum.php(103): XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #25 src/addons/Andy/MembersRecentlyOnline/XF/Pub/Controller/Forum.php(74): AL\ThreadFilter\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #26 src/addons/Truonglv/AnonymousPosting/XF/Pub/Controller/Forum.php(58): Andy\MembersRecentlyOnline\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #27 src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php(37): Truonglv\AnonymousPosting\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #28 src/addons/Truonglv/PostReply/XF/Pub/Controller/Forum.php(14): Truonglv\Groups\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #29 src/addons/SV/AggregatingForums/XF/Pub/Controller/Forum.php(37): Truonglv\PostReply\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #30 src/addons/SV/StandardLib/XF/Pub/Controller/Forum.php(21): SV\AggregatingForums\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #31 src/addons/AddonFlare/GlobalIgnore/XF/Pub/Controller/Forum.php(21): SV\StandardLib\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #32 src/XF/Mvc/Dispatcher.php(352): AddonFlare\GlobalIgnore\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
    #33 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'Forum', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
    #34 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
    #35 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
    #36 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
    #37 src/XF.php(524): XF\App->run()
    #38 index.php(20): XF::runApp('XF\\Pub\\App')
    #39 {main}


    It turns out that the Elasticsearch server is disconnected.

    I need to manually restart it (# service elasticsearch start) for everything to come back. But this happens again after a few days.

    I tried to increase the memory (in /etc/elasticsearch/jvm.options) for this server to
    Code (Text):
    -Xms1g
    -Xmx1g
    


    (It's a "4096.00 MB AMD High Performance" in Vultr)

    It's a behind-the-firewall development forum, not yet public.

    But the problem is still there. Any one can help on this please?
     
  13. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    7:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Check your elasticsearch logs for clues in /var/log/elasticsearch IIRC. FYI, I wouldn't post your entire logs publicly though - check and mask any sensitive info. But if you can't figure it out yourself, might need to hire someone.
     
  14. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    5:02 PM
    which file should I look into?

    # pwd
    /var/log/elasticsearch

    Code (Text):
    gc.log
    gc.log.00
    gc.log.01
    gc.log.02                     
    gc.log.03
    gc.log.04
    gc.log.05
    gc.log.06
    gc.log.07
    gc.log.08
    gc.log.09
    gc.log.10
    gc.log.11
    gc.log.12
    gc.log.13
    gc.log.14
    gc.log.15
    gc.log.16
    gc.log.17
    gc.log.18
    gc.log.19
    gc.log.20
    gc.log.21
    gc.log.22
    gc.log.23
    gc.log.24
    gc.log.25
    gc.log.26
    gc.log.27
    gc.log.28
    gc.log.29
    gc.log.30
    test-2023-08-06-1.log.gz
    test-2023-08-07-1.json.gz
    test-2023-08-07-1.log.gz
    test-2023-08-08-1.json.gz
    test-2023-08-08-1.log.gz
    test-2023-08-09-1.json.gz
    test-2023-08-09-1.log.gz
    test-2023-08-10-1.json.gz
    test-2023-08-10-1.log.gz
    test-2023-08-14-1.json.gz
    test-2023-08-14-1.log.gz
    test_audit.json
    test_deprecation.json
    test_deprecation.log
    test_index_indexing_slowlog.json
    test_index_indexing_slowlog.log
    test_index_search_slowlog.json
    test_index_search_slowlog.log
    test.log
    test_server.json
     
  15. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    7:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Looks like it might be test.log seeing as it gets log rotated for timestamped .gz version too which would be older logs i.e. test-2023-08-14-1.log.gz
     
  16. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    5:02 PM
    Just to check if this thread (Elasticsearch 7.x) is still update for the latest centmin in AlmaLinux 9?
     
  17. duderuud

    duderuud Premium Member Premium Member

    249
    82
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +178
    Local Time:
    10:02 AM
    1.25 x
    10.6
    ES still works on EL9 yes
     
  18. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    5:02 PM
    Why such error?

    upload_2024-8-25_16-13-35.png

    upload_2024-8-25_16-13-44.png

    Code (Text):
    # service elasticsearch status
    ● elasticsearch.service - Elasticsearch
         Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; preset: disabled)
         Active: active (running) since Sun 2024-08-25 14:29:40; 1h 55min ago
           Docs: https://www.elastic.co
       Main PID: 683901 (java)
          Tasks: 55 (limit: 11074)
         Memory: 736.6M
            CPU: 1min 17.460s
         CGroup: /system.slice/elasticsearch.service
                 ├─683901 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networ>
                 └─684122 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
    
    Aug 25 14:28:52 main systemd[1]: Starting Elasticsearch...
    Aug 25 14:29:02 main systemd-entrypoint[683901]: Aug 25, 2024 2:29:02 PM sun.util.locale.provider.LocaleProviderAdapt>
    Aug 25 14:29:02 main systemd-entrypoint[683901]: WARNING: COMPAT locale provider will be removed in a future release
    Aug 25 14:29:40 main systemd[1]: Started Elasticsearch.
    
    

    Code (Text):
    # curl -XGET 'localhost:9200'
    {
      "name" : "xxx",
      "cluster_name" : "xxx",
      "cluster_uuid" : "g-KPoZKySpm5Pfdtov9XPg",
      "version" : {
        "number" : "7.17.23",
        "build_flavor" : "default",
        "build_type" : "rpm",
        "build_hash" : "61d76462eecaf09ada684d1b5d319b5ff6865a83",
        "build_date" : "2024-07-25T14:37:42.448799567Z",
        "build_snapshot" : false,
        "lucene_version" : "8.11.3",
        "minimum_wire_compatibility_version" : "6.8.0",
        "minimum_index_compatibility_version" : "6.0.0-beta1"
      },
      "tagline" : "You Know, for Search"
    }
    


    Does it relate to the following?

    Code (Text):
    # curl -IGET http://localhost:9200
    HTTP/1.1 200 OK
    X-elastic-product: Elasticsearch
    Warning: 299 Elasticsearch-7.17.23-61d76462eecaf09ada684d1b5d319b5ff6865a83 "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html to enable security."
    content-type: application/json; charset=UTF-8
    content-length: 524
    


    It seems to be ok if I uncheck the Use HTTPS connection option.

    upload_2024-8-25_16-21-26.png

    So is it ok if I leave it unchecked?
     
    Last edited: Aug 25, 2024
  19. duderuud

    duderuud Premium Member Premium Member

    249
    82
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +178
    Local Time:
    10:02 AM
    1.25 x
    10.6
    If you are running ES locally you can set set it to disabled.
    Just remember to set the config yml file to use "localhost":
    Code:
    network.host: localhost
    
     
  20. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    7:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    FYI, first post in this thread mentions this already ;)