Разница между страницами «Mdadm» и «Gitlab»

Материал из Home Wiki
(Различия между страницами)
Перейти к навигации Перейти к поиску
 
 
Строка 1: Строка 1:
[[:Категория:Работа]]
= Вычистить docker registry v2 =


= Create =
https://gbougeard.github.io/blog.english/2017/05/20/How-to-clean-a-docker-registry-v2.html


<syntaxhighlight>
mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
</syntaxhighlight>


= Remove from array =


1. fail
Attention: rming files on the storage and running the GC are critical operations : your DR must be in Read-Only mode. No image must be pushed while you’re performing those ops.
 
There are 2 files to rm to cleanly remove a digest :
 
<syntaxhighlight>
<syntaxhighlight>
mdadm /dev/md0 --fail /dev/hde1
<root>/v2/repositories/${name}/_manifests/tags/${tag}/index/sha256/${hash}
<root>/v2/repositories/${name}/_manifests/revisions/sha256/${hash}
# ${name} : image name
# ${tag}  : tag name
# ${hash} : digest to delete
</syntaxhighlight>
</syntaxhighlight>
2. remove
<syntaxhighlight>
mdadm /dev/md0 --remove /dev/hde1
<syntaxhighlight>


= Copy via tar =
After deleting the 2 files, you can run the GC and it should free some space.


<syntaxhighlight>
<syntaxhighlight>
tar cf - . | (cd /work/bkup/jane && tar xBf -)
registry garbage-collect /var/opt/gitlab/registry/config.yml
</syntaxhighlight>
</syntaxhighlight>
[[Категория:Работа]]

Текущая версия на 06:18, 12 апреля 2018

Категория:Работа

Вычистить docker registry v2

https://gbougeard.github.io/blog.english/2017/05/20/How-to-clean-a-docker-registry-v2.html


Attention: rming files on the storage and running the GC are critical operations : your DR must be in Read-Only mode. No image must be pushed while you’re performing those ops.

There are 2 files to rm to cleanly remove a digest :

<root>/v2/repositories/${name}/_manifests/tags/${tag}/index/sha256/${hash}
<root>/v2/repositories/${name}/_manifests/revisions/sha256/${hash}
# ${name} : image name
# ${tag}  : tag name
# ${hash} : digest to delete

After deleting the 2 files, you can run the GC and it should free some space.

registry garbage-collect /var/opt/gitlab/registry/config.yml