Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory

Highlighted

Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory

Explorer

i m using HDP-2.5,ambari-2.4.2.0 and solr-5.3.0 which is on kerberos. I m getting error when i create collection.

to create collection used this command solr_Home$/bin/solr create -c SolrCollection1 -d data_driven_schema_configs -n mySolrConfigs -s 2 -rf 2

ERROR: Failed to create collection 'SolrCollection1' due to: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://hostname:8983/solr: Error CREATEing SolrCore 'SolrCollection1_shard2_replica2': Unable to create core [SolrCollection1_shard2_replica2] Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory

Please help me to figure out where did i mistake

this is my log file

ERROR (OverseerThreadFactory-5-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.OverseerCollectionProcessor Error f
rom shard: http://hostname:8983/solr
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://hostname:8983/solr: Error CREATE
ing SolrCore 'SolrCollection1_shard1_replica2': Unable to create core [SolrCollection1_shard1_replica2] Caused by: Found 2 configurati
on sections when at most 1 is allowed matching expression: directoryFactory
        at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:560)
        at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:234)
        at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:226)
        at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1220)
        at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:216)
        at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:181)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:210)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
1511013 INFO  (OverseerThreadFactory-5-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.OverseerCollectionProcessor Finishe
d create command on all shards for collection: SolrCollection1
1511015 INFO  (OverseerStateUpdate-242386254059733211-hostname:8983_solr-n_0000000010) [   ] o.a.s.c.Overseer processMessage: queu
eSize: 3, message = {
  "operation":"deletecore",
  "core":"SolrCollection1_shard2_replica2",
  "node_name":"hostname:8983_solr",
  "collection":"SolrCollection1",
  "core_node_name":"core_node2"} current state version: 23
1511017 INFO  (OverseerStateUpdate-242386254059733211-hostname:8983_solr-n_0000000010) [   ] o.a.s.c.o.ZkStateWriter going to upda
te_collection /collections/SolrCollection1/state.json version: 2
1511020 INFO  (OverseerStateUpdate-242386254059733211-hostname:8983_solr-n_0000000010) [   ] o.a.s.c.Overseer processMessage: queu
eSize: 3, message = {
  "operation":"deletecore",
  "core":"SolrCollection1_shard2_replica1",
  "node_name":"hostname:8983_solr",
  "node_name":"hostname:8983_solr",
  "collection":"SolrCollection1",
  "core_node_name":"core_node4"} current state version: 23
1511022 INFO  (OverseerStateUpdate-242386254059733211-hostname:8983_solr-n_0000000010) [   ] o.a.s.c.o.ZkStateWriter going to update_collection /collections/SolrCollection1/state.json version: 3
1511022 INFO  (zkCallback-4-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.DistributedQueue NodeChildrenChanged fired on path /overseer/queue state SyncConnected
1511027 INFO  (OverseerThreadFactory-5-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.OverseerCollectionProcessor Overseer Collection Processor: Message id:/overseer/collection-queue-work/qn-0000000028 complete, response:{failure={null=org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://hostname:8983/solr: Error CREATEing SolrCore 'SolrCollection1_shard1_replica1': Unable to create core [SolrCollection1_shard1_replica1] Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory,null=org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://hostname:8983/solr: Error CREATEing SolrCore 'SolrCollection1_shard2_replica2': Unable to create core [SolrCollection1_shard2_replica2] Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory,null=org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://hostname:8983/solr: Error CREATEing SolrCore 'SolrCollection1_shard2_replica1': Unable to create core [SolrCollection1_shard2_replica1] Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory,null=org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://hostname:8983/solr: Error CREATEing SolrCore 'SolrCollection1_shard1_replica2': Unable to create core [SolrCollection1_shard1_replica2] Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory}}
1511029 INFO  (zkCallback-4-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.DistributedQueue NodeDataChanged fired on path /overseer/collection-queue-work/qnr-0000000028 state SyncConnected
1511032 INFO  (zkCallback-4-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.DistributedQueue NodeChildrenChanged fired on path /overseer/collection-queue-work state SyncConnected
1511044 INFO  (OverseerStateUpdate-242386254059733211-hostname:8983_solr-n_0000000010) [   ] o.a.s.c.Overseer processMessage: queueSize: 1, message = {
  "operation":"deletecore",
  "core":"SolrCollection1_shard1_replica2",
  "node_name":"hostname:8983_solr",
  "collection":"SolrCollection1",
  "core_node_name":"core_node3"} current state version: 23
1511044 INFO  (qtp1450821318-20) [   ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/collections params={replicationFactor=2&maxShardsPerNode=4&collection.configName=mySolrConfigs&name=SolrCollection1&action=CREATE&numShards=2&wt=json} status=0 QTime=1622 
1511047 INFO  (zkCallback-4-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.DistributedQueue NodeChildrenChanged fired on path /overseer/queue state SyncConnected
1511052 INFO  (zkCallback-4-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.c.ZkStateReader A cluster state change: WatchedEvent state:SyncConnected type:NodeDataChanged path:/clusterstate.json, has occurred - updating... (live nodes size: 1)
1511054 INFO  (zkCallback-4-thread-2-processing-n:hostname:8983_solr) [   ] o.a.s.c.c.ZkStateReader Updated cluster state version :


thanks in advance.

2 REPLIES 2

Re: Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory

Explorer

That means Solr thinks it's main configuration file, solrconfig.xml, has two sections defining the directory factory, which controls how the indexes are stored. For storing indexes in HDFS, you need to change the directoryFactory configuration to use the proper directoryFactory (HdfsDirectoryFactory). I think Ambari will automatically configure this - is it possible you are also manually modifying the file? Or, is it possible you manually modified it but didn't remove the original directoryFactory configuration? Since in your example you are using the data_driven_schema_configs, you should look in ./server/solr/configsets/data_driven_schema_configs/conf/solrconfig.xml and see if you have two sections there.

Re: Caused by: Found 2 configuration sections when at most 1 is allowed matching expression: directoryFactory

Explorer

thanks for quick reply. it try to modify it manually.

Don't have an account?
Coming from Hortonworks? Activate your account here