Mesos master keeps starting automatically - docker

I have mesos installed in some docker containers and when ever I bring the container up, the mesos-master process starts by default on all these containers. Even on those that I have mesos-agents running on.
I have no idea why this is happening and this is rather annoying.
I am installing mesos the following way
RUN rpm -i http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm && \
yum -y install mesos-0.28.2
Any ideas on why this is happening? Is this the expected behavior?
Please let me know what I can do to stop this.

This is expected behavior
You need to explicit disable Mesos Master (and ZooKeeper if you installed it). Depending on your system version it can be done as follow:
On RedHat 6 / CentOS 6:
sudo stop mesos-master
sudo sh -c "echo manual > /etc/init/mesos-master.override"
On RedHat 7 / CentOS 7:
sudo systemctl stop mesos-master.service
sudo systemctl disable mesos-master.service
For more take a look at slave-setup tutorial.

Related

Yum update stucks inside docker

I have installed Docker 20.10 on RHEL 9 system, and installed CentOS 7 container on docker. But when I tried yum update on it, it takes a long time while running transaction, as if yum stuck while updating.
Yum update
I tried strace -p 6351 to see what is happening inside yum, and it endlessly says fnctl(765158398, F_GETFD) = -1 EBADF (Bad File Descriptor) strace -p 6351
Same thing happens when I tried yum install openssh-server, but yum install telnet worked fine.
I really want to know what is happening on my docker. Any idea to fix it??
After some research, I have found that ulimit -n, ulimit -Hn, ulimit -Sn value inside the container was 1073741824, and it made yum check every possible file descriptor, from 0 to 1073741824.
I have inserted --ulimit nofile=1024:262144 in docker commandline (like docker run --ulimit nofile=1024:262144 --name test -p 2202:22/tcp -i -t centos:7 /bin/bash), and yum update worked fine! Now I can enjoy yum on docker happily!
Is there also a solution without setting it in every docker container and maybe in containerd? I am experiencing similar issues in centos 7.9 containers running on centos 9 hosts using Kubernetes/containerd. Yum installations take hours instead of minutes.
Update: I've added LimitNOFILE=1048576 to the service unit of containerd now and it works.

Unable to restart and remove Docker from Applications in Mac : Fatal Error failed to ping backend api

