Cassandra in Docker unable to make directory on mounted volume - cassandra

When I attempt to start the docker image tobert/cassandra from https://github.com/tobert/cassandra-docker I get the following error. Can anyone explain what this error means?
os.MkdirAll('/data/conf') failed: %!s(MISSING)
The command I am running is:
sudo docker run -v /data/cassandra:/data tobert/cassandra
I have created the directory /data/cassandra in my host os of RH Linux. I have even opened up the permissions all the way to see if it was a permission issue.
drwxrwxrwx. 2 root root 6 Apr 10 12:10 cassandra

Is SELinux enabled? You're doing everything right so something else must be blocking mkdir. Please check your syslog (RHEL <= 6.x) or journalctl (RHEL 7).

Related

docker: `fs.mqueue.msg_max` set to 10 in spite of host's being 4096

I'm running docker in rootless mode (I cannot sudo in my own machine).
When I run sysctl in the container, fs.mqueue.msg_max is set to 10. I get a permission denied error if I try to change it.
However, in the host, it's set to 4096.
I've tried combinations of values to the flag --sysctl for docker, but I get permission denied every time.
Does anyone know what could be causing this disparity? What may be restricting my container's mqueue msg_max to 10.

Centos 7 - I can't read /var/run/docker.sock even though the permission is 666

I am trying to setup Docker with Jenkins and I need to read /var/run/docker.sock.
I tried temporarily to set permission 666 on file /var/run/docker.sock but when I try to read it as jenkins user it says permission denied.
As far as I know if file permission is 666 any user can read it.
srw-rw-rw- 1 root docker 0 Oct 17 17:05 docker.sock
drwxr-xr-x 31 root root 1100 Oct 17 17:05 run
Directory permission is not issue, /run directory has permission 755. Selinux is disabled. Jenkins user is part of docker gorup.
I do not know what is the problem.
Kind regards,
Ivan
create jenkins user on your host
get this user id
change ownership of /var/jenkins_home to fetched id.
I found the problem, I was mounting /etc/passwd and /etc/groups to docker container but for some reason docker didn't correctly added jenkins user to docker group inside container.
I had to add group_add: - <docker_group_id> inside docker-compose file. Now everything is working as expected.
I thought that there was some problem with Centos OS but I found out that someone already had this problem documented at this link: Linux user groups missing when user mounted to container
I hope this information will help someone.

HDP 2.5 Hortonworks ambari-admin-password-reset missing

