如何在 coreos 中使用 iginition 为 3 个磁盘配置 Raid10

如何在 coreos 中使用 iginition 为 3 个磁盘配置 Raid10

磁盘:

/dev/sda
/dev/sdb
/dev/md127

关联:https://coreos.com/ignition/docs/latest/examples.html#create-a-raid-enabled-data-volume

此配置将在两个独立的磁盘之间设置 RAID0 ext4 卷和数据。

问:如何为 3 个磁盘配置 raid10?

{
  "ignition": { "version": "2.0.0" },
  "storage": {
    "disks": [
      {
        "device": "/dev/sda",
        "wipeTable": true,
        "partitions": [{
          "label": "raid.1.1",
          "number": 1,
          "size": 20480,
          "start": 0
        }]
      },
      {
        "device": "/dev/sdb",
        "wipeTable": true,
        "partitions": [{
          "label": "raid.1.2",
          "number": 1,
          "size": 20480,
          "start": 0
        }]
      }
    ],
    "raid": [{
      "devices": [
        "/dev/disk/by-partlabel/raid.1.1",
        "/dev/disk/by-partlabel/raid.1.2"
      ],
      "level": "stripe",
      "name": "data"
    }],
    "filesystems": [{
      "mount": {
        "device": "/dev/md/data",
        "format": "ext4",
        "create": { "options": [ "-L", "DATA" ] }
      }
    }]
  },
  "systemd": {
    "units": [{
      "name": "var-lib-data.mount",
      "enable": true,
      "contents": "[Mount]\nWhat=/dev/md/data\nWhere=/var/lib/data\nType=ext4\n\n[Install]\nWantedBy=local-fs.target"
    }]
  }
}

我尝试使用以下配置。操作系统安装成功,但在第一次启动时,它暂停在“启动作业正在运行,用于点火(磁盘)”

{
  "ignition": { "version": "2.0.0" },                                                                                                                                                                                                         
  "storage": {                                                                                                                                                                                                                                
    "disks": [                                                                                                                                                                                                                                
      {
        "device": "/dev/sda",                                                                                                                                                                                                                 
        "wipeTable": true,                                                                                                                                                                                                                    
        "partitions": [{                                                                                                                                                                                                                      
          "label": "raid.1.1",                                                                                                                                                                                                                
          "number": 1,                                                                                                                                                                                                                        
          "start": 0                                                                                                                                                                                                                          
        }]                                                                                                                                                                                                                                    
      },
      {
        "device": "/dev/sdb",                                                                                                                                                                                                                 
        "wipeTable": true,                                                                                                                                                                                                                    
        "partitions": [{                                                                                                                                                                                                                      
          "label": "raid.1.2",                                                                                                                                                                                                                
          "number": 1,                                                                                                                                                                                                                        
          "start": 0                                                                                                                                                                                                                          
        }]                                                                                                                                                                                                                                    
      },
      {
        "device": "/dev/md127",                                                                                                                                                                                                               
        "wipeTable": true,                                                                                                                                                                                                                    
        "partitions": [{                                                                                                                                                                                                                      
          "label": "raid.1.3",                                                                                                                                                                                                                
          "number": 1,                                                                                                                                                                                                                        
          "start": 0                                                                                                                                                                                                                          
        }]                                                                                                                                                                                                                                    
      }
    ],
    "raid": [{                                                                                                                                                                                                                                
      "devices": [                                                                                                                                                                                                                            
        "/dev/disk/by-partlabel/raid.1.1",                                                                                                                                                                                                    
        "/dev/disk/by-partlabel/raid.1.2",                                                                                                                                                                                                    
        "/dev/disk/by-partlabel/raid.1.3"                                                                                                                                                                                                     
      ],
      "level": "raid10",                                                                                                                                                                                                                      
      "name": "data"                                                                                                                                                                                                                          
    }],
    "filesystems": [{                                                                                                                                                                                                                         
      "mount": {                                                                                                                                                                                                                              
        "device": "/dev/md/data",                                                                                                                                                                                                             
        "format": "ext4",                                                                                                                                                                                                                     
        "create": { "options": [ "-L", "DATA" ] }                                                                                                                                                                                             
      }
    }]
  },
  "systemd": {                                                                                                                                                                                                                                
    "units": [{                                                                                                                                                                                                                               
      "name": "var-lib-data.mount",                                                                                                                                                                                                           
      "enable": true,                                                                                                                                                                                                                         
      "contents": "[Mount]\nWhat=/dev/md/data\nWhere=/var/lib/data\nType=ext4\n\n[Install]\nWantedBy=local-fs.target"                                                                                                                         
    }]
  }
}

PS:我正在使用 PXEBOOT 安装 coreos

coreos-install -V current -C beta -c cloud-config.yml -i ignition.yml 

相关内容