dnf install mysql-server报错:Error: GPG check FAILED

Amazon Linux 2023(AL2023)系统下安装mysql-server 8 的时候遭遇下面的错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 安装 EL9 mysql80-community 软件存储库
~]# dnf -y localinstall https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
...
Installed:
mysql80-community-release-el9-1.noarch

Complete!
~]# dnf install -y mysql-server mysql
MySQL 8.0 Community Server
...
Key imported successfully
Import of key(s) didn't help, wrong key(s)?
Public key for mysql-community-client-8.0.37-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-client-8.0.37-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-client-plugins-8.0.37-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-client-plugins-8.0.37-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-common-8.0.37-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-common-8.0.37-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-icu-data-files-8.0.37-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-icu-data-files-8.0.37-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-libs-8.0.37-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-libs-8.0.37-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-server-8.0.37-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-server-8.0.37-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

用以下命令导入2023年最新的Key即可解决问题。

1
~]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023

yum update -y报错:The GPG keys listed for the MySQL 5.7 Community Server repository are already installed but they are not correct for this package.

yum update -y升级系统时遭遇下面的错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
~]# yum update -y
...
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.44-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Public key for mysql-community-common-5.7.44-1.el7.x86_64.rpm is not installed
...

Total 12 MB/s | 550 MB 00:00:45
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.


Failing package is: mysql-community-client-5.7.44-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

MySQL8以后包签名所用的Key发生了变化,用以下命令导入新的Key即可解决问题。

1
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

ZabbixServer Docker模式运行无法链接数据库:MySQL server is not available. Waiting 5 seconds...

Docker下运行zabbix-server-mysql,不断提示MySQL server is not available. Waiting 5 seconds…无法连接数据库。
通过配置Docker环境变量DEBUG_MODE=true,可以查看详细原因。

1
2
3
4
5
docker run --name zabbix-server-mysql -t \\
-e DB_SERVER_HOST="192.168.1.10" -e MYSQL_DATABASE="zabbix" \\
-e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="password" \\
-e DEBUG_MODE="true" --link mysql-server:mysql \\
-p 10051:10051 --restart unless-stopped -d zabbix/zabbix-server-mysql

执行SSH/SCP命令报错:sign_and_send_pubkey: no mutual signature supported

从AlmaLinux9系统通过SCP命令拉取CentOS7系统的文件时报错。

1
2
3
4
5
6
7
8
~]#scp -i mypk user@192.168.1.10:/home/user/abc.txt ./
Enter passphrase for key 'mypk':
sign_and_send_pubkey: no mutual signature supported
user@192.168.1.10: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Connection closed

# CentOS一侧错误如下
error: Could not load host key: /etc/ssh/ssh_host_ed25519_key

查询资料分析得知:从AlmaLinux9/RockyLinux9/RHEL9开始,默认限制了SHA1算法的使用范围。
而CentOS7的OpenSSH所采用的的ssh-rsa公钥签名算法依赖于SHA1,所以导致了默认无法建立SSH连接。
比较快的解决方法如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 在 AlmaLinux9/RockyLinux9/RHEL9 上临时启用SHA1
~]# update-crypto-policies --set DEFAULT:SHA1
Setting system policy to DEFAULT:SHA1
Note: System-wide crypto policies are applied on application start-up.
It is recommended to restart the system for the change of policies
to fully take place.

# SCP顺利连接
~]#scp -i mypk user@192.168.1.10:/home/user/abc.txt ./
Enter passphrase for key 'mypk':
abc.txt 100% 15KB 18.4MB/s 00:00

# 恢复 AlmaLinux9/RockyLinux9/RHEL9 上的默认设置,保证安全性
~]#update-crypto-policies --set DEFAULT
Setting system policy to DEFAULT
Note: System-wide crypto policies are applied on application start-up.
It is recommended to restart the system for the change of policies
to fully take place.

Linux触发OOM Killer导致Mongo进程终了[signalProcessingThread] got signal 15 (Terminated)

有一台自带MongoDB实例的Linux机器,服务经常中断。
排查MongoDB日志后发现下面的内容。

1
[signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends

got signal 15 (Terminated)意味着有进程对MongoDB发送了kill命令,导致服务中断。
后面查询系统日志发现 OOM Killer 的相关日志。
OOM(Out-Of-Memory) Killer在内存不足的情况,会自动杀死进程,确保系统运行的内存。
内存不足时的具体动作由以下参数控制。

1
2
3
4
vm.panic_on_oom
vm.panic_on_oom=0: (默认值)触发OOM Killer杀死进程
vm.panic_on_oom=1: 系统还有可用内存的情况下,触发OOM Killer,否则触发Linux系统的panic状态
vm.panic_on_oom=2: 直接触发Linux系统的panic状态

浏览器访问ES断开报错:http client did not trust this server's certificate.

启动ElasticSearch服务后,浏览器访问https://localhost:9200报错,无返回结果

原因分析:自从8开始,默认开启 SSL 加密通信。但是服务器用的自签名证书,导致错误。
如果是本地测试用的环境,建议把启用xpack的安全功能的开关关闭,通过http://localhost:9200访问。

1
2
3
4
5
6
7
8
9
10
vi elasticsearch.yml
xpack.security.enabled: false
...
xpack.security.enrollment.enabled: false
...
xpack.security.http.ssl:
enabled: false
...
xpack.security.transport.ssl:
enabled: false

OpenAI嵌入报错:OpenAI Failed to embed: [failed_to_embed]: 400 This model's maximum context length is 8192 tokens

** 现象
使用OpenAI的嵌入模型text-embedding-3-large处理文件时出错:
OpenAI Failed to embed: [failed_to_embed]: 400 This model’s maximum context length is 8192 tokens

** 原因分析
AnythingLLM 的Text Chunk Size默认是8192,处理完后的文本大小超过了OpenAI嵌入模型的最大token数,导致调用失败。
至于是否启用了滑动窗口导致的过大,暂时还不明确。

** 解决方法
进入设置界面 > 文本分割 调整“文本块大小”(Text Chunk Size) 参数: 比如使用8000

*** 设置建议:
长文本(如小说等):​建议将“文本块大小”设置为一个章节的长度,以保持上下文的完整性。​例如,可以将块大小设置为 2000,重叠量设置为 200。​
短文本(如技术文档):​可以选择较小的块大小,例如 1024 或 2048,以提高处理效率。​
需要注意的是,文本块大小的选择应根据具体应用场景和文本长度进行调整,以在保留上下文和处理效率之间找到平衡。