Enough time has past this may not be useful for you, but...
I'm catching up on mail and your subject line & question intrigued me (even though i have no real experience with Kerberized Solr clusters) because i oculdn't understand why it would be problematic... ...and then i looked at how Krb5HttpClientBuilder works. Ugh. I honestly have no idea why this code was written to *only* look at a sys property for it's kerb config, but I will point out two suggestions... 1. you are't required to use it. You could always duplicate Krb5HttpClientBuilder in your own code, ripping out the static variables and use of System.getProperty and replacing them with getters/setters on your instances that you call directly in your code 2. Someone clearly noticed that it was a PITA to use multiple instances of Krb5HttpClientBuilder in a single JVM -- because the ran into that PITA whn rying to write tests for it, and added a special hack to work around that... https://solr.apache.org/docs/8_11_0//solr-solrj/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.html#regenerateJaasConfiguration-- ...so you could always try to wrap that in your own (synchronized) helper metod... public synchronized SolrHttpClientBuilder get(...stuff...) { Krb5HttpClientBuilder.regenerateJaasConfiguration() System.setProperty(...stuff...) return (new Krb5HttpClientBuilder()).getBuilder(); } -Hoss http://www.lucidworks.com/ : Date: Sat, 21 Jun 2025 15:57:04 +0100 : From: Chris H <khyc...@googlemail.com.invalid> : Reply-To: users@solr.apache.org : To: users@solr.apache.org : Subject: Two instances of CloudSolrClient pointing to two Kerberized Solr : clusters in the same JVM : : Hi all, : : In my team we're migrating to Cloudera hosted Solr version 7.4.0 to 8.11.2. : For the interim period we would like to have two instances of : CloudSolrClient in our app, one pointing to the v7.4.0 cluster and the : other pointing to the 8.11.2. : : Our app is a SpringBoot one and we use the SolrJ client. The current config : that produces a single instance of CloudSolrClient looks somewhat like this : : : @Bean : public SolrClient getCloudSolrClient() { : : System.setProperty("zookeeper.sasl.client", "false"); : SolrHttpClientBuilder solrClientBuilder = new : Krb5HttpClientBuilder().getBuilder(); : HttpClientUtil.setHttpClientBuilder(solrClientBuilder); : : : CloudSolrClient client = new : CloudSolrClient.Builderr(asList(properties.getZkHosts().split(",")), : Optional.empty()) : .withConnectionTimeout((int)properties.getConnectionTimeout().toMillis()) : .withSocketTimeout((int) properties.getTimeout().toMillis()) : .build() : : return client; : : } : : We figured that for two client instances authenticating with cluster : members using Kerberos we would obviously need jaas.conf with two realms : and all that, but after exploring the SolrJ client code a bit we fear that : because the JaasConfig is static we fear that we may run into multi : threaded related issues like race conditions etc. : : Has anyone here faced a similar requirement and perhaps arrived at an : acceptable and working solution? : : Any hints and pointers will be greatly appreciated! : : Chris :