Ambari-Server on Docker Java install issues - docker

Today I hit a issues with my Ambari-Server install on a virtually blank system:
[root#<server>/]# ambari-server setup
Using python /usr/bin/python2.6
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)?
Adjusting ambari-server permissions and ownership...
Checking firewall status...
FATAL: Could not load /lib/modules/2.6.32-504.16.2.el6.x86_64/modules.dep: No such file or directory
iptables v1.4.7: can't initialize iptables table 'filter': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
FATAL: Could not load /lib/modules/2.6.32-504.16.2.el6.x86_64/modules.dep: No such file or directory
iptables v1.4.7: can't initialize iptables table 'nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
WARNING: iptables is running. Confirm the necessary Ambari ports are accessible. Refer to the Ambari documentation for more detai
OK to continue [y/n] (y)?
Checking JDK...
[1] OpenJDK 1.8.0
[2] OpenJDK 1.7.0 (deprecated)
[3] Custom JDK
==============================================================================
Enter choice (1):
Downloading JDK from http://birepo-build.svl/repos/IOP-UTILS/RHEL7/x86_64/1.1/openjdk/jdk-1.8.0.tar.gz to /var/lib/ambari-1.8.0.tar.gz
jdk-1.8.0.tar.gz... 100% (56.5 MB of 56.5 MB)
Successfully downloaded JDK distribution to /var/lib/ambari-server/resources/jdk-1.8.0.tar.gz
Installing JDK to /usr/jdk64/
Installation of JDK has failed: [Errno 2] No such file or directory
JDK found at /var/lib/ambari-server/resources/jdk-1.8.0.tar.gz. Would you like to re-download the JDK [y/n] (y)?
Re-downloading JDK from http://birepo-build.svl/repos/IOP-UTILS/RHEL7/x86_64/1.1/openjdk/jdk-1.8.0.tar.gz to /var/lib/ambari-server/resources/jdk-1.8.0.tar.gz
jdk-1.8.0.tar.gz... 100% (56.5 MB of 56.5 MB)
Successfully downloaded JDK distribution to /var/lib/ambari-server/resources/jdk-1.8.0.tar.gz
Successfully re-downloaded JDK distribution to /var/lib/ambari-server/resources/jdk-1.8.0.tar.gz
Installing JDK to /usr/jdk64/
Installation of JDK was failed: [Errno 2] No such file or directory
ERROR: Exiting with exit code 1.
REASON: Downloading or installing JDK failed: 'Fatal exception: Unable to install JDK. Please remove JDK, file found at /var/lib/ambari-server/resources/jdk-1.8.0.tar.gz and re-run Ambari Server setup, exit code 1'. Exiting.`
Searching about I did a little investigation of my own as this is running on a Docker host. Hence the IPTables issue, this is due to it being within a Docker container and the NET_ADMIN capability for non-privileged containers. Unprivileged containers can't change their network configuration.

Turns out that I've managed to figure out this issue my self.
First I found lots of links talking about manually installing the JDK, then repository issues and python script time-outs.
It was rather simple in the end, just needed to install the 'tar' package as it couldn't extract the files, once I did this, it ran through with no issue.
That's what I get for having a 'blank' install.

Installing and run Ambari into Docker is a tricky thing. I've spent many days trying to make it all work. You can find here some hints about how to prepare centos7 docker based image for running Ambari server http://mixeddev.info/articles/2020/12/10/run-apache-ambari-hdp-hdf-in-docker.html

Related

How do you resolve the GitLab error "Error response from daemon: invalid condition: 'not-running'"?

I set up a Windows GitLab runner that's supposed to download a Docker image from our Container Registry and then run a build script in the pipeline. Unfortunately the Docker container never launches due to the following error:
Running with gitlab-runner 15.1.0 (76984217)
on WindowsDockerRunner wZMWQZYi
Resolving secrets
Preparing the "docker-windows" executor
Using Docker executor with image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Pulling docker image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Using docker image sha256:e6b07227af5ca9303c2112b574f6f27f38135bbf9df29d829142410221967401 for mcr.microsoft.com/windows/servercore:ltsc2019 with digest mcr.microsoft.com/windows/servercore#sha256:26c6c296a4737ba478fe3c3e531b098f89b5562c40b416ba6fb8177ac462d1af ...
Preparing environment
Running on RUNNER-WZMWQZYI via
runner2...
ERROR: Job failed (system failure): prepare environment: Error response from daemon: invalid condition: "not-running". Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
The error message doesn't clearly state what the cause of the problem is and the documentation that it references doesn't mention anything about "condition". Based on the link pointing to shell profiles I suspect it might have something to do with the shell that's being run, but when I run the Docker container locally it boots into PowerShell just fine.
Does anyone know how to solve this?
I came across this issue after installing Docker Engine using the Windows Server install script, which fetches docker.exe and dockerd.exe from https://master.dockerproject.org, These builds were last updated in March 2022, I found gitlab-runner 14.9 and earlier work okay with this version (released prior to March 2022), but 14.10 does not (released 2022-04-19) nor do any newer versions.
Installing Docker Desktop resolves this as it provides the latest version. However using Docker Desktop introduces licensing issues. An alternative is to manually install Docker Engine / update the version downloaded by the Microsoft script.
Docker Engine builds are provided on the Moby GitHub project to download from https://download.docker.com/win/static/stable/x86_64/ downloading the lastest version from here and replacing the docker executables in C:\Windows\System32 fixes the problem, working with the latest gitlab-runner.
An alternative is to use the docker-engine chocolatey package (which incidentally I maintain) which provides installation scripting for the above stable builds:
choco install docker-engine
There is also an open issue with the Windows-Containers team to move off (out of date) nightlies: https://github.com/microsoft/Windows-Containers/issues/256 which would provide a stable docker build, through the Microsoft recommended installation method.
Was finally able to solve this issue. We had the Docker Engine installed on our GitLab Runner, but that doesn't seem to be sufficient for GitLab CI/CD. After installing Docker Desktop on the runner the issue disappeared and we were able to run the pipeline.
After some trial and error I got it up and running.
I have another server running the gitlab-runner and docker without any issues (no docker desktop installed, which is not allowed because of licensing stuff).
The server I'm trying to setup right now is a 'redundancy' build server.
So to find out what was my problem, I started switching things from one build server to the other. Currently, it appears that simply downgrading to the gitlab-runner V13.4.0 was enough.
I did reregister the runner, since gitlab stated that the V15.x.x version was using executor "unknown".
Not sure what is going on there, but at least I can continue building now.

Problem using specific version of Kubernetes in Minikube

I'm trying to launch a Minikube cluster in my local machine with the latest version of Kubernetes (1.22.3 if I'm correct).
I run minikube start --kubernetes-version=v1.22.3 and the binaries are not found with error:
Failed to update cluster: downloading binaries: downloading kubeadm: Error downloading kubeadm v1.22.3: failed to download: failed to download to temp file: failed to create validator: failed to create validator: failed to download checksum file: received status code 404
I've tested to change the command and use an older version minikube start --kubernetes-version=v1.12.10 instead. This one works perfectly.
What am I doing wrong? If I'm correct that version (1.22.3) is already released. I've tested with versions in between, like around 1.19 and they are not working either.
Most probably you have an older version of the minikube installer binary. In order to check your version, run the following command:
minikube version
It should show you:
minikube version: v1.24.0
If it shows any older version, please go to minikube website and download the latest minikube installer binary for your OS. For Linux x86-64 architecture you can get and install it with the following commands:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Then you can simply run:
minikube start
which will set up kubernetes cluster with its default version, which for the current latest version of Minikube happens to be v1.22.3, so exactly the version you need. Or you can specify this version explicitly:
minikube start --kubernetes-version=v1.22.3
which will also work.

Docker proxy settings in docker toolbox

We are using Windows OS 7 to develop an application using tech stack viz. docker, spring, java8, gradle etc. We have installed the docker toolbox on our machine.
Now the base image is located in our docker repository of our organization. But the docker is not able to identify the host.
We are able to connect to our repository from docker installed on a linux machine. In that case we have made changes in these 2 files viz.
1.
/etc/systemd/system/docker.service.d/daemon.conf
here we have added http_proxy and https_proxy.
2.
/etc/docker/daemon.json
here we have mentioned the host name as
{"insecure-registries":["<host-name>"]}
But we are not able to find these files in docker tool-box in windows 7.
Please let us know how to resolve this issue.
We are getting the following error in dockerBuildImage gradle task currently wherein it is not able to download the base image.
:dockerBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dockerBuildImage'.
> Could not build image: Get https:<host-name>/v2/: x509: certificate signed by unknown authority
Please advise.
The following worked for me in docker toolbox
change the file /var/lib/boot2docker/profile to include following text:
--insecure-registry=<host1-name>
export "NO_PROXY=<host-name>"
export HTTP_PROXY=<value>
export HTTPS_PROXY=<value>
Then restart the docker-machine to make these changes visible.

Docker and VirtualBox on Fedora 27

I installed virtualbox 5.2 from their website. And I ran this command..
docker-machine create -d virtualbox dev
then I got this..
Running pre-create checks...
Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is
"WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (4.14.3-300.fc27.x86_64) or it failed to
load. Please recompile the kernel module and install it by
sudo /sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.\\n5.2.2r119230\".
Please upgrade at https://www.virtualbox.org"
I did as it suggested..
sudo /sbin/vboxconfig
then..
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-4.14.3-300.fc27.x86_64
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-4.14.3-300.fc27.x86_64
..and I don't understand anymore. Please help.
Install the kernel-devel package and it will continue. Btw, this is not a programming question, there are better forums for such questions...

How to install docker-engine using docker binary without internet connection

I have downloaded docker binary version 1.8.2 and copied that to my backup server (centos server) which doesn't have internet connectivity. I have marked this as executable and started the docker daemon as mentioned in [https://docs.docker.com/engine/installation/binaries/][1]. But it doesn't seem to get installed as a docker service. For all the commands, I have to execute as sudo ./docker-1.8.2 {command}. Is there a way to install docker-engine as a service? Currently sudo docker version shows command not found. I'm a newbie to docker setup. Please advise.
Why not download the rpm package (there are also centos 6 packages), copy to USB stick and then to your server and simply install it with rpm command and that's it. That way you'd get the same installation as if you were to run yum.
Of course you may have some dependencies missing, but you could download all of these as well.
Firstly, if you're downloading bare binaries on an enterprise linux, you're probably doing things in a very bad way. Immediately, you're breaking updates and consistency, and leaving your system in a risky, messy state.
Try using yumdownloader --resolve to get the docker installable and anything it needs.
A better option may be to mirror the installation artifacts, and grab it from the local mirror, but that's beyond the scope if you don't do this already.

Resources