GaGa's Blog

One GaGa, One World !

Vagrantfile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Vagrant.configure("2") do |config|
# 定义虚拟机数量
vms = Array(1..3)
vms.each do |i|
config.vm.define "centos8-#{i}" do |node|
# 设置虚拟机的Box
node.vm.box = "centos8"
# 设置虚拟机的主机名
node.vm.hostname="centos8-#{i}"
# 设置虚拟机的IP
node.vm.network "private_network", ip: "172.24.20.4#{i}", hostname: true
# 虚拟化设置cpu/mem
node.vm.provider "virtualbox" do |v|
# 设置虚拟机的名称
v.name = "centos8-#{i}"
# 设置虚拟机的内存大小
v.memory = 1024
# 设置虚拟机的CPU个数
v.cpus = 1
end
end
end
end

up log

mvpbang@mvpbang c8-4x % vagrant up
Bringing machine 'centos8-1' up with 'virtualbox' provider...
Bringing machine 'centos8-2' up with 'virtualbox' provider...
Bringing machine 'centos8-3' up with 'virtualbox' provider...
==> centos8-1: Importing base box 'centos8'...
==> centos8-1: Matching MAC address for NAT networking...
==> centos8-1: Setting the name of the VM: centos8-1
==> centos8-1: Clearing any previously set network interfaces...
==> centos8-1: Preparing network interfaces based on configuration...
    centos8-1: Adapter 1: nat
    centos8-1: Adapter 2: hostonly
==> centos8-1: Forwarding ports...
    centos8-1: 22 (guest) => 2222 (host) (adapter 1)
==> centos8-1: Running 'pre-boot' VM customizations...
==> centos8-1: Booting VM...
==> centos8-1: Waiting for machine to boot. This may take a few minutes...
    centos8-1: SSH address: 127.0.0.1:2222
    centos8-1: SSH username: vagrant
    centos8-1: SSH auth method: private key
    centos8-1: 
    centos8-1: Vagrant insecure key detected. Vagrant will automatically replace
    centos8-1: this with a newly generated keypair for better security.
    centos8-1: 
    centos8-1: Inserting generated public key within guest...
    centos8-1: Removing insecure key from the guest if it's present...
    centos8-1: Key inserted! Disconnecting and reconnecting using new SSH key...
==> centos8-1: Machine booted and ready!
==> centos8-1: Checking for guest additions in VM...
    centos8-1: No guest additions were detected on the base box for this VM! Guest
    centos8-1: additions are required for forwarded ports, shared folders, host only
    centos8-1: networking, and more. If SSH fails on this machine, please install
    centos8-1: the guest additions and repackage the box to continue.
    centos8-1: 
    centos8-1: This is not an error message; everything may continue to work properly,
    centos8-1: in which case you may ignore this message.
==> centos8-1: Setting hostname...
==> centos8-1: Configuring and enabling network interfaces...
==> centos8-1: Rsyncing folder: /Users/mvpbang/vagrants/c8-4x/ => /vagrant
==> centos8-2: Importing base box 'centos8'...
==> centos8-2: Matching MAC address for NAT networking...
==> centos8-2: Setting the name of the VM: centos8-2
==> centos8-2: Fixed port collision for 22 => 2222. Now on port 2200.
==> centos8-2: Clearing any previously set network interfaces...
==> centos8-2: Preparing network interfaces based on configuration...
    centos8-2: Adapter 1: nat
    centos8-2: Adapter 2: hostonly
==> centos8-2: Forwarding ports...
    centos8-2: 22 (guest) => 2200 (host) (adapter 1)
==> centos8-2: Running 'pre-boot' VM customizations...
==> centos8-2: Booting VM...
==> centos8-2: Waiting for machine to boot. This may take a few minutes...
    centos8-2: SSH address: 127.0.0.1:2200
    centos8-2: SSH username: vagrant
    centos8-2: SSH auth method: private key
    centos8-2: 
    centos8-2: Vagrant insecure key detected. Vagrant will automatically replace
    centos8-2: this with a newly generated keypair for better security.
    centos8-2: 
    centos8-2: Inserting generated public key within guest...
    centos8-2: Removing insecure key from the guest if it's present...
    centos8-2: Key inserted! Disconnecting and reconnecting using new SSH key...
==> centos8-2: Machine booted and ready!
==> centos8-2: Checking for guest additions in VM...
    centos8-2: No guest additions were detected on the base box for this VM! Guest
    centos8-2: additions are required for forwarded ports, shared folders, host only
    centos8-2: networking, and more. If SSH fails on this machine, please install
    centos8-2: the guest additions and repackage the box to continue.
    centos8-2: 
    centos8-2: This is not an error message; everything may continue to work properly,
    centos8-2: in which case you may ignore this message.
