Tag Archives: docker

Solve the problem that Gabor can’t start itself after the server is restarted

Questions

When the server deployed with Gabor restarts, it may appear that Gabor can’t follow the system to start itself

Solution

Now assume that the location of the installation directory of Gabor is/usr/local/Gabor. After the installation of Gabor, the docker-compose.yml configuration file will be generated in this directory. You can use docker compose to operate this file to control the startup and shutdown of Gabor.

Next, write a system D service that starts from Gabor, named Gabor. Service (placed in the/etc/system/system directory)

[Unit]
Description=harbor
After=docker.service systemd-networkd.service systemd-resolved.service
Requires=docker.service
Documentation=http://github.com/vmware/harbor

[Service]
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=/usr/local/bin/docker-compose -f  /usr/local/harbor/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f  /usr/local/harbor/docker-compose.yml down

[Install]
WantedBy=multi-user.target

After writing, use systemctl enable harbor.service to set the boot time. Then restart the server for testing.

The solution of insufficient disk space of docker in Ubuntu

First, check the docker location:

docker info

Stop docker service

systemctl stop docker

Look at the high capacity location and create a transfer directory on it

df -h
mkdir -p /home/docker

Take/home/docker as an example. I will transfer the docker of/var/lib/docker to here later.

Migrate the files in/var/lib/docker directory to the target location

sudo rsync -avz /var/lib/docker /home/docker

Create a new/etc/docker/daemon.json file and edit it

There is no such file by default, so you can create and edit it directly with vim
sudo vim /etc/docker/daemon.json
Here is how to use vim.
Press i to enter the insert state and copy the following list into the file
{
  "graph":"/docker/lib/docker"

}
Press Esc to exit the insert state, then press shift+:
and then press wq! Enter to force save the file.
PS. If you encounter any swap file already open when inserting, then sudo rm file name to delete the file

Reload docker and restart docker

systemctl daemon-reload && systemctl restart docker

Check whether the docker is changed to a new directory

docker info

Delete old docker directory

rm -rf /var/lib/docker

CUDA Error: no kernel image is available for execution on device

20202020999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999993333333333333399999999999999999333333333333333333333339999999999999936816931243;’24207;’ 29616;’39064;’ 38169;’35823s;

2121213333333333333999888883333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333————–9999999999993333333333———————————————————-4.run

“209150;”26377;”23558;” wonder 29256;”21040;” 8″261744;”28982;”202155;” 32622;”docker38236;” 206873;”3279138271e;

202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202033333202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202;’39064;

“Darkness, Darkness, Darkness, Darkness, Darkness, Darkness, Darkness, Darkness, Darkness, Darkness, Darkness, Darkness, Darkness.”

“20462;” 25913;”ARCH32622;” 19982;”26174;” 21345;”21495;” 21305;”2130555;” 3579797;”30528;” 27880;”25481;” 75735793;”darknet;”2652482;”20915;” 3838382;”39064;

“38468;” 26174;”21345;” 31639;”

GeForce TITAN

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

<<<

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

GeForce RTX <<<<<<<<<<<<<<<<<<<<<<<

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

GeForce GTX 960
GeForce GTX 7503.0GeForce GTX 550

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

8.6
NVIDIA TITAN RTX 7.5
GeForce RTX 2080 Ti 7.5
NVIDIA TITAN Xp 6.1
NVIDIA TITAN X 6 <<<<<<<<<<<<<<<<<<<<<<<
GeForce GTX TITAN X 5.2
GeForce GTX TITAN Z 3.5
GeForce GTX TITAN Black 3.5
5.2
GeForce GTX 950 5.2
GeForce GTX 780 Ti 3.5 5.0
GeForce GTX 690 GeForce GTX 680 GeForce GTX 680 GeForce GTX GTX <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GeForce GTX 650 Ti 3.0
GeForce GTX 650 3.0
GeForce GTX 560 Ti 2.1
2.0
GeForce GTX 580 2.0
GeForce GTX 570 2.0 GeForce GTX GTX GTX <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GeForce GT 730 3.5
GeForce GT 730 DDR3128 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GeForce GT 620 2.1
GeForce GT 610 2.1
GeForce GT 520 2.1

