benchmark装载数据报错ERROR: Protocol error. Session setup failed

文章描述了一名用户在使用benchmark装载数据时遇到Protocolerror.Sessionsetupfailed错误,经分析发现是由于使用的openGauss驱动与PG15数据库不兼容导致。通过替换驱动并重新编译解决了问题。
摘要由CSDN通过智能技术生成

benchmark装载数据报错ERROR: Protocol error. Session setup failed

问题现象

在使用benchmark装载数据时,启动执行命令时报如下错误ERROR: Protocol error. Session setup failed.

[root@wang run]# ./runDatabaseBuild.sh props.pg
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableCreates.sql
# ------------------------------------------------------------
Apr 23, 2024 3:57:37 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
INFO: [b8377b71-ba17-477f-97b2-a729fdea90f5] Try to connect. IP: 192.168.181.90:5432
Protocol error.  Session setup failed.
Starting BenchmarkSQL LoadData

driver=org.postgresql.Driver
conn=jdbc:postgresql://192.168.181.90:5432/testdb
user=test
password=***********
warehouses=1
loadWorkers=4
fileLocation (not defined)
csvNullValue (not defined - using default 'NULL')

Apr 23, 2024 3:57:37 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
INFO: [cf04f8ab-f727-4ae2-92ac-a337a4537340] Try to connect. IP: 192.168.181.90:5432
ERROR: Protocol error.  Session setup failed.
# ------------------------------------------------------------
# Loading SQL file ./sql.common/indexCreates.sql
# ------------------------------------------------------------
Apr 23, 2024 3:57:37 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
INFO: [8e79b276-e832-43a2-b189-83683732fab8] Try to connect. IP: 192.168.181.90:5432
Protocol error.  Session setup failed.
# ------------------------------------------------------------
# Loading SQL file ./sql.common/foreignKeys.sql
# ------------------------------------------------------------
Apr 23, 2024 3:57:37 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
INFO: [033cc430-a2d9-4891-95b5-5ae8eb7c5337] Try to connect. IP: 192.168.181.90:5432
Protocol error.  Session setup failed.
# ------------------------------------------------------------
# Loading SQL file ./sql.postgres/extraHistID.sql
# ------------------------------------------------------------
Apr 23, 2024 3:57:38 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
INFO: [31b5b3bd-a8f2-4f80-936d-d10254cb0c45] Try to connect. IP: 192.168.181.90:5432
Protocol error.  Session setup failed.
# ------------------------------------------------------------
# Loading SQL file ./sql.postgres/buildFinish.sql
# ------------------------------------------------------------
Apr 23, 2024 3:57:38 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
INFO: [e649c2fe-d196-48f0-9810-eed6f2f9d26a] Try to connect. IP: 192.168.181.90:5432
Protocol error.  Session setup failed.

问题定位与分析

根据报错信息中的关键信息 Protocol error及tableCreates.sql未执行成功,判断可能是benchmark与PG数据库建立连接的时候出问题了。由于是Protocol error,因此排查方向基本就是驱动包及benchmark的问题。这个时候就想到了,目前使用PG的驱动和benchmark编译代码是之前测试openGauss的时候编译的代码,自己潜意识的认为是可以兼容使用的。那么我就先尝试替换驱动,重新编译。

问题处理

在下载最新的pg15对应的驱动后,替换旧的驱动并重新编译benchmark,再次执行runDatabaseBuild.sh脚本,成功建立连接。

问题总结

这个问题其实挺简单,造成最主要的原因还是自己对于PG数据库和openGauss数据库兼容性认知有问题,由于openGauss是基于pg9.2开发驱动版本比较低,但是使用低版本编译的benchmark连接高版本PG15数据库,导致无法连接到数据库。

  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

墨竹~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值