Thank-you for reading this. I am stuck at step three on this tutorial pertaining to installing Cassandra: http://wiki.apache.org/cassandra/GettingStarted#Step_3:_Start_Cassandra
I can only run this software as root. (shouting this over fictional helicopter noise) This seem like a terrible way to run the software.
When starting the Cassandra server as my normal user I receive the following errors:
1.) 15:46:00,147 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/var/log/cassandra/system.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
2.) ERROR 20:46:00 Doesn't have write permissions for /var/lib/cassandra/data directory
I tried changing the permissions several times and nothing has worked. I tried changing the /var/log/cassandra/system.log permissions for read/write for the cassandra group on the operating-system (OS). The command I used to do this was, sudo chmod 664 /var/log/cassandra/system.log. I found this page helpful in determining how to change the permissions:http://www.linux.org/threads/file-permissions-chmod.4094/
Then, I added my user-name to the cassandra group. From my understanding running the /usr/sbin/cassandra -f command as my user should allow me to access the /var/log/cassandra/system.log file, which would solve one of the errors, error number 1 above.
Respectfully,
user
Give the user you want permissions to the data and commitlog dirs.
sudo chown -R cassandra:cassandra /var/lib/cassandra/data
sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog
I found a solution! I ran sudo -u cassandra /usr/sbin/cassandra -f and then ran into problems with the commitlog directory Phact mentions in his answer. I then ran Phact's recursive chown command, sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog and the Cassandra server started up correctly just as it would if I was running the program as the root user. :D :D :D
Related
I was trying to deploy spark-jobserver on a EMR cluster, as per this documentation "https://github.com/spark-jobserver/spark-jobserver/blob/master/doc/EMR.md#configure-master-box"
Was able to install the job-server on emr, but while starting the server using ./server_start.sh on "/mnt/lib/spark-jobserver" (you can find it in my cluster), it was showing
"mkdir: cannot create directory ‘/mnt/var/log/spark-jobserver\r’: Permission denied".
I have tried to give permission to it using chmod and also tried chown command, but all of these didnt work.
Further I had also tried logging in with ec2-user, but this even didnt help.
Can you please tell what more else is needed to be done in order to get it deployed on emr, or emr is not capable of doing this.
Logs:
[hadoop#ip-10-0-0-50 spark-jobserver]$ ./server_start.sh
mkdir: cannot create directory ‘/mnt/var/log/spark-jobserver\r’: Permission denied
Did you try giving permissions recursively?
chmod -R 777 dirname
I upgraded my server from easy apache 3 to 4 and gained some permission issues, I ran:
chown -R nobody /home/myuser/public_html
in the server, which corrected this, now that directory is no where to be seen on cpanel but the site is still live.
Can I put the directory back but simply using:
chown -R myuser /home/nobody/public_html when ssh'd in as root?
Self managed server so my host won't help me.
Thanks Brad
Yes, you can change the permission using below command.
chown -R myuser /home/myuser/public_html
I used a specific library that used an embedded version of elasticsearch. Now as we are growing, I want to start elasticsearch as a service.
I followed this guide to install it using yum on a linux machine. I pointed ES to the new directory using
path:
logs: /home/ec2-user/.searchindex/logs
data: /home/ec2-user/.searchindex/data
When I start the service
sudo service elasticsearch start
I get a permission denied error:
java.io.FileNotFoundException: /home/ec2-user/.searchindex/logs/elasticsearch_index_search_slowlog.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
....
I guess this has to do with the folder permission, I changed folder permission using:
sudo chown elasticsearch:elasticsearch -R .searchindex
But that didn't help.
Any help?
Your user elasticsearch can't write in the logging folder : /home/ec2-user/.searchindex/logs
Check the permissions with ls -l
Set write permission with the chmod command :e.g. : sudo chmod -R u+wx .searchindex
The issue occurred because .searchindex is located in ec2-user directory which obviously is inaccessible by elasticsearch user created to manage the elasticsearch service.
Moving the folder to /var/lib/elasticsearch did the trick.
I've upgraded from JBoss EAP 6.2.0GA to 6.3.0GA, and run into this problem after installing ActiveMQ as an embedded module. The same configuration is working on my Windows computer, so I believe it is some sort of CentOS permissions issue.
INFO [org.apache.activemq.store.SharedFileLocker] (Starting ActiveMQ Broker) Database activemq-data/kahadb/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: Failed to create directory 'activemq-data/kahadb'
Note that it has no problem writing logs or anything. It's just this damn activemq related permission.
The issue only occurs if I run it as a service.
i.e.
service jboss-as start
If I run bin/standalone.sh & it works fine.
I've given the jboss.jboss user ownership over everything related to JBoss now, and chmod is 755 for everything. (There's a lot of confusing info about jboss:jboss or jboss.jboss to refer to the user in the jboss group. But neither works.)
chown -fR jboss.jboss /usr/share/jboss-eap-6.3/
chown jboss.jboss /usr/share/jboss-as
chown jboss.jboss /etc/init.d/jboss-as
chown jboss.jboss /etc/jboss-as/jboss-as.conf
I've done
ln -s -T /usr/share/jboss-eap-6.3 /usr/share/jboss-as
ln -s -T /usr/share/jboss-eap-6.3/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss-as
ln -s -T /usr/share/jboss-eap-6.3/bin/init.d/jboss-as.conf /etc/jboss-as/jboss-as.conf
My mgmt-groups.properties has:
jboss=jboss, admin, SuperUser
not that I know particularly how this helps.
My mgmt-users.properties has:
jboss=6ca43af9943e59f1563a1ff04472a8f9
suggesting that add-user.sh did something.
I haven't edited standalone.xml with regards to security or permissions.
grep 'jboss' /etc/group
shows:
jboss:x:502:
Anyone ?
Ok, worked it out from turning on the DEBUG logs and stepping through.
The difference is that when you do service X start, it is running it from /etc/rc.d/init.d/ directory, instead of when you do it directly, where it's running it from the /bin/ directory.
[org.apache.activemq.broker.BrokerService] (Starting ActiveMQ Broker) Using Persistence Adapter: KahaDBPersistenceAdapter[/etc/rc.d/init.d/activemq-data/kahadb]
ESC[0mESC[0m13:31:46,998 INFO [org.apache.activemq.store.SharedFileLocker] (Starting ActiveMQ Broker) Database activemq-data/kahadb/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: Failed to create directory 'activemq-data/kahadb'
So this worked:
chown -R jboss.jboss /etc/rc.d/init.d/
chmod -R 755 /etc/rc.d/init.d/
I'm running into a permissions problem with Cherokee+uWSGI on Ubuntu Server 13.10 intended for a Django production environment. When I start uWSGI manually as root user prior to launching cherokee, everything goes smooth:
sudo uwsgi --ini /home/instytut21/instytut21l/instytut21/uwsgi.ini
But when I try to access the site through the server (running as www-data) without that, I keep getting a 503 Service Unavailable response and the following message in the logs:
sudo cat /var/log/cherokee/instytut21.error.log
realpath() of /home/instytut21/instytut21.pl/instytut21/uwsgi.ini failed:
[core/utils.c line 3574]
I've spent a good while trying to figure out what causes the problem. I've tried giving ownership to $USER:www-data and www-data:www-data with all kinds of file permissions ranging from 600 to 777.
I don't want to run the server as root for security reasons. How can I make the ini file accessible to cherokee?
I finally found a solution to a similar problem at www-data permissions? . I slightly modified it and solved my problem by executing the following commands.
Own the whole directory by me and group www-data:
sudo chown -R $USER:www-data /home/instytut21/instytut21.pl/
Grant all permissions to the group:
sudo chmod -R g+rwx /home/instytut21/instytut21.pl/
Ensure all uploaded filed get the same permissions:
sudo chmod -R g+s /home/instytut21/instytut21.pl/