Get the App
SLTechnology News&Howtos  ›  Servers  › 

Cannot synchronize mirrors between Harbor

Shulou Source: shulou.com Published: 2022-06-02 02:20:20 11月16日 Update

One: background

The two harbor (An and B) in the test environment cannot synchronize the image. The reason for the check is that the harbor container cannot properly resolve the ip address of the peer harbor. As a result, the image synchronization of the harbor added in the repository management whose status is unhealthy,harbor cannot be performed properly.

Second: solution

Add B's ip to each container in A's harbor to resolve to / etc/hosts. Also do a similar operation in B, with the following command:

A) execute the following command on server A to add harbor resolution of B to each container of harbor: `for i in `docker ps | grep harbor | awk'{print $1}'`; do docker exec-it $I bash-c 'echo "domain name of 10.203.121.137 Bharbor" > > / etc/hosts'; domain `b) execute the following command on server B to add harbor resolution of A to each container of harbor: for i in `docker ps | grep harbor | awk' {print $1}'` Do docker exec-it $I bash-c 'echo "10.203.121.60 Aharbor domain name" > > / etc/hosts';done

Three: remarks

The relevant commands have been recorded in / etc/rc.local on the server.

Tags: Commands containers servers services mirrors synchronization domain names two repositories reasons addresses comments scenarios status environment background solutions inspection testing management Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Microsoft Shulou Technology Shulou Information Redmi