I suddenly got the fatal error message from Docker yesterday. I really don't understand why as I shut down my machine properly. So I decided to uninstall docker and reinstall it. I went into the Applications folder in my Mac and I can't uninstall because it thinks the docker is open. So I need help with the following:
how do I uninstall docker?
how do I install it so it can start working again?
Attempts at a resolution:
Just tried the following command in my terminal:
docker kill $(docker ps -q)
I got the following response:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
"docker kill" requires at least 1 argument.
See 'docker kill --help'.
What do I do?
See the screen shot
This was getting me crazy.
You don't need to reinstall Docker to solve it. The workaround (at least in my case) is as simple as killing all Docker related processes and running Docker again:
$ pkill Docker
$ open -a /Applications/Docker.app
1- open Activity monitor and go to com.docker. process , from there you have to kill it to proceed further.
2- uninstall from mac is standard procedure.
In my case I was not able to use the Option of Rest and Diagnose too. UI was completely hung
Here's how I solved it.
Killed the docker process $ pkill Docker
Moved the docker application to bin
Manually deleted all the below files
sudo rm -rf /usr/local/lib/Docker
sudo rm -rf /Library/PrivilegedHelperTools/com.docker.vmnetd
sudo rm -rf /Library/LaunchDaemons/com.docker.vmnetd.plist
rm -rf ~/.docker
rm -rf ~/Library/Containers/com.docker.docker
rm -rf ~/Library/Application Support/Docker Desktop
rm -rf ~/Library/Preferences/com.docker.docker.plist
rm -rf ~/Library/Saved Application State/com.electron.docker-frontend.savedState
rm -rf ~/Library/Group Containers/group.com.docker
rm -rf ~/Library/Logs/Docker Desktop
rm -rf ~/Library/Preferences/com.electron.docker-frontend.plist
rm -rf ~/Library/Cookies/com.docker.docker.binarycookies
Restarted the laptop
Installed the latest version again which worked fine
Ok, I was able to fix this problem. You can do this with ANY application (just change the name), that you can't remove from the applications folder.
It will remove the entire application in its entirety. The existence of the application is wiped clean.
Please do the following commands in this order
ps aux | grep docker
When you run this command you get a big display. You are only interested in the following thing in the his screen grab
2 Then do a sudo kill command that includes the number in the red box from the ps aux|grep command as shown this code example in step 1.
sudo kill -9 108
Finally go to sudo remove command specifying the specific folder and application you want to remove.
sudo rm -rf /Applications/Docker.app/
Restart your machine.
Install version of docker. If the error occurred when updating to a new version of docker (such as in my case). You can download an older version of docker from here (the older version numbers are listed in the far left). I chose 3.3.0 (released 04/21 installed 6/11/21
Note:
If you have a problem installing an older version of docker and you encounter a problem
Run the following command and you will see a .json display
vi ~/Library/"Group Containers"/group.com.docker/settings.json
Scroll down to settings and modify the version down. For 3.3.0 I went down to setting version 7.
Restart docker and when it opens check images and you can see your containers
It worked for me when I opened the terminal and then ran this:
killall Docker && cd /Applications;open -a Docker;cd ~
I found it here: https://www.lewuathe.com/how-to-deal-with-failed-to-ping-backend-api-in-docker.html
I'm facing this error for docker version 3.6.0. then reinstall docker version 4.1.1 and it's working fine.

System has not been booted with systemd as init system (PID 1). Can't operate. While trying to run apache2 within docker container

I am new to Docker and i am trying my hands on with docker.
The steps I did.
pulled ubuntu18.04 image and ran it in an interactive way.
Installed apache2 with in it.
Now when I trying to run the apache i am getting the below error.
by :
sudo systemctl start apche2
Error:
System has not been booted with systemd as init system (PID 1). Can't operate.
Previously I got an error with
systemctl command not found ubuntu
for which I ran a command
sudo apt-get install --reinstall systems .
Could anyone help me out of this?
With systemctl you are trying to make systemd to run a daemon for you. This normally will not work with Docker because it is not the way Docker supposed to work. Docker usually used to create single-process containers which exist as long as the process do. That is the Docker way of running Apache2 will be running it in foreground mode: apache2 -DFOREGROUND.

download and run ubuntu-desktop with gnome support via docker

I am completely new to docker. I have a Redhat 7 desktop with docker installed.
I now want to run a full fledged ubuntu-desktop 18.04 (including its gnome GUI) via docker. How can this be done? I have been googling for instructions/tutorials on where I can download an ubuntu 18.04 docker image (with GUI support) and run it, but surprisingly I cannot find anything. Can someone help me? Thanks.
I have a different situation, where I run docker on a Windows10 platform. I also tried to install Gnome for some Ubuntu image and start a gnome-session from the terminal. I did not manage to do so.
My current solution is to use Mate instead of Gnome. Maybe my steps are helpful for others that just started with docker:
Install Docker Desktop on Windows 10 and start the Docker application
Install vcxsrv and start it with Xlaunch (also see https://dev.to/darksmile92/run-gui-app-in-linux-docker-container-on-windows-host-4kde)
Get the IP of your computer with ipconfig, e.g 192.111.999.9
Open a console with admin rights and start a docker container. Pass some DISPLAY-Information including your IP:
docker run -it -e DISPLAY=192.111.999.9:0.0 --privileged --name=ubuntu ubuntu
You should then see a linux prompt
Update the package-manager and upgrade existing packages:
apt-get update
apt-get upgrade -y
apt-get update
start dbus service to avoid dbus warnings (also see https://georgik.rocks/how-to-start-d-bus-in-docker-container/):
dbus-uuidgen > /var/lib/dbus/machine-id
mkdir -p /var/run/dbus
dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address
install mate (and some themes to avoid theme warning)
apt-get install mate-desktop-environment -y
apt-get ubuntu-mate-themes -y
start a Desktop session with
mate-session
Good luck!
(If you want some more programs, instead of "mate-desktop-environment", you can also use the larger package "ubuntu-mate-desktop". Will take > 10 min to be installed.)
This is an atypical use case for Docker. Docker is normally used to run applications via the command line, or on a server without GUI support. Most operating systems in docker images ship without GUI support.
However, you can enable GUI support with X11. Only with containers that support it though, and not with Ubuntu as far as I can tell. More details on this blog post: https://blog.jessfraz.com/post/docker-containers-on-the-desktop/
For now, just run docker run -it --rm ubuntu:latest bash and you'll launch an Ubuntu 18.04 shell (at the time of this post).

What would keep docker engine from upgrading to 1.11 on Ubuntu 14.04?

I am managing around 20 Ubuntu 14.04 VMs running docker engine. These VMs have been around for several months and have been through a number of upgrades. Of the 20, all are running docker 1.11 except for 2, which refuse to upgrade from docker 1.10.3 for some reason. I've tried a number of things. Last night I went through these steps, which I really thought would do the trick:
sudo service docker stop
sudo rm -rf /var/lib/docker
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-image-extra-$(uname -r)
sudo reboot
Unfortunately when the VMs came back up they were still running docker 1.10.3.
I started with the docker engine log (/var/log/upstart/docker.log) but there is no indication of a problem related to the upgrade.
I looked in the apt logs (/var/log/apt/term.log) for the 2 VMs that won't update, but there aren't any errors or messages indicating anything is wrong.
I also compared the repos (/etc/apt/sources.list) for a VM that did upgrade docker to 1.11 and one that didn't, and the sources are identical, which I would expect since I spun both VMs up with the same command line.
What could be preventing these VMs from upgrading to docker 1.11?
Where should I look to find the cause?

Resources