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

What if you fail to create a calico network using docker

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is to share with you what to do if you fail to create a calico network using docker. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Failed to create calico network using docker.

# docker network create-driver calico--ipam-driver calico-ipam testcalicoError response from daemon: failed to update store for object type * libnetwork.endpointCnt: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.

View the docker log:

# journalctl-fu docker-- Logs begin at Sun 2018-05-06 10:42:10 CST. -- May 06 10:51:11 gpu16 dockerd [1045]: time= "2018-05-06T10:51:11.997488908+08:00" level=warning msg= "Registering as\" 192.168.56.16 level=warning msg= 2375\ "in discovery failed: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint. "May 06 10:51:13 gpu16 dockerd [1045]: time=" 2018-05-06T10:51:13.209441579+08:00 "level=error msg=" discovery error: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint. "May 06 10:51:13 gpu16 dockerd [1045]: time=" 2018-05-06T10:51:13.211323271+08:00 "level=error msg=" discovery error: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint. "May 06 10:51:13 gpu16 dockerd [1045]: time=" 2018-05-06T10:51:13.213320054+08:00 "level=error msg=" discovery error: Unexpected watch error "

The first reason for the error may be that the distributed storage in the calico network background is etcd, while the V3 version of etcd is used in the environment, and this version supports both V2 and V3 in terms of API. The required version is not configured correctly in docker, that is, the version of etcd API required by docker is inconsistent with the version of API provided by etcd, resulting in the problem.

Verification: command line to obtain the version number of etcd manually: curl http://:2379/version

# curl http://192.168.56.96:2379/version{"etcdserver":"3.1.9","etcdcluster":"3.1.0"}

Return to normal.

Seeing http, it occurred to me that our environment needs to set up proxy http_proxy and https_proxy to access http and https. Similarly, we also need to set up no_proxy to filter IP that do not use proxies. If the IP to be accessed is not within the scope of no_proxy, the agent returns an illegal http reply, which is not in json format and most likely corresponds to the "response is invalid json" section of the error log. In the environment variables, http_proxy,https_proxy and no_proxy have been set, but docker cannot use these three environment variables of the operating system, and we need to configure these three environment variables of docker. Also, when creating a calico network, docker registers with etcd through an http request, so the IP of the etcd cluster needs to be included in the no_proxy.

# mkdir-p / etc/systemd/system/docker.service.d/# vim / etc/systemd/system/docker.service.d/http- proxy.confession [service] Environment= "HTTP_PROXY= http://192.168.11.200:8080/"" HTTPS_PROXY= https://192.168.11.200:8080/"NO_PROXY=192.168.56.109192.168.56.96" # systemctl daemon-reload# systemctl restart docker

Wait until the docker service is restarted, and then try to create a calico network successfully.

# docker network create-driver calico--ipam-driver calico-ipam testcalico53cbe9b82451b017be6d5d80a8fc17e320f6269521dfeabb7e07fd79ee92e3ef Thank you for your reading! This is the end of the article on "what to do if you fail to create a calico network using docker". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

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