【GCP】존간의 VM 인스턴스를 접속
3071 단어 VirtualMachinenginxgoogle
VM 생성
GCP Console에서
이름 :
my-vm-1
Region: us-central1Zone: us-central1-a
부팅 디스크 :
Debian GNU/Linux 9 (stretch)
액세스 범위 : Allow default access
Firewall: Allow HTTP traffic(수신 HTTP 트래픽 허용)gcloud command에서
지역 지정
gcloud compute zones list | grep us-central1
영역 설정gcloud config set compute/zone us-central1-b
VM 생성gcloud compute instances create "my-vm-2" \
--machine-type "n1-standard-1" \
--image-project "debian-cloud" \
--image "debian-9-stretch-v20190213" \
--subnet "default"
결과
my-vm-2

Connect between VM 인스턴스

ssh 클릭
my-vm-1에 연결하기 위해 다음 명령을 실행합니다.
ssh my-vm-1

my-vm-1 인스턴스에 Nguix 웹 서버 설치
sudo apt-get install nginx-light -y

sudo nano에서 index.nginx-debian.html 파일 편집
sudo nano /var/www/html/index.nginx-debian.html

저장하고 종료
Ctrl+O→Enter→Ctrl+X
my-vm-1 제공하는 웹 서버를 확인하는 명령
curl http://localhost/

my-vm-1 명령 프롬프트를 종료하고 다음 명령을 실행합니다.
exit
my-vm-2 명령 프롬프트로 돌아가기
my-vm-2 명령 프롬프트에서 my-vm-1 웹 서버에 도달할 수 있는 확인 명령
curl http://my-vm-1/

http://my-vm-1/

Reference
이 문제에 관하여(【GCP】존간의 VM 인스턴스를 접속), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/huong/items/a77db84b297b8559d0cb텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)