From bfb0c0a32d12342c166ff16ff20f70ce422d5e32 Mon Sep 17 00:00:00 2001 From: yixingj Date: Fri, 14 Jul 2017 17:04:37 +0800 Subject: [PATCH] Update Clair offiline date guide --- docs/clair_offlinedata_guide.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/clair_offlinedata_guide.md b/docs/clair_offlinedata_guide.md index bfa69873b..d3274aaa9 100644 --- a/docs/clair_offlinedata_guide.md +++ b/docs/clair_offlinedata_guide.md @@ -1,4 +1,4 @@ -## Guild for update clair offline data +## Guild for update Clair offline data ### Summary In some case when user install harbor in an environment without internet access. Then Clair will not be able to fetch the latest vulnerability database. In this circumstance user need manfully update the Clair database. @@ -18,7 +18,6 @@ B. Check the Clair already update the vulnerability to the latest. c. If you are using harbor you can find the latest Clair log under /var/log/harbor/2017--xx-xx/clair.log d. You will find some logs like follow: - ``` Jul 3 20:40:45 172.18.0.1 clair[3516]: {"Event":"finished fetching","Level":"info","Location":"updater.go:227","Time":"2017-07-04 03:40:45.890364","updater name":"rhel"} Jul 3 20:40:46 172.18.0.1 clair[3516]: {"Event":"finished fetching","Level":"info","Location":"updater.go:227","Time":"2017-07-04 03:40:46.768924","updater name":"alpine"} @@ -29,7 +28,6 @@ B. Check the Clair already update the vulnerability to the latest. Jul 4 00:26:18 172.18.0.1 clair[3516]: {"Event":"adding metadata to vulnerabilities","Level":"info","Location":"updater.go:253","Time":"2017-07-04 07:26:18.060810"} Jul 4 00:38:05 172.18.0.1 clair[3516]: {"Event":"update finished","Level":"info","Location":"updater.go:198","Time":"2017-07-04 07:38:05.251580"} ``` - e. The update finished indicate that Clair has finished an vulnerability update round. You need to check that logs above it to make sure all the endpoints are update correctly. ### Data dump @@ -56,7 +54,7 @@ A. Before update the offline data, user are strongly suggested to backup their C A. Copy the vulnerability.sql and clear.sql to the clair-db container which you want to update. (if you check the harbor docker compose file you will find clair-db has two volumes: ./common/config/clair/postgresql-init.d/:/docker-entrypoint-initdb.d and /data/clair-db:/var/lib/postgresql/data, you can put the above sql file in ether of this two folder as a transfer) -B. Get the clair db shell by "docker exec –it clair-db bash" +B. Get the Clair db shell by "docker exec –it clair-db bash" C. $>psql -U postgres < clear.sql