[草稿]麒麟v10遇到的问题汇总
[TOC]
场景1:执行 reboot 重启报错
问题:
- 执行 reboot 重启报错如下:
reboot: symbol lookup error: /usr/lib/systemd/libsystemd-shared-243.so: undefined symbol: seccomp_api_get
解决:
yum -y install libseccomp
场景2:docker启动mysql5.7内存16G
问题:
- 2022.11.09.mysql5.7在麒麟OS(虚拟机)上刚启动的时候,执行
docker stats
看到cpu(持续100%)和内存(1-16g)抖动比较厉害(限制cpu和内存也没用,而在centos上则资源非常低),3分钟之后,内存使用量稳定在16g(cpu稳定在0.03%)
docker pull mysql:5.7
docker run -d --name=mysql -p 3306:3306 --cpus=8 -m 18g -e MYSQL_ROOT_PASSWORD=password mysql:5.7
docker stats mysql
解决:
- 推荐使用 mysql 8.0 吧
场景3:安装mysql提示Permission denied
问题:
- 2023.07.04.在麒麟v10 arm64平台上安装 mysql 5.7.27 初始化失败,报错 mysqld: Can't change dir to '/data/mysql_3306/var/' (Errcode: 13 - Permission denied)
[root@localhost opt]# uname -a
Linux rizhao-kylin-arm-0001 4.19.90-17.5.ky10.aarch64 #1 SMP Fri Aug 7 13:35:33 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
[root@localhost opt]# /opt/mysql/bin/mysqld --no-defaults --initialize --user=mysql --basedir=/opt/mysql/ --datadir=/data/mysql_3306/var
mysqld: Can't change dir to '/data/mysql_3306/var/' (Errcode: 13 - Permission denied)
2023-07-04T09:20:31.577440Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-07-04T09:20:31.583294Z 0 [ERROR] failed to set datadir to /data/mysql_3306/var/
2023-07-04T09:20:31.583312Z 0 [ERROR] Aborting
无效的尝试
- 执行
chown -R mysql:mysql /data/mysql_3306
依旧报错 - 执行
chmod -R 777 /data/mysql_3306/var
依旧报错
解决办法
- 虽然 datadir 配置的是
/data/mysql_3306/var
,但是需要将 datadir 的上级目录目录 /data 添加707权限,然后再 --initialize 初始化就好了,过程如下:
[root@localhost opt]# chmod -R 707 /data
[root@localhost opt]# /opt/mysql/bin/mysqld --no-defaults --initialize --user=mysql --basedir=/opt/mysql/ --datadir=/data/mysql_3306/var
2023-07-04T09:23:49.081945Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-07-04T09:23:49.191273Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-07-04T09:23:49.872098Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-07-04T09:23:49.880900Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 7c35ea6b-1a4c-11ee-a738-fa163e6a9f9b.
2023-07-04T09:23:49.882801Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-07-04T09:23:49.883182Z 1 [Note] A temporary password is generated for root@localhost: cicxDtf%V3d;
场景4:配置开机启动不生效
问题:
- 2023.11.06.在麒麟v10系统上通过
/etc/rc.local
配置了开机启动,但是重启不生效,同样的方法在centos系统上则ok
cat /etc/rc.local | grep minio || sudo bash -c "echo 'su app -c \"cd /home/app/minio_9000 && sh start.sh\"' >> /etc/rc.local"
解决办法:
- 经测试发现,centos系统
/etc/rc.local
与/etc/rc.d/rc.local
是软链过去的
[root@centos ~]# ll /etc/rc.local
lrwxrwxrwx 1 root root 13 Jul 9 2021 /etc/rc.local -> rc.d/rc.local
- 而 kylin系统
/etc/rc.local
与rc.d/rc.local
是2个独立的文件。那无论什么系统,统一写入/etc/rc.d/rc.local
吧
[root@kylin ~]# ll /etc/rc.d/rc.local
-rwxr-xr-x 1 root root 572 Nov 6 11:15 /etc/rc.d/rc.local
[root@kylin ~]# ll /etc/rc.local
-rwxr--r-- 1 root root 489 Nov 6 11:14 /etc/rc.local
场景5:启动redis报错
问题:
- 2023.11.07.在麒麟 aarch64 版本上启动redis,在
./log/redis.log
中看到如下错误(x86则ok)
21897:M 10 Nov 2023 10:58:32.787 # Server initialized
21897:M 10 Nov 2023 10:58:32.788 # WARNING Your kernel has a bug that could lead to data corruption during background save. Please upgrade to the latest stable kernel.
21897:M 10 Nov 2023 10:58:32.788 # Redis will now exit to prevent data corruption. Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG
解决办法:
- 在
redis.conf
中添加参数ignore-warnings ARM64-COW-BUG
并重启redis进程即可