Giter Site home page Giter Site logo

solariumphp / solarium-cloud Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 133 KB

solarium extension to connect to SolrCloud via Zookeeper

License: BSD 2-Clause "Simplified" License

PHP 100.00%
php search solarium solr solr-client solrcloud zookeeper zookeeper-client

solarium-cloud's People

Contributors

jsteggink avatar mkalkbrenner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

isabella232

solarium-cloud's Issues

can not run

phpcode:

include "vendor/autoload.php";
$options = array('zkhosts' => 'ld-bp1689qv29zb12203-master2-001.hbaseue.rds.aliyuncs.com:2181,ld-bp1689qv29zb12203-master1-001.hbaseue.rds.aliyuncs.com:2181,ld-bp1689qv29zb12203-master3-
001.hbaseue.rds.aliyuncs.com:2181/solr');
$client = new \Solarium\Cloud\Client($options);
$client->setCollection('ordercollection');
$query = $client->createSelect();
$result = $client->select($query);

PHP Notice: Undefined property: Solarium\Cloud\Core\Zookeeper\ZkStateReader::$zkTimeout in /xinhua/solarium-cloud/src/Solarium/Cloud/Core/Zookeeper/ZkStateReader.php on line 162

Notice: Undefined property: Solarium\Cloud\Core\Zookeeper\ZkStateReader::$zkTimeout in /xinhua/solarium-cloud/src/Solarium/Cloud/Core/Zookeeper/ZkStateReader.php on line 162
PHP Warning: Zookeeper::__construct() expects parameter 1 to be string, array given in /xinhua/solarium-cloud/src/Solarium/Cloud/Core/Zookeeper/ZkStateReader.php on line 162

Problem with cloud solr

An uncaught Exception was encountered

Type: Solarium\Exception\UnexpectedValueException

Message: Solr JSON response could not be decoded

Filename: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/vendor/solarium/solarium/src/Core/Query/Result/Result.php

Line Number: 114

Backtrace:

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/src/Solarium/Cloud/QueryType/Admin/Collections/ResponseParser.php
Line: 49
Function: getData

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/vendor/solarium/solarium/src/Core/Query/Result/QueryType.php
Line: 37
Function: parse

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/src/Solarium/Cloud/QueryType/Admin/Collections/Result.php
Line: 65
Function: parseResponse

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/src/Solarium/Cloud/QueryType/Admin/Collections/Result.php
Line: 91
Function: getComponent

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/src/Solarium/Cloud/Core/Zookeeper/SolrCloudStateReader.php
Line: 58
Function: getClusterStatus

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/src/Solarium/Cloud/Core/Client/CloudClient.php
Line: 1371
Function: __construct

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/vendor/solarium/solarium/src/Core/Configurable.php
Line: 82
Function: init

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/vendor/solarium/solarium/src/Core/Configurable.php
Line: 39
Function: setOptions

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/src/Solarium/Cloud/Core/Client/CloudClient.php
Line: 257
Function: __construct

File: /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/Solarium_cloud.php
Line: 25
Function: __construct

Failover when zookeeper instance is down

This is more of a general question about failover using solarium cloud connecting to a few zookeeper instances.

I have configured 3 Zookeeper servers with 3 shards and 3 replicas, all working ok and able to connect to them.

My solarium cloud config is the following:

[
  'zkhosts' => 'HOST1:2181,HOST2:2181,HOST3:2181',
  'defaultcollection' => 'COLLECTION_NAME',
]

I am able to use solarium cloud and connect ok, perform queries, etc.

But after finally finishing configuring everything and connecting, I decided to test what would happen if one of my instance were to actually go down - the reason behind using SolrCloud in the first place.

I have tried the following scenarios: stop the server altogether, stop Zookeer on the server, stop Solr on the server but have Zookeeper running.

And I got to the following conclusions:

  1. If the server itself is completely down and solarim cloud happens to choose that host to direct the query to then I get "operation timeout" exception - I assume since port 2181 is not reachable at all so the timeout limit kicks in.

  2. If I stop zookeeper on the server and solarim cloud sends the request to that host then I get "connection loss" - I assume since port 2181 is reachable but the service is not running at all so the connection is not established?

  3. If zookeeper is running but I stop Solr on the server, then everything works fine - if solarium cloud sends a request to that host then zookeeper figures out that solr is down and directs the query to another instance which is up - so everything works fine in this case.

My question is whether it's actually possible to get it to failover correctly to the live instances in the first two scenarios? Or am I approaching this the wrong way? Or it's meant to behave that way and I should have failover at a different step?

Would a correct/possible solution be to stick a load balancer in front of the 3 zookeeper instances, and have the health check on port 2181 and if one of the zookeepers is not answering then don't direct any requests to it?
In that case my "zkhosts" would be "load_balancer_host:2181"

Not quite sure whether this question is suitable for this issue queue? or I should post it on stack overflow maybe?

Thanks!

Add repo to packagist.org

I'd like to add this repo to packagist. However, only the owner of the vendor 'solarium' can do this. It would be great to add the packagist API to the webhooks of this repo.

Problems installing solarium-cloud

After install all the package, get the follow error:

Fatal error: Class 'Solarium\Cloud\Core\Client\Request' not found in /home/buffalo/public_html/scripts/autopartes/hoosk/hoosk0/libraries/solarium-cloud/src/Solarium/Cloud/Core/Client/AdminRequest.php on line 39
A PHP Error was encountered
Severity: Error
Message: Class 'Solarium\Cloud\Core\Client\Request' not found
Filename: Client/AdminRequest.php
Line Number: 39
Backtrace:

Can you help me please?

Multiple connections created with Zookeeper with TIME_WAIT status

Hello There,

Hope you are doing well, I am using this solarium-cloud library with PHP zookeeper extension.
After creating the singleton instance of solar cloud client, we have observed during the performance test that it creates so many connections with TIME_WAIT status.
Can you please guide us about the probable cause?
And how can we mitigate the same.
Thanks in advance for your help.
Regards,
Ashish Verma

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.