콘텐츠로 이동

회사 소개

포괄적인 HashiCorp Vagrant 명령 및 개발 환경 관리 및 가상 머신 프로비저닝 작업 흐름.

설치 및 설치

| | Command | Description | | | --- | --- | | | vagrant version | Show Vagrant version | | | | vagrant -h | Show help information | | | | vagrant init | Initialize new Vagrantfile | | | | vagrant init ubuntu/jammy64 | Initialize with specific box | |

Box 관리

Box 운영

| | Command | Description | | | --- | --- | | | vagrant box list | List installed boxes | | | | vagrant box add ubuntu/jammy64 | Add box | | | | vagrant box add --name mybox /path/to/box.box | Add local box | | | | vagrant box remove ubuntu/jammy64 | Remove box | | | | vagrant box update | Update all boxes | | | | vagrant box update --box ubuntu/jammy64 | Update specific box | |

Box 정보

| | Command | Description | | | --- | --- | | | vagrant box outdated | Check for outdated boxes | | | | vagrant box prune | Remove old box versions | | | | vagrant box repackage ubuntu/jammy64 | Repackage box | |

사이트맵 Lifecycle 관리

기본 작업

| | Command | Description | | | --- | --- | | | vagrant up | Start and provision VM | | | | vagrant halt | Shutdown VM | | | | vagrant reload | Restart VM | | | | vagrant destroy | Destroy VM | | | | vagrant suspend | Suspend VM | | | | vagrant resume | Resume suspended VM | |

VM 상태 및 정보

| | Command | Description | | | --- | --- | | | vagrant status | Show VM status | | | | vagrant global-status | Show all VMs status | | | | vagrant global-status --prune | Clean up invalid entries | |

SSH 및 액세스

SSH 운영

| | Command | Description | | | --- | --- | | | vagrant ssh | SSH into VM | | | | vagrant ssh-config | Show SSH configuration | | | | vagrant ssh -- -L 8080:localhost:80 | SSH with port forwarding | |

회사연혁

약속 명령

| | Command | Description | | | --- | --- | | | vagrant provision | Run provisioners | | | | vagrant provision --provision-with shell | Run specific provisioner | | | | vagrant up --provision | Start and provision | | | | vagrant reload --provision | Restart and provision | |

Multi-Machine 환경

Multi-Machine 명령

| | Command | Description | | | --- | --- | | | vagrant up web | Start specific machine | | | | vagrant ssh web | SSH to specific machine | | | | vagrant halt db | Halt specific machine | | | | vagrant destroy --force | Destroy all without confirmation | |

스냅샷

Snapshot 관리

| | Command | Description | | | --- | --- | | | vagrant snapshot save snapshot_name | Save snapshot | | | | vagrant snapshot list | List snapshots | | | | vagrant snapshot restore snapshot_name | Restore snapshot | | | | vagrant snapshot delete snapshot_name | Delete snapshot | |

플러그인 관리

플러그인 작업

| | Command | Description | | | --- | --- | | | vagrant plugin list | List installed plugins | | | | vagrant plugin install vagrant-vbguest | Install plugin | | | | vagrant plugin uninstall vagrant-vbguest | Uninstall plugin | | | | vagrant plugin update | Update all plugins | |

Vagrantfile 예제

기본 Vagrantfile

카지노사이트

Multi-Machine 설정

카지노사이트

고급 구성

카지노사이트

Provisioning 방법

포탄 Provisioning

카지노사이트

파일 Provisioning

카지노사이트

연락처

카지노사이트

Docker 프로비저닝

카지노사이트

Network 구성

개인 네트워크

카지노사이트

공공 네트워크

카지노사이트

항구 운송

카지노사이트

공급자 구성

VirtualBox 공급자

ο 회원 관리

VMware 공급자

카지노사이트

하이퍼 V 공급자

카지노사이트

동기화 폴더

기본 동기화 폴더

카지노사이트

NFS 동기화 폴더

카지노사이트

SMB 동기화 폴더 (Windows)

카지노사이트

최고의 연습

성능 최적화

  1. ** 자원 할당 **: 적절한 CPU 및 메모리 할당
  2. Synced 폴더: macOS/Linux에서 더 나은 성능을 위한 NFS 사용
  3. ** 박스 선택**: 최소 기본 상자 선택
  4. 명세 Snapshot 관리: 빠른 rollbacks를 위한 snapshots 사용
  5. 명세 Provider Optimization: 공급자 별 최적화 구성

계정 관리

  1. SH 키: 비밀번호 대신 SSH 키를 사용합니다.
  2. 네트워크 고립 : 가능한 경우 Private Network 사용
  3. Firewall: 적절한 방화벽 규칙 구성
  4. 명세 ** 업데이트**: 박스 및 Vagrant 업데이트 유지
  5. 명세 Secrets: 버전 컨트롤에 비밀을 부여하지 마십시오

개발 Workflow

  1. Version Control: 버전 컨트롤에 Vagrantfile 포함
  2. : 문서 설정 및 사용
  3. ** 일관성**: 팀의 맞은편에 동일한 환경을 사용하십시오
  4. 명세 Testing: 스크립트를 테스트
  5. 명세 Cleanup: 정기적으로 사용되지 않는 VM 및 상자를 청소하십시오

문제 해결

  1. 로그: Vagrant 및 공급자 로그 확인
  2. SSH: 디버깅을 위한 vagrant ssh-config 사용
  3. 네트워킹 : 테스트 네트워크 연결
  4. 명세 Provisioning: 별도의 스크립트를 테스트
  5. 명세 ** 리소스**: 호스트 시스템 리소스 모니터링