Support Questions

Find answers, ask questions, and share your expertise

Solr Password - When trying to create a collection in SSH

avatar
Explorer

Hi

I'm trying to create a tweet collection and need to chance the owner for opt/lucidworks-hdpsearch/solr.

However, when I attempt to do this i get 'Operation not permitted'. So then I attempted to run the command as sudo, however now I am being asked for the solr password. As far as I know i've not set one and i can't seem to locate a default username/password for solr. please can someone help?

Thank you

[solr@sandbox dashboards]$ chown -R solr:solr /opt/lucidworks-hdpsearch/solr

chown: changing ownership of `/opt/lucidworks-hdpsearch/solr/server/solr-webapp/webapp/banana/app/dashboards/default.json': Operation not permitted

[solr@sandbox dashboards]$ sudo -u hdfs hadoop fs chown -R solr:solr /opt/lucidworks-hdpsearch/solr

We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.

#2) Think before you type.

#3) With great power comes great responsibility.

[sudo] password for solr:

Sorry, try again.

1 ACCEPTED SOLUTION

avatar
Super Collaborator

@Raf Mohammed , you can change ownership file if you're root. You cannot use sudo fo solr user because it does not have an sudo access. If you run sudo chown -R solr:solr /opt/lucidworks-hdpsearch/solr, it will not work.

You can however change the owning group to a group you're a member of. Your directory has solr:hadoop (as user and group) and you are changing it to solr:solr. But if you check whether solr group has solr user, you will not be able to find it because it is not there. So now you have to add solr user to the solr group. Run this command as root:

usermod -a -G solr solr

Now if you try your command, it should work.

PS: Doing this : sudo -u hdfs hadoop fs chown -R solr:solr /opt/lucidworks-hdpsearch/solr

does not make any sense because it is a local directory, not HDFS directory.

View solution in original post

6 REPLIES 6

avatar
Super Collaborator

@Raf Mohammed , you can change ownership file if you're root. You cannot use sudo fo solr user because it does not have an sudo access. If you run sudo chown -R solr:solr /opt/lucidworks-hdpsearch/solr, it will not work.

You can however change the owning group to a group you're a member of. Your directory has solr:hadoop (as user and group) and you are changing it to solr:solr. But if you check whether solr group has solr user, you will not be able to find it because it is not there. So now you have to add solr user to the solr group. Run this command as root:

usermod -a -G solr solr

Now if you try your command, it should work.

PS: Doing this : sudo -u hdfs hadoop fs chown -R solr:solr /opt/lucidworks-hdpsearch/solr

does not make any sense because it is a local directory, not HDFS directory.

avatar
Explorer

@Mushtaq Rizvi Thanks for this, but I'm still doing something wrong but can't see what:

[root@sandbox ~]# usermod -a -G solr solr

[root@sandbox ~]# chown -R solr:solr /opt/lucidworks-hdpsearch/solr

[root@sandbox ~]# su solr

[solr@sandbox root]$ cp -R /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs

[solr@sandbox root]$ /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf/solrconfig.xml

bash: /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf/solrconfig.xml: Permission denied

avatar
Super Collaborator

@Raf Mohammed

You ran chown command from root user, if you would have been ran it from solr user, that would have worked too. Running from root basically wasted your usermod thing.

Coming to the current issue, can you please check the permission of that file you want to access.

avatar
Explorer

@Mushtaq Rizvi Here are the permissions for the file solrconfig.xml

[solr@sandbox root]$ ls -l /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf

total 144

-rw-r--r-- 1 solr solr 60612 Nov 26 03:43 solrconfig.xml

Thanks

avatar
Super Collaborator

@Raf Mohammed, with that permission,you should be able to edit the file. Can you please open that file?

vi /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf/solrconfig.xml

avatar
Explorer

wow thanks! how come I've just managed to open and edit and save this file but wasn't able to do so earlier? (Sorry if i sound really stupid, i've been working on a project all day)