如何在coreos中使用点火配置Raid 10 for 3 disk


1

磁盘:

/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"
    }]
  }
}

我尝试使用下面的conf。操作系统已成功安装,但在首次启动时,它会在“启动作业正在运行以进行点火(磁盘)”中暂停

{
  "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"                                                                                                                         
    }]
  }
}

P.S:我正在使用PXEBOOT安装coreos

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

欢迎来到SuperUser。你向我们展示你的尝试是件好事。你有什么关于RAID的文章? RAID 10至少需要四个磁盘,因为它的RAID 0高于RAID 1.您可能需要设置RAID 01,它是RAID 0以上的RAID 1。
Run CMD

谢谢。 :)维基百科, en.wikipedia.org/wiki/Non-standard_RAID_levels ,说raid10有3个磁盘是可能的。
Nakshatra

此外,2个磁盘的raid0配置也会在同一错误上暂停。
Nakshatra

如果一般情况下可行,这是无关紧要的。您的整个工具链必须支持您的非标准配置(为什么不使用标准配置?)。但是我可以看到我让你走上正轨,因为你试图将其排除在问题的根本原因之外。
Run CMD

乐施会。根据你的说法,哪种配置最适合3盘。
Nakshatra
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.