Ubuntu22.04 mirrror-server 구축
mirror server 에 apt-mirror 설치
apt install apt-mirror # 기본 repository에 있는 apt-mirror의 경우 apt-get이 정상적으로 작동하지 않는 버그가 있으므로 fork 버전을 사용함 # git clone 이후 기존버전 backup git clone https://github.com/Stifler6996/apt-mirror mv /usr/bin/apt-mirror /usrbin/apt-mirror.bak # clone 한 apt-mirror /usr/bin/apt-mirror 로 이동 후 권한 부여 cp apt-mirror/apt-mirror /usr/bin/apt-mirror sudo chmod 755 /usr/bin/apt-mirror ; sudo chown root:root /usr/bin/apt-mirror
sync 할 repo 를 설정하여 sync 진행
- 본문은 ubuntu 기본 repository 외에 galeracluster repo도 구성하기에 galeraclsuter repository을 추가함
root@kimbh0132-206594:/# cat /etc/apt/mirror.list ############# config ################## # # set base_path /var/spool/apt-mirror # # set mirror_path /mirror # set skel_path /skel # set var_path /var # set cleanscript /clean.sh # set defaultarch <running host architecture> # set postmirror_script /postmirror.sh # set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ############## # galeraclsuter repo deb https://releases.galeracluster.com/galera-4/ubuntu jammy main deb https://releases.galeracluster.com/mysql-wsrep-8.0/ubuntu jammy main # ubuntu 22.04 deb http://mirror.kakao.com/ubuntu/ jammy main restricted universe multiverse deb http://mirror.kakao.com/ubuntu/ jammy-updates main restricted universe multiverse deb http://mirror.kakao.com/ubuntu/ jammy-backports main restricted universe multiverse deb http://mirror.kakao.com/ubuntu/ jammy-security main restricted universe multiverse
apt-mirror 실행하여 sync 진행
기본 다운로드 디렉토리는 ‘/var/spoor/apt-mirror/’ 에 다운로드
root@kimbh0132-206594:/# apt-mirror Downloading 18 release files using 18 threads... Begin time: Wed May 31 19:18:58 2023 [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Wed May 31 19:18:59 2023 Processing metadata files from releases [MMMMMM] Downloading 517 index files using 20 threads... Begin time: Wed May 31 19:19:00 2023 [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Wed May 31 19:19:01 2023 Processing indexes: [PPPPPP] 11.1 GiB will be downloaded into archive. Downloading 1666 archive files using 20 threads... Begin time: Wed May 31 19:19:11 2023 [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Wed May 31 19:21:28 2023 0 bytes in 0 files and 0 directories can be freed. Run /var/spool/apt-mirror/var/clean.sh for this purpose. Running the Post Mirror script ... (/var/spool/apt-mirror/var/postmirror.sh) root@kimbh0132-206594:/var/spool/apt-mirror# ls -al /var/spool/apt-mirror/mirror/ total 16 drwxr-xr-x 4 root root 4096 5월 24 09:01 . drwxr-xr-x 5 root root 4096 5월 23 09:35 .. drwxr-xr-x 3 root root 4096 5월 23 09:38 mirror.kakao.com drwxr-xr-x 4 root root 4096 5월 24 09:01 releases.galeracluster.com
apache 설치
root@kimbh0132-206594:/# apt install apache2
apt-mirror 로 sync된 파일을 apache를 통하여 웹 서버 구성
root@kimbh0132-206594:/# ln -s /var/spool/apt-mirror/mirror/releases.galeracluster.com /var/www/html/galeracluster root@kimbh0132-206594:/# ln -s /var/spool/apt-mirror/mirror/mirror.kakao.com /var/www/html/mysql-wsrep-8.0/ubuntu
http://ip주소/galeracluster 접속한 모습
위 웹 주소를 client 서버의 ‘/etc/apt/source.list’ 에 넣어주면 mirror-server 를 사용할 수 있습니다.