GitLab
docker, gitlab runner 설치 및 테스트 스크립트
kyeongjun-dev
2022. 5. 12. 23:13
설치 스크립트
#!/bin/bash
amazon-linux-extras install -y docker
usermod -aG docker ec2-user
systemctl enable docker
systemctl start docker
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | bash
yum install -y gitlab-runner-14.10.0-1
버퍼/캐시 비우기(/swap 파일이 스왑 메모리로 사용되고 있을 경우)
echo 3 > /proc/sys/vm/drop_caches
swapoff -a
swapon /swapfile
스왑파일을 이용한 스왑 메모리 할당
# 2GB 할당
sudo dd if=/dev/zero of=/swapfile bs=4KB count=512000
512000+0 records in
512000+0 records out
2048000000 bytes (2.0 GB) copied, 14.9841 s, 137 MB/s
# 1GB 할당
dd if=/dev/zero of=/swapfile bs=4KB count=256000
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
스왑 used 추출 커맨드
free -m
total used free shared buff/cache available
Mem: 32072 2879 13432 68 15760 28680
스왑: 2047 0 2047
free -m | awk '/^Swap/ {print $3}'
free -m | awk '/^스왑/ {print $3}'
0
도커, 깃랩러너 설치 및 스왑 활성화
#!/bin/bash
amazon-linux-extras install -y docker
usermod -aG docker ec2-user
systemctl enable docker
systemctl start docker
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | bash
yum install -y gitlab-runner-14.10.0-1
dd if=/dev/zero of=/swapfile bs=4KB count=512000
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile