CDK 배포 환경 구축 가이드

호스트 시스템 사양

  • CPU: i9-14900HX
  • 메모리: 64GB
  • 디스크: 5T nvme ssd
  • 그래픽카드: RTX4060 laptop
  • 네트워크카드: Intel AX201
  • 운영체제: Windows11 23H2
  • 가상화 환경: Hyper-V
  • HTTP 프록시 서비스: v2rayN (특정 외국 프로그램 접근을 위해 설치, 포트 10809)

테스트 환경

본 가이드에서는 3노드 clique 합의를 사용하는 사설 네트워크(Layer1)와 Polygon CDK(Layer2)를 배포하며, 총 4대의 가상 머신이 필요합니다.

가상 머신 설정

모든 가상 머신은 ubuntu-22.04.2-live-server-amd64 운영체제를 사용하며, 사용자명은 polygon, 비밀번호는 123456입니다.

  • 가상 머신1: 2코어 4GB 메모리, 40GB 디스크, IP 10.20.0.100, 호스트명 l1-test1, clique 합의 노드1 배포용
  • 가상 머신2: 2코어 4GB 메모리, 40GB 디스크, IP 10.20.0.101, 호스트명 l1-test2, clique 합의 노드2 배포용
  • 가상 머신3: 2코어 4GB 메모리, 40GB 디스크, IP 10.20.0.102, 호스트명 l1-test3, clique 합의 노드3 배포용
  • 가상 머신4: 4코어 8GB 메모리, 40GB 디스크, IP 10.20.0.103, 호스트명 l2-test, Polygon CDK 배포용

환경 설정

아래 명령어는 모든 호스트에서 실행합니다.

1. 시스템 패키지 업데이트 및 방화벽 비활성화

$ sudo apt update -y
$ sudo systemctl stop ufw
$ sudo systemctl disable ufw

2. Docker 설치

$ sudo apt install docker.io -y
$ sudo systemctl enable docker
$ sudo systemctl status docker

Docker 서비스가 active (running) 상태로 표시되면, Docker 이미지를 국내 리포지토리로 변경합니다. /etc/docker/daemon.json 파일을 편집합니다:

$ sudo vi /etc/docker/daemon.json

내용을 다음과 같이 수정합니다:

{
	"registry-mirrors":[
		"https://docker.1panel.live",
		"https://docker.m.daocloud.io",
		"https://huecker.io",
		"https://dockerhub.timeweb.cloud",
		"https://noohub.ru",
		"https://dockerproxy.com",
		"https://docker.mirrors.ustc.edu.cn",
		"https://docker.nju.edu.cn",
		"https://xx4bwyg2.mirror.aliyuncs.com",
		"http://f1361db2.m.daocloud.io",
		"https://registry.docker-cn.com",
		"http://hub-mirror.c.163.com",
		"https://docker.mirrors.ustc.edu.cn"
	]
}

Docker 서비스를 재시작합니다:

$ sudo systemctl restart docker

3. apt 서비스 프록시 설정

/etc/apt/apt.conf.d/proxy.conf 파일을 편집합니다:

$ sudo vi /etc/apt/apt.conf.d/proxy.conf

다음 내용을 추가합니다:

Acquire::http::Proxy "http://10.20.0.1:10809";
Acquire::https::Proxy "http://10.20.0.1:10809";

4. Git 서비스 프록시 설정

다음 명령어를 실행합니다:

$ git config --global http.proxy http://10.20.0.1:10809
$ git config --global https.proxy http://10.20.0.1:10809

위 작업을 완료하면 환경 설정이 완료됩니다.

태그: docker Polygon CDK ubuntu 가상화 사설 네트워크

7월 18일 23:53에 게시됨