[Solved] Ubuntu 20.04 LTS Install k8s Error: The connection to the server localhost:8080 was refused

After Ubuntu 20.04 LTS is successfully added to the cluster on the node, the following prompt will appear:

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

Verify the success of adding by kubectl get nodes command. The following error occurs:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

This error has also occurred on the master node. The solution gives the answer after successful installation

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

  export KUBECONFIG=/etc/kubernetes/admin.conf

I use the root account, so I need to execute the following command:

export KUBECONFIG=/etc/kubernetes/admin.conf

After the command is executed, verify it:

root@k8s-master-03:/etc/kubernetes# kubectl get nodes
W0706 10:27:55.181115   22817 loader.go:221] Config not found: /etc/kubernetes/admin.conf
The connection to the server localhost:8080 was refused - did you specify the right host or port?

The key information of the error report is that the configuration is not found

Config not found: /etc/kubernetes/admin.conf

Let’s go to the /etc/kubernetes/ Directory:

root@k8s-master-03:/etc/kubernetes# ls -l
total 12
-rw------- 1 root root 1910 Jul  6 09:52 kubelet.conf
drwxr-xr-x 2 root root 4096 Jul  6 09:41 manifests
drwxr-xr-x 2 root root 4096 Jul  6 09:52 pki

The results show that only kubelet. Conf (master node has admin. CONF), so we need to execute the following command:

export KUBECONFIG=/etc/kubernetes/kubelet.conf

[Solved] Job for docker.service failed because the control process exited with error code. After changing the docker configuration

Solution
( 1) Change       Cnetos7 managed startup file   , When the configuration service starts, does the daemon use the    Some profiles

vim /usr/lib/systemd/system/docker.service

[ Service]

ExecStart=/usr/bin/dockerd            # delete  – After H (including)   All content

(2) There is a problem with the configuration of daemon.json
Look carefully. What’s wrong

I didn’t write that before   ,   number