I have downloaded the sandbox from hortonworks (Centos OS), then tried to follow the tutorial. It seems like the ambari-admin-password-reset command is not there and missing. I tried also to login with putty, the console asked me to change the password so I did.
now it seems like the command is there, but I have different passwords for the console and one for the putty for the same user.
I have tried to look for the reason why for the same user 'root' I have 2 different passwords (one for the virtual box console and one for the putty) that I can login with. I see different commands on each box. more than that when I share folder I can only see it on the virtual box console but not on the putty console) which is really frustrating.
How can I enforce that what I would see from putty would be the same as what I see from the virtual box console.
I think it somehow related to TTY but I am not sure.
EDIT:
running commands from the virtual box machine output:
grep "^passwd" /etc/nsswitch.conf
OUT: passwd: files sss
grep root /etc/passwd
OUT: rppt"x"0"0"root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
getent passwd root
OUT: root:x:0:0:root:/root:/bin/bash
EDIT:
I think this is all about docker containers. It seems like the machine 2222 port is the ssh port for the hdp 2.5 container and not for the hosting machine.
Now I get another problem. when running
docker exec sandbox ls
it is getting stuck. any help ?
Thanks for helpers
So now I had the time to analyze the sandbox vm, and write it up for other users.
As you stated correctly in your edit of the question, its the docker container setup of the sandbox, which confuses with two separate root users:
via ssh root#127.0.0.1 -p 2222 you get into the docker container called "sandbox". This is a CentOS release 6.8 (Final), containing all the HDP services, especially the ambari service. The configuration enforces a password change at first login for the root user. Inside this VM you can also execute the ambari-admin-password-reset and set there a password for the ambari admin.
via console access you reach the docker host running a Centos 7.2, here you can login with the default root password for the VM as found in the HDP docs.
Coming to your sub-question with the hanging docker exec, it seems to be a bug in that specific docker version. If you google that, you will find issues discussing this or similar problems with docker.
So I thought that it would be a good idea to just update the host via yum update. However this turned out to be a difficult path.
yum tried to update the kernel, but complained that there is not enough space on the boot partion.
So I moved the boot partion to the root partition:
edit /etc/fsab and comment out the boot entry
unmount /boot
mv /boot
cp -a /boot.org /boot
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
reboot
After that I have found out that the docker configuration is broken and docker does not start anymore. In the logs it complained about
"Error starting daemon: error initializing graphdriver:
\"/var/lib/docker\" contains other graphdrivers: devicemapper; Please
cleanup or explicitly choose storage driver (-s )"
So I edited /etc/systemd/system/multi-user.target.wants/docker.service and changed the ExecStart setting to:
ExecStart=/usr/bin/dockerd --storage-driver=overlay
After a service docker start and a docker start sandbox. The container worked again and I could could login to the container and after a ambari-server restart everything worked again.
And now - with the new docker version 1.12.2, docker exec sandbox ls works again.
So to sum up the docker exec command has a bug in that specific version of the sandbox, but you should think twice if you want to upgrade your sandbox.
I ran into the same issue.
The HDP 2.5 sandbox runs all of its components in a docker container, but commands like docker exec -it sandbox /bin/bash or docker attach sandbox got stuck.
When I ran a simple ps aux, I found several /usr/bin/docker-proxy commands which looked like :
/usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 60000 -container-ip 172.17.0.2 -container-port 60000
They probably forward the HTTP ports of the various UIs of HDP components.
I could ssh into the container ip (here 172.17.0.2) using root/hadoop to authenticate. From there, I could use all "missing" commands like ambari-admin-password-reset.
$ ssh root#172.17.0.2
... # change password
$ ambari-admin-password-reset
NB: I am new to docker, so there's probably a better way to deal with this.
I'd like to post here the instructions for 3.0.1 here.
I followed the instructions of installing hortonworks version 3.0.1 here: https://youtu.be/5TJMudSNn9c
After running the docker container, go to your browser and enter "localhost:4200", that will take you to the in browser terminal of the container, that hosts ambari. Enter "root" for login and "hadoop" for password, change the root password, and then enter "ambari-admin-password-reset" in order to reset ambari password.
In order to be able to use sandbox-hdp.hortonworks.com, you need to add the line "127.0.0.1 sandbox-hdp.hortonworks.com" at the end of the /private/etc/hosts file on your mac.
Incorrect Pass
Then right corner click on power button >> power off drop down >> Restart >> when it boots up then press Esc key to get into recovery menu
Restart
select advance option and hit enter
Advance Option
Select Recovery mode hit enter
Select Root
Root enter
Command
mount -rw -o remount/
ls /home
change pass command
passwd username
user as yours
last step
enter pass two times by pressing enter
enter image description here
Hopefully you changed password (:

Permissions issue on cifs mount between Ubuntu and Mavericks

On my Linux box running Ubuntu 12.04LTS I am able to mount a share using cifs.
The shared folder in question is located at a Mac Pro running Mavericks.
Here is the fstab on the Ubuntu/Linux box.
//132.13.6.5/Data /home/sro/Mount cifs username=sro,password=psw,nounix,sec=ntlmssp,rw
/Mount on the Linux box has these permissions:
drwxr-xr-x 21 root root 0 Jan 16 13:29 Mount
I can read /Mount/Data but not write (I get a permission error).
I think this is because /Mount is created by root and I am trying this a user.
But I am unable to change /Mount permissions or ownership even using sudo.
On the Mac/Mavericks side, /Data has read/write permissions.
Any ideas how to solve this?
The issue here was a missing UID/GID pair. Apparently when those are absent the default owner of the share will be root.
So my fstab line should look like this:
//132.13.6.5/Data /home/sro/Mount cifs username=sro,password=psw,nounix,sec=ntlmssp,rw,uid=1001,gid=1001
Two things:
your UID/GID may not be 1001 so better check with the id command first
you may want to use permission masks as detailed here.
add to your fstab line uid=your_user_name your line will be:
//132.13.6.5/Data /home/sro/Mount cifs username=sro,password=psw,nounix,sec=ntlmssp,rw,uid=your_user_name
That way you are asking linux to set that user as owner of filesystem being mounted.

cannot run jconsole

In my windows XP machine I try to run jconsole like this:
jconsole 2228
Here 2228 is the pid of the process(got it from Task Manager).
The output is:
Unable to attach to 2228: Could not map vmid to user name
My java version is 1.5.0_07
Also tried
jps -mlv
.
Output is empty.In tmp folder there is no hsperfdata_.
Tried the same thing in a linux box with same result.In the linux box I logged in as root.Output of the id command:
# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Output of jps command:
jps -mlv
28574 sun.tools.jps.Jps -mlv -Dapplication.home=/usr/local/Java/jdk1.5.0_16 -Xms8m
One difference with windows box is atleast /tmp/hsperfdata_root exists and permissions are:
drwxr-xr-x 2 root root 4096 Dec 17 12:52 hsperfdata_root
Plz help.
Regards,
Subhendu
If you are attempting to connect using the PID on windows, the TEMP directory for both the user running jconsole and the user running the jvm need to be the same. If jps doesn't list your jvm, then this is the problem.
This usually occurs with JVMs which are run as windows services that run as SYSTEM user. The temp directory for SYSTEM user is usually C:\windows\temp. The temp directory for you is probably C:\Documents and Setting\YOURNAME...
Well, I found out that adding system property com.sun.management.jmxremote solves the problem.
However, if someone wants to add anything to enhance my understanding - most welcome.
Regards,
Subhendu

Resources