Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the problem that Rancher cannot add hosts

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Preface

This article mainly introduces how to solve the problem that Rancher cannot add hosts. Let's take a look at the detailed introduction.

The methods are as follows:

Docker version:

two。 Start Docker:

Systemctl daemon-reloadsystemctl enable dockersystemctl start docker

3. Install rancher:

Docker run-d-p 8080 mnt/data/rancher/db:/var/lib/mysql 8080-- restart=always-v / mnt/data/rancher/db:/var/lib/mysql-- name rancher-server-146 rancher/server:v1.6.17

4. Add a host:

Find the id of agent by executing docker ps on the command line, and then execute docker logs id

The agent container was found to be unsuccessful.

First, you need to delete the file under / var/lib/rancher/state, which is used to mark the uniqueness of the host, and then delete the agent container

Next, you need to add dns to / etc/docker/daemon.json

{"registry-mirrors": ["https://2lqq34jg.mirror.aliyuncs.com","https://pee6w651.mirror.aliyuncs.com","https://registry.docker-cn.com","http://hub-mirror.c.163.com"],"dns": [" 8.8.8.8 "," 8.8.4.4 "]}

Finally restart docker

Systemctl daemon-reloadsystemctl restart docker.serviceservice docker restart

After re-adding hosts, check the operation of agent through docker logs id.

As shown in the picture, it works normally. The host is added successfully, and then the services are added.

Summary

The above is the whole content of this article, I hope that the content of this article has a certain reference and learning value for your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report