Elasticsearch是一种先进的,高性能的,可扩展的开源搜索引擎,提供全文搜索和实时分析的结构化和非结构化的数据。
它的特定是可以通过HTTP使用RESTful API,很容易的融入现有的web架构。因此在高并发的情况下,采用nginx反向代理负载均衡到多台Elasticsearch 服务器上。
架构图:
这种架构的优点是:
下表比较Elasticsearch 、Elasticsearch +nginx F/OSS、Elasticsearch +NGINX Plus 的功能:
Elasticsearch client | nginx F/OSS | NGINX Plus | |
Horizontal scalability | Y | Y | Y |
Keepalive optimization | Y | Y | |
Centralized HTTP access logs | Y | Y | |
Queuing and concurrency control | Y | ||
Response caching | Y | Y | |
Failover of failed connections | Y | Y | Y |
Active monitoring of Elasticsearch nodes | Y (some clients) | Y | |
Advanced load balancing methods | Y | Y | |
Weighted load balancing | Y | Y | |
Dynamic reconfiguration | Y | ||
Status monitoring | Y | ||
General-purpose HTTP load balancing | Y | Y |
当使用NGINX Plus高可用性主动或被动配置负载均衡的Elasticsearch 服务器集群时,Elasticsearch 客户端通过nginx plus请求,而不是直接连接到Elasticsearch服务器,可以根据实际情况任意的扩展Elasticsearch服务器不用更新客户端。
部署NGINX Plus +Elasticsearch