On Mon, Jul 13, 2015 at 11:53 PM, <[email protected]> wrote:

> I have a simple solr client using SolrJ. The configuration is on my dev
> box. BTW - I am a newbie to Scala and Akka, but experienced with Solr and
> java.
> Java 8
> Scala 2.11.6
> Akka 2.11-2.3.11 actor and cluster (scala)
> Solr 5.2.1 (simple with 1 replica)
> Zookeeper 3.4.6 (external to solr)
>
> The code shown below works fine when invoked from a Java and Scala app. It
> works fine within an Actor inside a debugger where I step through each
> thread instance. However I receive zookeeper connection timeout errors when
> starting up the actors. The akka conf if from the cluster example.
>
> My question is - I am assuming the the actor system startup is
> initializing the actors which overwhelm the zookeeper. So how do I change
> the akka config or component within to gracefully startup the actors?
>

There is no such thing. You have to implement it programatically.


>
> akka {
>
>   actor.provider = "akka.cluster.ClusterActorRefProvider"
>
>   remote.netty.tcp.port=0
>   remote.netty.tcp.hostname=127.0.0.1
>
>   cluster {
>     seed-nodes = [
>       "akka.tcp://[email protected]:2551",
>       "akka.tcp://[email protected]:2552"]
>
>     auto-down-unreachable-after = 10s
>   }
>
>   extensions = ["akka.contrib.pattern.ClusterReceptionistExtension"]
>
>   persistence {
>     journal.plugin = "akka.persistence.journal.leveldb-shared"
>     journal.leveldb-shared.store {
>       # DO NOT USE 'native = off' IN PRODUCTION !!!
>       native = off
>       dir = "target/shared-journal"
>     }
>     snapshot-store.local.dir = "target/snapshots"
>   }
> }
>
>
> public class SolrClient implements Serializable
> {
>   private static final long serialVersionUID = -4513334052072169081L;
>   private static final int  CONNECT_TIMEOUT  = 60000;
>   private static final int  CLIENT_TIMEOUT   = 100000;
>
>   private CloudSolrClient server = null;
>
>
>
> /*************************************************************************************************************************/
>   /**
>    * Used for initializing any initial configuration such as the Solr
> Server
>    *
>    */
>   public synchronized void config( String zooKeepers, String collection )
>     throws SolrException
>   {
>     server = new CloudSolrClient( zooKeepers );
>     server.setDefaultCollection(  collection );
>
>     server.setParallelUpdates(  true );
>     server.setZkConnectTimeout( CONNECT_TIMEOUT );
>     server.setZkClientTimeout(  CLIENT_TIMEOUT  );
>   }
>
>
> /******************************************************************************************************************/
>   /**
>    *
>    */
>   public synchronized List<SolrOntologyNode> getOntologies()
>   {
>     List<SolrOntologyNode> rootNodes = null;
>
>     SolrQuery query = new SolrQuery();
>     query.setQuery( "-" + _IndexKeyIF.PARENTS + ":[\"\" TO *]" );
>     query.setRows(1000);
>
>     try
>     {
>       QueryResponse rsp = server.query( query );
>       rootNodes = rsp.getBeans( SolrOntologyNode.class );
>     } catch( Exception e )
>       {
>         System.out.println( "SolrClient.getRootNodes() - Error = " +
> e.getMessage() );
>         e.printStackTrace();
>       }
>
>     return rootNodes;
>   }
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to