Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.
solr collection생성시 -shards와 -replicationFactor값을 잘못지정하면 write.lock for client xxx.xxx.xxx.xxx already exists오류가 발생한다.
solr 인스턴스가 한개 기동된 상태에서 collection을 생성하기 위해서 아래와 같이 -shards, -replicationFactor를 가용한것보다
더 크게 지정하게 되면 write.lock for client xxx.xxx.xxx.xxx already exists오류가 발생한다.
특히 Hdfs를 사용하는 경우는 solrconfig.xml파일에서 DirectoryFactory설정을
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.HdfsDirectoryFactory}">으로 반드시 변경해 주어야 한다.
또한
<lockType>${solr.lock.type:native}</lockType>을 <lockType>${solr.lock.type:hdfs}</lockType> 로 변경한다.
----------------실행명령---------------------
./solr create -c gc -shards 4 -replicationFactor 3 -n gc
------------------------------------오류 메세지--------------------------
Connecting to ZooKeeper at gsda1:2181,gsda2:2181,gsda3:2181 ...
Uploading /svc/apps/sda/bin/hadoop/solr-5.5.0/server/solr/configsets/data_driven_schema_configs/conf for config gc to ZooKeeper at gsda1:2181,gsda2:2181,gsda3:2181
Creating new collection 'gc' using command:
http://localhost:8080/solr/admin/collections?action=CREATE&name=gc&numShards=4&replicationFactor=3&maxShardsPerNode=4&collection.configName=gc
ERROR: Failed to create collection 'gc' due to: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://XXX.XXX.XXX.43:8080/solr: Error CREATEing SolrCore 'gc_shard2_replica3': Unable to create core [gc_shard2_replica3] Caused by: /user/root/solr/solrdf/index/write.lock for client xxx.xxx.xxx.xxx already exists
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFileInternal(FSNamesystem.java:2563)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFileInt(FSNamesystem.java:2450)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFile(FSNamesystem.java:2334)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.create(NameNodeRpcServer.java:623)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.create(ClientNamenodeProtocolServerSideTranslatorPB.java:397)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2049)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2045)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2043)