我要评分
获取效率
正确性
完整性
易理解

Enabling the EC Turbo Feature

  1. Enable the EC Turbo feature.

    For details about how to create an EC storage pool, see Creating a Storage Pool in the Ceph Object Storage Deployment Guide (CentOS 7.6 & openEuler 20.03).

    • The stripe_unit value of the EC data pool is 256 KB. When k=4 and m=2, the strip size (stripe_width) is 1 MB. EC Turbo optimizes I/Os smaller than 1 MB.
    • EC Turbo uses the isa-l erasure code library. When creating an EC profile, enable the isa-l plugin, that is, add the plugin=isa parameter. In addition, change the value of stripe_unit to 256 KB. The command for creating an EC profile cannot be the command in the reference document. The correct command for creating an EC profile is:
      1
      ceph osd erasure-code-profile set myprofile k=4 m=2 crush-failure-domain=osd crush-device-class=hdd plugin=isa stripe_unit=256K  
      

      If the number of nodes in the cluster is greater than or equal to 6 (k+m), set crush-failure-domain to host.

    Add the following items to [global] in ceph.conf. These parameters can be modified before or after the pool is created.

    1
    2
    3
    4
    5
    osd_ec_partial_read = true
    osd_ec_partial_write = true
    osd_ec_partial_update = true
    osd_ec_zero_opt = true
    bluestore_kpsallocator_enable = true
    
    • The partial read option conflicts with the fast read option. To enable osd_ec_partial_read, check that osd_pool_default_ec_fast_read is disabled (disabled by default). Otherwise, partial read does not take effect.
    • The default values of the preceding five parameters are true. If you do not add these parameters to ceph.conf, the system uses the default values. To disable the EC Turbo feature, change the values of all parameters displayed in ceph.conf to false.
    • Run the ceph daemon osd.<OSD_number> config show | grep -E 'osd_ec_partial_read|osd_ec_partial_write|osd_ec_partial_update|osd_ec_zero_opt|bluestore_kpsallocator_enable' command to check whether the parameters take effect.
  2. Configure EC Turbo log parameters kpsec_log_fullpath, kpsec_log_level, and kpsec_log_memlogsize.

    These parameters can be defined in the [global] section of ceph.conf. If you do not define these parameters, the system uses the default values.

    The following lists the default values of these parameters.
    1
    2
    3
    4
    5
    6
    [global]
    ......
    kpsec_log_fullpath = /var/log/ceph/
    kpsec_log_level = CRITICAL/DEBUG
    kpsec_log_memlogsize = 100
    ......
    
    • The main services of EC Turbo are encapsulated in the libkps_ec dynamic library. This dynamic library does not use the Ceph log system. Therefore, configure logging for it.
    • Generally, Ceph logs are stored in /var/log/ceph. If another directory is specified, ensure that the Ceph user can read and write the directory.
    • Log levels are classified into the file log level and memory log level, which must be defined separately. Generally, the content recorded in memory logs is more detailed than that recorded in file logs. The log level must be selected from [CRITICAL=0, ERROR=1, WARNING=2, INFORMATION=3, DEBUG=4]. The value of mem_log_size ranges from 100 to 1000.
    • If you modify kpsec log parameters when the OSD process is running, restart the OSD process for the modification to take effect.
    • If it is inconvenient to restart the OSD process, run the ceph tell osd.<OSD_number> injectargs --<parameter_name>=<parameter_value> command to modify the parameter online, and then run the ceph tell osd.<OSD_number> reload_kps_conf command to reload kpsec log parameters.
  3. Push ceph.conf to each node.
    1
    ceph-deploy --overwrite-conf admin {node1} {node2}
    

    {nodeX} is the name of a Ceph node. Run the command to push ceph.conf to multiple nodes in the cluster at the same time. After the push is complete, restart the cluster.

  4. Verify that EC Turbo takes effect.
    1. Change the log level of ceph-osd to 20/20. For example, change the log level of OSD.3:
      1
      ceph daemon osd.3 config set debug_osd 20/20
      
    2. Perform data read and write in the EC pool. Then view the ceph-osd log numbered 3. If the log contains "partial_write=1 partial_update=1", EC Turbo has taken effect.

    3. Change the log level of ceph-osd to the default value.
      1
      ceph daemon osd.3 config set debug_osd 0/1