Porting Guides
Total Page:16
File Type:pdf, Size:1020Kb
Kunpeng BoostKit for SDS Porting Guides Issue 03 Date 2021-03-23 HUAWEI TECHNOLOGIES CO., LTD. Copyright © Huawei Technologies Co., Ltd. 2021. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei Technologies Co., Ltd. Trademarks and Permissions and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd. All other trademarks and trade names mentioned in this document are the property of their respective holders. Notice The purchased products, services and features are stipulated by the contract made between Huawei and the customer. All or part of the products, services and features described in this document may not be within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information, and recommendations in this document are provided "AS IS" without warranties, guarantees or representations of any kind, either express or implied. The information in this document is subject to change without notice. Every effort has been made in the preparation of this document to ensure accuracy of the contents, but all statements, information, and recommendations in this document do not constitute a warranty of any kind, express or implied. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. i Kunpeng BoostKit for SDS Porting Guides Contents Contents 1 Bcache Porting Guide (CentOS 7.6).................................................................................... 1 1.1 Introduction............................................................................................................................................................................... 1 1.2 Environment Requirements................................................................................................................................................. 1 1.3 Configuring the Compilation Environment.................................................................................................................... 2 1.4 Obtaining Source Code..........................................................................................................................................................2 1.5 Compiling and Installing Bcache........................................................................................................................................3 1.6 Running and Verifying Bcache......................................................................................................................................... 10 1.6.1 Setting the Default Kernel Version Started by the System................................................................................. 10 1.6.2 Installing the Bcache Configuration Tool.................................................................................................................. 11 1.6.3 Basic Operations on Bcache...........................................................................................................................................11 1.7 More Resources..................................................................................................................................................................... 14 2 Ceph 14.2.1 Porting Guide (CentOS 7.6)......................................................................... 15 2.1 Introduction............................................................................................................................................................................ 15 2.2 Environment Requirements............................................................................................................................................... 17 2.3 Configuring the Compilation Environment.................................................................................................................. 18 2.4 Installing Dependencies...................................................................................................................................................... 19 2.5 Compiling, Installing, Running, and Verifying Ceph................................................................................................. 20 A Change History...................................................................................................................... 23 Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. ii Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) 1 Bcache Porting Guide (CentOS 7.6) 1.1 Introduction 1.2 Environment Requirements 1.3 Configuring the Compilation Environment 1.4 Obtaining Source Code 1.5 Compiling and Installing Bcache 1.6 Running and Verifying Bcache 1.7 More Resources 1.1 Introduction Bcache Overview Bcache is a cache in the block layer of the Linux kernel. It uses solid-state drives (SSDs) as the cache of hard disk drives (HDDs) for acceleration. The Bcache kernel module is supported only by Linux 3.10 or later. Therefore, before using Bcache, you need to upgrade the kernel to 3.10 or later. For more details, see the following: https://bcache.evilpiepirate.org/ https://evilpiepirate.org/git/linux-bcache.git/tree/Documentation/bcache.txt 1.2 Environment Requirements Operating System Table 1-1 lists the operating system requirements. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 1 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) Table 1-1 Operating system requirements Operating System Version CentOS 7.6 Kernel 4.14.0 1.3 Configuring the Compilation Environment Step 1 In the ARM64 platform, the default page size is 64 KB. During the registration of bcache, the superblock information of 4 KB needs to be read from the device, and the bcache-related information needs to be added to the superblock and stored in a memory page. Therefore, you need to recompile the kernel to change the page size to 4 KB and enable bcache. Step 2 Download the bcache tool package bcache-tools 1.0.8. https://github.com/g2p/bcache-tools/releases Step 3 Install the compilation dependency. yum -y install elfutils-libelf-devel bc openssl-devel ncurses-devel libssl-dev NO TE If the dependency package is missing, mount the image package and configure the local image source. For details, see Configuring the Local Yum Repository. ----End 1.4 Obtaining Source Code Step 1 Create a directory. mkdir /root/kernel cd /root/kernel Step 2 Download the kernel source code of CentOS 7.6. URL: kernel-alt-4.14.0-115.el7a.0.1.src.rpm wget http://vault.centos.org/centos/7.6.1810/os/Source/SPackages/kernel- alt-4.14.0-115.el7a.0.1.src.rpm Step 3 Decompress the source code package. rpm2cpio kernel-alt-4.14.0-115.el7a.0.1.src.rpm | cpio -div tar -vxf linux-4.14.0-115.el7a.tar.xz ----End Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 2 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) 1.5 Compiling and Installing Bcache Step 1 Copy the local config file to the source code path. cd /root/kernel/linux-4.14.0-115.el7a/ cp /boot/config-4.14.0-115.el7a.0.1.aarch64 .config Step 2 Compile the .config file and change the page size to 4 KB. 1. make menuconfig 2. Kernel Features > Page size (64KB) > Page size (4KB) Save# Set the page size to 4 KB. 3. Press Enter to go to the next page. 4. Press Enter to display Page size. Press the Up or Down arrow key to select 4KB, 16KB, or 64KB. In this step, select 4KB. Press Enter to exit. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 3 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) 5. Press the Left or Right arrow key to select Exit, and press Enter to exit. Step 3 Enable the Bcache module. 1. Turn to the outermost menu, choose Device Drivers > Multiple device driver support (RAID and LVM), and press Enter to access the lower-level menu. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 4 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) 2. Enter Y to select Block device as cache. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 5 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) Step 4 Set a user-defined kernel version. 1. In the outermost menu, choose General setup > Local version – append to kernel release. 2. Enter a user-defined kernel version, such as bcache_kernel. Step 5 Save the file with the original name. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 6 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) Step 6 Exit. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 7 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) Step 7 Delete the CONFIG_SYSTEM_TRUSTED_TRUSTED_KEYS configuration. 1. vi .config 2. Locate CONFIG_SYSTEM_TRUSTED_KEYS and change CONFIG_SYSTEM_TRUSTED_KEYS="certs/centos.pem" to CONFIG_SYSTEM_TRUSTED_KEYS="", as shown in the following example. CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" CONFIG_SYSTEM_TRUSTED_KEYRING=y CONFIG_SYSTEM_TRUSTED_KEYS="" # CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set # CONFIG_SECONDARY_TRUSTED_KEYRING is not set # CONFIG_SYSTEM_BLACKLIST_KEYRING is not set 3. Save the configuration and exit. Step 8 Open the .config file and check whether CONFIG_ARM64_4K_PAGES and CONFIG_BCACHE are set to y. Issue 03 (2021-03-23) Copyright © Huawei Technologies Co., Ltd. 8 Kunpeng BoostKit for SDS Porting Guides 1 Bcache Porting Guide (CentOS 7.6) Step 9 Generate RPM packages. make rpm Directories