问题
- 扩容报错:
[root@xxx script]# ./gs_expansion -U omm -G dbgrp -X /database/panweidb/soft/cluster_config_expansion.xml -h xxx
Start expansion with cluster manager component.
Traceback (most recent call last):
File "/database/panweidb/soft/PanWeiDB/script/gs_expansion", line 591, in <module>
expansion.expand_run()
File "/database/panweidb/soft/PanWeiDB/script/gs_expansion", line 424, in expand_run
expand_impl.run()
File "/database/panweidb/soft/PanWeiDB/script/impl/expansion/expansion_impl_with_cm.py", line 552, in run
self.expansion_check()
File "/database/panweidb/soft/PanWeiDB/script/impl/expansion/expansion_impl_with_cm.py", line 451, in expansion_check
self.checkClusterStatus()
File "/database/panweidb/soft/PanWeiDB/script/impl/expansion/ExpansionImpl.py", line 1463, in checkClusterStatus
self.walKeepSegments = int(currentWalKeepSegments)
ValueError: invalid literal for int() with base 10: "'128'"
分析
首先分析 Traceback 信息:
- 先看最后一行,错误名称为 ValueError,错误内容为
invalid literal for int() with base 10: "'128'"
说的是进行类型转换的 int() 函数,接收到了错误的参数 ‘128’;
- 从下往上看,最后执行的代码是
self.walKeepSegments = int(currentWalKeepSegments)
说明获取到的 currentWalKeepSegments 是 ‘128’;
- 查看 postgresql.conf 中的该参数,有多余引号:
[omm@xxx ~]$ cat $PGDATA/postgresql.conf | grep wal_keep_segments
wal_keep_segments = '128' # in logfile segments, 16MB each normal, 1GB each in share storage mode; 0 disables
解决
修改该参数,去掉引号,reload 后生效。
其他
- 也可以继续往上看 Traceback,出错时,程序应该是处于扩容时的检查阶段,正在检查集群状态。
参考
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




