我通过 FOSElasticaBundle 在系统中使用 Elasticsearch 和 Symfony2。
虽然我只使用一台服务器,但可以clients
像这样配置配置:
https ://github.com/FriendsOfSymfony/FOSElasticaBundle#basic-configuration
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
但是当涉及到集群时,我尝试过以某种方式进行配置,但它不起作用,如下所示:
fos_elastica:
clients:
default: [{host: localhost, port: 9200},{host: localhost, port: 9201}]
和这个:
fos_elastica:
clients:
default:
- { host: localhost, port: 9200 }
- { host: localhost, port: 9201 }
我知道 FOSElasticaBundle 使用Elastica 库,并且该库使用参数数组连接到集群,这就是我尝试上述方法的原因。
有谁知道如何连接以配置 FOSElasticaBundle 以连接到某个集群?
提前致谢。