반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- java
- Vagrant
- devops #jenkins
- 도커
- springboot
- Strimzi
- ioredirection
- linux
- multivm
- 컨테이너
- nginx
- DOIK
- mongodb operator
- namespace
- bash
- 쿠버네티스
- docker
- k8s
- aws #engineer
- WEB
- RSS
- devops #engineer
- 파이썬
- container
- python
- variable
- Engineer
- httpd실행
- 초간단파이썬
- Kubernetes
Archives
- Today
- Total
샤인의 IT (막 적는) 메모장
[Vagrant] IP 및 리소스 설정 본문
반응형
Vagrant
- OS 설치 없음
- 이미지를 통해 VM 세팅
- Vagrant Cloud에서 이미지를 다운로드 받음.
- Vagrantfile을 통해 관리
#global status 확인
Shin@DESKTOP-EAFOCLM MINGW64 /d/vagrant/centos7
$ vagrant global-status
id name provider state directory
------------------------------------------------------------------------
1db2c86 default virtualbox running D:/vagrant/centos7
The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date (use "vagrant global-status --prune" to prune invalid
entries). To interact with any of the machines, you can go to that
directory and run Vagrant, or you can use the ID directly with
Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"
# vm status 확인
Shin@DESKTOP-EAFOCLM MINGW64 /d/vagrant/centos7
$ vagrant status
Current machine states:
default running (virtualbox)
The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
#Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/centos7"
#네트워크 private 설정
config.vm.network "private_network", ip: "192.168.25.12"
#네트워크 Public 설정
config.vm.network "public_network"
#리소스 설정
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
vb.gui = true
#
# # Customize the amount of memory on the VM:
vb.memory = "1600"
vb.cpus = 1
end
end
#설정 변경 후 vagrant reload로 프로비저닝
$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'geerlingguy/centos7' version '1.2.25' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
default: Adapter 3: bridged
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection reset. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => D:/vagrant/centos7
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
#VM 접속 후 IP 및 리소스 확인
Shin@DESKTOP-EAFOCLM MINGW64 /d/vagrant/centos7
$ vagrant ssh
Last login: Fri Jan 14 11:56:22 2022 from 10.0.2.2
[vagrant@localhost ~]$ free -m
total used free shared buff/cache available
Mem: 1556 143 1301 8 112 1281
Swap: 1023 0 1023
[vagrant@localhost ~]$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::a00:27ff:fe13:33ce prefixlen 64 scopeid 0x20<link>
ether 08:00:27:13:33:ce txqueuelen 1000 (Ethernet)
RX packets 786 bytes 87818 (85.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 620 bytes 94634 (92.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.25.12 netmask 255.255.255.0 broadcast 192.168.25.255
inet6 fe80::a00:27ff:fea7:e7a prefixlen 64 scopeid 0x20<link>
ether 08:00:27:a7:0e:7a txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23 bytes 2936 (2.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
VirtualBox 내 프로비저닝된 VM 확인
반응형
'IaC > Vagrant' 카테고리의 다른 글
[Vagrant] Multi VM (0) | 2022.01.17 |
---|---|
[Vagrant] Provisioning (0) | 2022.01.16 |
[Vagrant] Sync Directory (0) | 2022.01.16 |
Comments