Giter Site home page Giter Site logo

Comments (6)

beowulfenator avatar beowulfenator commented on June 6, 2024 2

This is the expected behavior. If the extension retried connections to different nodes, this would be a debugging nightmare. If you need that kind of behavior, set up a coordinator node in your cluster:

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#coordinating-only-node

from yii2-elasticsearch.

yii-bot avatar yii-bot commented on June 6, 2024

Thanks for posting in our issue tracker.
In order to properly assist you, we need additional information:

  • When does the issue occur?
  • What do you see?
  • What was the expected result?
  • Can you supply us with a stacktrace? (optional)
  • Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)

Thanks!

This is an automated comment, triggered by adding the label status:need more info.

from yii2-elasticsearch.

fuzongtang avatar fuzongtang commented on June 6, 2024
'elasticsearch' => [
            'class' => 'yii\\elasticsearch\\Connection',
            'nodes' => [
                ['http_address' => '172.17.129.190:9200'],
                ['http_address' => '172.17.129.179:9200'],

                // configure more hosts if you have a cluster
            ],
            // set autodetectCluster to false if you don't want to auto detect nodes
            'autodetectCluster' => true,
            'dslVersion' => 5, // default is 5
        ],

When the first node hangs up, the system reports an error。

Elasticsearch Database Exception – yii\elasticsearch\Exception
Elasticsearch request failed: 7 - Failed to connect to 172.17.129.190 port 9200: Connection refused
Error Info: Array
(
    [requestMethod] => GET
    [requestUrl] => http://172.17.129.190:9200/_nodes/_all/http
    [requestBody] => 
    [responseHeaders] => Array
        (
        )

    [responseBody] => 
)

So have to make sure that the first node works ?
Won't the cluster switch automatically?

from yii2-elasticsearch.

fuzongtang avatar fuzongtang commented on June 6, 2024
'elasticsearch' => [
            'class' => 'yii\\elasticsearch\\Connection',
            'nodes' => [
                ['http_address' => '172.17.129.190:9200'],
                ['http_address' => '172.17.129.179:9200'],

                // configure more hosts if you have a cluster
            ],
            // set autodetectCluster to false if you don't want to auto detect nodes
            'autodetectCluster' => true,
            'dslVersion' => 5, // default is 5
        ],

When the first node hangs up, the system reports an error。

Elasticsearch Database Exception – yii\elasticsearch\Exception
Elasticsearch request failed: 7 - Failed to connect to 172.17.129.190 port 9200: Connection refused
Error Info: Array
(
    [requestMethod] => GET
    [requestUrl] => http://172.17.129.190:9200/_nodes/_all/http
    [requestBody] => 
    [responseHeaders] => Array
        (
        )

    [responseBody] => 
)

So have to make sure that the first node works ?
Won't the cluster switch automatically?

@knut
@samdark
@yii-bot
@nergal

from yii2-elasticsearch.

bizley avatar bizley commented on June 6, 2024

Please don't call out people like that, it's not Twitter.
As far as I can see in the code node must reply with non-500 status to switch to a different one. I'm not sure why it's like that since it would be logical to skip it as well. I'm not expert in ES though.

from yii2-elasticsearch.

fuzongtang avatar fuzongtang commented on June 6, 2024

This is the expected behavior. If the extension retried connections to different nodes, this would be a debugging nightmare. If you need that kind of behavior, set up a coordinator node in your cluster:

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#coordinating-only-node

If so, what is the point of cluster configuration?

'nodes' => [
                ['http_address' => '172.17.129.190:9200'],
                ['http_address' => '172.17.129.179:9200'],

                // configure more hosts if you have a cluster
            ],

from yii2-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.