Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 51D3C200BF0 for ; Thu, 15 Dec 2016 18:34:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 50736160B13; Thu, 15 Dec 2016 17:34:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 971DB160B15 for ; Thu, 15 Dec 2016 18:34:50 +0100 (CET) Received: (qmail 87329 invoked by uid 500); 15 Dec 2016 17:34:43 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 87309 invoked by uid 99); 15 Dec 2016 17:34:41 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2016 17:34:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6ADDEC662A for ; Thu, 15 Dec 2016 17:34:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.1 X-Spam-Level: X-Spam-Status: No, score=-3.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-2.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=elyograg.org Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id N_k0qVZuo1O2 for ; Thu, 15 Dec 2016 17:34:37 +0000 (UTC) Received: from frodo.elyograg.org (frodo.elyograg.org [166.70.79.219]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AED9C5FB5D for ; Thu, 15 Dec 2016 17:34:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by frodo.elyograg.org (Postfix) with ESMTP id 03B53BC6 for ; Thu, 15 Dec 2016 10:34:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=elyograg.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:subject:subject:received:received; s=mail; t= 1481823246; bh=hL0Kr4aMo5XR3nk39myXyDq5pzF733nFTOmJig5qUD0=; b=k F8R8OSlD5KESo/H6G0G0rfcpE+MZKwR/OnOlIjuJVPciMMaHsYz+kXx9Qy89exHN +ZHV7RV4tgzkDn7xkigS4m1BA1t5ld/Ggk9xKU6HDHiP1RAe8pvnSsFGLstjnCWj XRBXyH11EVa/fmBmiJQU6+sPgfhTJyn3nCw5HIxenU= X-Virus-Scanned: Debian amavisd-new at frodo.elyograg.org Received: from frodo.elyograg.org ([127.0.0.1]) by localhost (frodo.elyograg.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id d85iKoj1AzK8 for ; Thu, 15 Dec 2016 10:34:06 -0700 (MST) Received: from [10.2.0.108] (client175.mainstreamdata.com [209.63.42.175]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: elyograg@elyograg.org) by frodo.elyograg.org (Postfix) with ESMTPSA id 6152FBC3 for ; Thu, 15 Dec 2016 10:34:06 -0700 (MST) Subject: Re: Has anyone used linode.com to run Solr | ??Best way to deliver PHP/Apache clients with Solr question To: solr-user@lucene.apache.org References: From: Shawn Heisey Message-ID: Date: Thu, 15 Dec 2016 10:34:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit archived-at: Thu, 15 Dec 2016 17:34:51 -0000 On 12/14/2016 7:36 AM, GW wrote: > I understand accessing solr directly. I'm doing REST calls to a single > machine. > > If I have a cluster of five servers and say three Apache servers, I can > round robin the REST calls to all five in the cluster? > > I guess I'm going to find out. :-) If so I might be better off just > running Apache on all my solr instances. If you're running SolrCloud (which uses zookeeper) then sending multiple query requests to any node will load balance the requests across all replicas for the collection. This is an inherent feature of SolrCloud. Indexing requests will be forwarded to the correct place. The node you're sending to is a potential single point of failure, which you can eliminate by putting a load balancer in front of Solr that connects to at least two of the nodes. As I just mentioned, SolrCloud will do further load balancing to all nodes which are capable of serving the requests. I use haproxy for a load balancer in front of Solr. I'm not running in Cloud mode, but a load balancer would also work for Cloud, and is required for high availability when your client only connects to one server and isn't cloud aware. http://www.haproxy.org/ Solr includes a cloud-aware Java client that talks to zookeeper and always knows the state of the cloud. This eliminates the requirement for a load balancer, but using that client would require that you write your website in Java. The PHP clients are third-party software, and as far as I know, are not cloud-aware. https://wiki.apache.org/solr/IntegratingSolr#PHP Some advantages of using a Solr client over creating HTTP requests yourself: The code is easier to write, and to read. You generally do not need to worry about making sure that your requests are properly escaped for URLs, XML, JSON, etc. The response to the requests is usually translated into data structures appropriate to the language -- your program probably doesn't need to know how to parse XML or JSON. Thanks, Shawn