Created 11-27-2016 05:19 PM
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.
Created 11-27-2016 05:59 PM
@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.
Created 11-27-2016 05:59 PM
@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.
Created 11-27-2016 06:47 PM
@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
Created 11-27-2016 06:54 PM
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.
Created 11-27-2016 07:10 PM
@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
Created 11-27-2016 07:14 PM
@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
Created 11-27-2016 09:01 PM
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)