{    # Turn on remote connection
” hosts”: [” tcp://0.0.0.0 :2375″,”unix:///var/run/docker.sock”],

#  Image acceleration (write your own, alicloud, don’t write it)
” registry-mirrors”: [“https://*******.mirror.aliyuncs.com”]

}

systemctl   daemon-reload

systemctl   start   docker
Wait for the startup to succeed,

ss -anput  | grep  : two thousand three hundred and seventy-five      Display, port open

Spring boot integrates Mongo to solve some common connection and permission problems. Docker compose installs Mongo

Spring boot integrates Mongo to solve some common connection and permission problems. Docker compose installs Mongo

1、 Docker compose to install Mongo

version: '3.1'

services:

  mongo:
    image: mongo
    container_name: mongo
    restart: always
    ports:
      - 27017:27017
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: 123456

  mongo-express:
    image: mongo-express
    container_name: mongo-express
    restart: always
    ports:
      - 8081:8081
    environment:
      ME_CONFIG_MONGODB_SERVER: mongo
      ME_CONFIG_MONGODB_ADMINUSERNAME: root
      ME_CONFIG_MONGODB_ADMINPASSWORD: 123456

2、 Spring boot integrates Mongo

Maven dependency

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

There are some points to pay attention to in the yaml configuration of springboot

1、 How to configure URI

1. Using the URI configuration method to configure password, user name, etc. will not take effect

2. If you encounter permission problems, check whether the user name and password match first. If you encounter

Command failed with error 17 (ProtocolError): ‘Attempt to switch database target during SASL authentication.

This kind of error report usually ends?Authsource = admin without

spring:
  data:
    mongodb:
      uri: mongodb://root:[email protected]:27017/demo?authSource=admin

2、 Configuration of traditional SQL

1. If you are a pure digital password, for example, the author’s password is 123456, use single or double quotation marks when configuring, otherwise you will be identified incorrectly, because the receiving password uses char array, and 123456 will obviously overflow

spring:
  data:
    mongodb:
      username: root
      password: '123456'
      host: 192.168.50.150
      port: 27017
      database: demo
      authentication-database: admin

[Solved] Docker ubuntu swoole fatal error: openssl/ssl.h: No such file or directory

Dockerfile

RUN apt-get update -y
RUN apt-get install -y libssl-dev
RUN cd /tmp/ && rm -rf ./swoole-src
&& curl -o ./swoole.tar.gz https://github.com/swoole/swoole-src/archive/master.tar.gz -L
&& tar zxvf ./swoole.tar.gz
&& mv swoole-src* swoole-src
&& cd swoole-src
&& phpize
&& ./configure –enable-openssl –with-openssl-dir=/usr/lib/ssl –enable-http2
&& make && make install
&& docker-php-ext-enable swoole

Although openssl has been installed, but the corresponding libs are missing, looking for half a day to know the need to install libssl-dev (centos is openssl-devel)

openssl version -a

[Solved] ERROR: for jms_koko Cannot start service koko: driver failed programming

ERROR: for jms_koko Cannot start service koko: driver failed programming
error:

jms_mysql is up-to-date
jms_redis is up-to-date
Creating jms_core ... done
Creating jms_guacamole ... 
Creating jms_celery    ... 
Creating jms_koko      ... 
Creating jms_koko      ... error
Creating jms_luna      ... 
WARNING: Host is already in use by another container

ERROR: for jms_koko  Cannot start service koko: driver failed programming externCreating jms_guacamole ... done
Creating jms_celery    ... done
tcp -d 0/0 --dport 2222 -j DNAT --to-destination 192.168.250.5:2222 ! -i br-c11eCreating jms_lina      ... done
Creating jms_luna      ... done

ERROR: for koko  Cannot start service koko: driver failed programming external connectivity on endpoint jms_koko (741a5fd6b1e317171d1ed6ac21bbf5b97d7035ca33b1bc9bc721e4e864843942):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 2222 -j DNAT --to-destination 192.168.250.5:2222 ! -i br-c11e31f24830: iptables: No chain/target/match by that name.
 (exit status 1))
ERROR: Encountered errors while bringing up the project.

The custom chain docker defined when docker service is started is cleared due to centos7 firewall
solution

#systemctl restart docker// restart docker server

Then run jump server

ERROR: for nginx Container “xxx” is unhealthy.

Error information

ERROR: for nginx Container "5b4004998a86" is unhealthy. 

resolvent

#docker logs -f jms_core --tail 200 

Jenkins docker push to harbor to report error

Jenkins docker push to harbor private service error solution

Jenkins reported an error

When using docker push to private service in jenkinsfile, an error is reported. The error information is as follows:

unauthorized: unauthorized to access repository: ocp/eureka-server, action: push: unauthorized to access repository: ocp/eureka-server, action: push

This is because Jenkins uses the pseudo user of Jenkins when pushing the image. Since you need to log in to push, you should first generate config.json in the current user

The current user uses docker login to generate config.json

The current user logs in with the following command

docker login ip:port

After entering the user name and you, a config.json file is generated in the. Docker directory of the current user’s root directory, as follows:

[wangxianfeng@hs ~]$ cat /root/.docker/config.json 
{
        "auths": {
                "harbor.aiuyo.com:643": {
                        "auth": "d2FuZ3hpYW5mZW5nOlhpYW5mZW5nOTk="
                }
        }
}

Copy. Docker to/var/lib/Jenkins directory

    after logging in with root, copy the/user name /. Docker/directory to/var/lib/Jenkins, and modify the folder permission chown – R Jenkins. Jenkins. Docker to/var/lib/Jenkins

     

    cp -r /root/.docker/ /var/lib/jenkins/
    cd /var/lib/jenkins/
    chown -R jenkins.jenkins .docker

    I am for this reason. After modification, it can be pushed