The test_io_device command allows you to check whether the I/O operations and privileges supported by the backup medium meet the backup and restore requirements.
Note
This topic applies to OceanBase Database V4.2.1_BP10_HF1 and later in the V4.2.1 series, V4.2.5_BP1 in the V4.2.5 series, and later versions. For other versions, see test_io_device.
Prerequisites
Before you run the command, make sure that you can access the target endpoint by using tools such as ossutil or aws-cli.
Introduction
The syntax is as follows:
./ob_admin test_io_device -d'<file_path>' -s'<verify_info>'
-d specifies the simulated backup path, which must be an empty directory. -s specifies the authentication information of object storage. For object storage, both -d and -s are required. For Network File System (NFS) storage, only -d is required.
Examples
Here are some examples of using the test_io_device command:
Example 1: Specify only the -d parameter
./ob_admin test_io_device -d'file:///data/nfs'
The following sample output is returned. If the test is successful, the module name, OK, and the running time are returned.
[NOTICE] If specific log is required, you need to set the environment variable OB_ADMIN_LOG_DIR.
for example: export OB_ADMIN_LOG_DIR=~/.ob_admin_log
please notice that log files should not be outputted to OceanBase's clog directory.
succ to open, filename=/dev/null, fd=5, wf_fd=2
succ to open, filename=/dev/null, fd=6, wf_fd=2
[RUN TEST1] Backup dest connectivity
[ OK] Backup dest connectivity (485 ms)
[RUN TEST2] archive log
[ OK] archive log (8638 ms)
[RUN TEST3] backup data
[ OK] backup data (1093 ms)
[RUN TEST4] consume clog file
[ OK] consume clog file (1242 ms)
[RUN TEST5] clean backup file
[ OK] clean backup file (169 ms)
[RUN TEST6] test_object_storage_interface
[ OK] test_object_storage_interface (10903 ms)
[RUN TEST7] test_list_before_complete_multipart_write
[ OK] test_list_before_complete_multipart_write (2077 ms)
Notice that the sample output contains a [NOTICE] message, which indicates that you can set the OB_ADMIN_LOG_DIR environment variable to view the logs. If you do not set this environment variable, the ob_admin logs will be output to /dev/null. The sample output in the following examples does not contain this message.
Example 2: Specify both the -d and -s parameters
./ob_admin test_io_device -d'oss://home/admin/backup_info' -s'host=http://oss-cn-hangzhou.aliyuncs.com&access_id=111&access_key=222'
The following sample output is returned. If the test is successful, the module name, OK, and the running time are returned.
[RUN TEST1] Backup dest connectivity
[ OK] Backup dest connectivity (485 ms)
[RUN TEST2] archive log
[ OK] archive log (8638 ms)
[RUN TEST3] backup data
[ OK] backup data (1093 ms)
[RUN TEST4] consume clog file
[ OK] consume clog file (1242 ms)
[RUN TEST5] clean backup file
[ OK] clean backup file (169 ms)
[RUN TEST6] test_object_storage_interface
[ OK] test_object_storage_interface (10903 ms)
[RUN TEST7] test_list_before_complete_multipart_write
[ OK] test_list_before_complete_multipart_write (2077 ms)
If the test fails, the error message, error code, and error code name are returned.
Insufficient path access permissions
[RUN TEST1] Backup dest connectivity ERROR INFO: The path is inaccessible, please check the path and the storage info parameter ERROR CODE: -9071 OB_BACKUP_PERMISSION_DENIED [ FAILED! ] Backup dest connectivity (62 ms)Incorrect path
[RUN TEST1] Backup dest connectivity ERROR INFO: The path is inaccessible, please check the path and the storage info parameter ERROR CODE: -9118 OB_INVALID_OBJECT_STORAGE_ENDPOINT [ FAILED! ] Backup dest connectivity (50 ms)
Example 3: Specify the checksum verification method
When object storage is used as the target endpoint, you can use the -s parameter to specify the checksum_type verification method. The sample command is as follows:
Specify MD5 as the verification method
./ob_admin test_io_device \ -d 'oss://oss-bucket/your/test/dir' \ -s 'host=xxx&access_id=xxx&access_key=xxx&checksum_type=md5'Do not specify any verification method
./ob_admin test_io_device \ -d 'oss://oss-bucket/your/test/dir' \ -s 'host=xxx&access_id=xxx&access_key=xxx&checksum_type=no_checksum'