solariumphp / solarium-cloud Goto Github PK
View Code? Open in Web Editor NEWsolarium extension to connect to SolrCloud via Zookeeper
License: BSD 2-Clause "Simplified" License
solarium extension to connect to SolrCloud via Zookeeper
License: BSD 2-Clause "Simplified" License
What is the state of this library? It says it's not ready for production, would it be possible to outline why?
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
Call to a member function getNodesBaseUris() on array
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
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:
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.
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?
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!
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.
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?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.