Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Permission error while creating solr collection in CDH 5.5

avatar
Contributor

Basically trying to create a Hue dashboard so i am trying to create index
as per below cloudera exercise 4

http://www.cloudera.com/developers/get-started-with-hadoop-tutorial/exercise-4.html

Hence Below commands ran as expected in CDH 5.5

solrctl --zk quickstart:2181/solr instancedir --generate solr_configs

 

solrctl --zk quickstart:2181/solr instancedir --create live_logs ./solr_configs

But while below command to create collection

solrctl --zk quickstart:2181/solr collection --create live_logs -s 1

I got below exception


Error CREATEing SolrCore 'live_logs': Unable to create core [live_logs] Caused by: Permission denied: user=solr, access=WRITE, inode="/solr":hdfs:supergroup:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkFsPermission(DefaultAuthorizationProvider.java:257) at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check(DefaultAuthorizationProvider.java:238) at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check(DefaultAuthorizationProvider.java:216) at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkPermission(DefaultAuthorizationProvider.java:145) at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:138) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:6609) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:6591) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkAncestorAccess(FSNamesystem.java:6543) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal(FSNamesystem.java:4331) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInt(FSNamesystem.java:4301) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:4274) at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs(NameNodeRpcServer.java:866) at org.apache.hadoop.hdfs.server.namenode.AuthorizationProviderProxyClientProtocol.mkdirs(AuthorizationProviderProxyClientProtocol.java:321) at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.mkdirs(ClientNamenodeProtocolServerSideTranslatorPB.java:601) at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java) at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617) at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1060) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2086) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2082) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671) at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2080)


I tried to gave permissions to user solr by issuing below command

sudo -u hdfs hdfs dfs -chmod 775 /
sudo -u hdfs hdfs dfs -mkdir /user
sudo -u hdfs hdfs dfs -chown solr:solr /user
sudo -u hdfs hdfs dfs -mkdir /tmp
sudo -u hdfs hdfs dfs -chown solr:solr /tmp

But no success as of now i am still no able to create collection because of above error of
<<QUOTE>>
Permission denied: user=solr, access=WRITE
<<UNQUOTE>>

 

 

1 ACCEPTED SOLUTION

avatar

The error is reporting a problem when trying to write into the "/solr" directory, as indicated here:

Unable to create core [live_logs] Caused by: Permission denied: user=solr, access=WRITE, inode="/solr":hdfs:supergroup:drwxr-xr-x at

 

You need to give the solr user ownership of the "/solr" directory in hdfs.

sudo -u hdfs hdfs dfs -chown solr:solr /solr

 

Additionally, you hvae changed permissions/ownership on the /user folder and /tmp, which is not recommended:

 

sudo -u hdfs hdfs dfs -chown solr:solr /user
sudo -u hdfs hdfs dfs -mkdir /tmp
sudo -u hdfs hdfs dfs -chown solr:solr /tmp

 

 

-pd

 

 

View solution in original post

2 REPLIES 2

avatar

The error is reporting a problem when trying to write into the "/solr" directory, as indicated here:

Unable to create core [live_logs] Caused by: Permission denied: user=solr, access=WRITE, inode="/solr":hdfs:supergroup:drwxr-xr-x at

 

You need to give the solr user ownership of the "/solr" directory in hdfs.

sudo -u hdfs hdfs dfs -chown solr:solr /solr

 

Additionally, you hvae changed permissions/ownership on the /user folder and /tmp, which is not recommended:

 

sudo -u hdfs hdfs dfs -chown solr:solr /user
sudo -u hdfs hdfs dfs -mkdir /tmp
sudo -u hdfs hdfs dfs -chown solr:solr /tmp

 

 

-pd

 

 

avatar
Contributor

Thank you that worked and helped me