==> centos8-2: Setting hostname...
==> centos8-2: Configuring and enabling network interfaces...
==> centos8-2: Rsyncing folder: /Users/mvpbang/vagrants/c8-4x/ => /vagrant
==> centos8-3: Importing base box 'centos8'...
==> centos8-3: Matching MAC address for NAT networking...
==> centos8-3: Setting the name of the VM: centos8-3
==> centos8-3: Fixed port collision for 22 => 2222. Now on port 2201.
==> centos8-3: Clearing any previously set network interfaces...
==> centos8-3: Preparing network interfaces based on configuration...
    centos8-3: Adapter 1: nat
    centos8-3: Adapter 2: hostonly
==> centos8-3: Forwarding ports...
    centos8-3: 22 (guest) => 2201 (host) (adapter 1)
==> centos8-3: Running 'pre-boot' VM customizations...
==> centos8-3: Booting VM...
==> centos8-3: Waiting for machine to boot. This may take a few minutes...
    centos8-3: SSH address: 127.0.0.1:2201
    centos8-3: SSH username: vagrant
    centos8-3: SSH auth method: private key
    centos8-3: 
    centos8-3: Vagrant insecure key detected. Vagrant will automatically replace
    centos8-3: this with a newly generated keypair for better security.
    centos8-3: 
    centos8-3: Inserting generated public key within guest...
    centos8-3: Removing insecure key from the guest if it's present...
    centos8-3: Key inserted! Disconnecting and reconnecting using new SSH key...
==> centos8-3: Machine booted and ready!
==> centos8-3: Checking for guest additions in VM...
    centos8-3: No guest additions were detected on the base box for this VM! Guest
    centos8-3: additions are required for forwarded ports, shared folders, host only
    centos8-3: networking, and more. If SSH fails on this machine, please install
    centos8-3: the guest additions and repackage the box to continue.
    centos8-3: 
    centos8-3: This is not an error message; everything may continue to work properly,
    centos8-3: in which case you may ignore this message.
==> centos8-3: Setting hostname...
==> centos8-3: Configuring and enabling network interfaces...
==> centos8-3: Rsyncing folder: /Users/mvpbang/vagrants/c8-4x/ => /vagrant
Read more »

Vagrant是一个用于创建和配置虚拟开发环境的工具,它允许开发者使用Vagrantfile来描述虚拟机的配置,并通过简单的命令来管理虚拟机的生命周期

Read more »

Vagrant是一个用于创建和配置虚拟开发环境的工具,它使用 Vagrantfile(一种配置文件)来描述虚拟机的配置,并使用 VirtualBox、VMware、Hyper-V 等虚拟机软件来运行虚拟机。Vagrant 使得开发者可以在本地机器上快速搭建一个与生产环境相似的开发环境。

Read more »

对于sealos很方便部署kubernetes(离线环境),早期离线包是收费的记得是50一份,特此收集分享相关资源以此共享…

Read more »

Sealos v3 还提供了强大的工具来管理 Kubernetes 集群的整个生命周期,包括但不限于安装裸 Kubernetes 集群、在 Kubernetes 之上组装各种上层分布式应用、构建生产高可用集群等。即使在离线环境中,Sealos v3 也能提供出色的 Kubernetes 运行体验

Read more »

Sealos v3 是 Sealos 的一个版本,它是一个以 Kubernetes 为内核的云操作系统发行版,高可用架构,node通过ipvs-vs(locallb)转发到apiserver

特点:

  • 简单易用
  • 快速部署(高可用)
Read more »

Samba 是一个在 Linux 和 Unix 系统上实现 Windows 网络文件共享的自由软件。它允许文件和打印服务在不同操作系统之间共享,使得 Linux 系统能够与 Windows 系统无缝集成

Read more »

开源镜像是一种提供开源软件、Linux发行版镜像文件下载服务的服务器,帮助用户快速、稳定地获取所需的软件包和系统镜像

Read more »

Docker默认的根目录(也称为 Docker数据目录)是/var/lib/docker这个目录用于存储 Docker 容器、镜像、卷和网络的数据…


m1磁盘满了(/var/lib/docker)

1、df -h查看磁盘接近100%

2、迁移磁盘位置

2.1、停止docker 移动到存在的目录并且空间足够大
systemctl stop docker

2.2、软连接
mv /var/lib/docker /devdata/
ln -s /devdata/docker/ /var/lib/

2.3、重启docker
systemctl restart docker
Read more »
0%