首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Postgres autovacuum由于配置错误而无法启动

Postgres autovacuum由于配置错误而无法启动
EN

Stack Overflow用户
提问于 2013-07-09 02:16:21
回答 2查看 3K关注 0票数 1

我正在尝试在Postgres 9.1实例上重新启用自动清理,并在数据库日志中收到以下信息:

代码语言:javascript
复制
2013-07-07 14:47:12 CDT WARNING:  autovacuum not started because of misconfiguration
2013-07-07 14:47:12 CDT HINT:  Enable the "track_counts" option.

看起来很简单。除了下面的(相关片段)我的postgresql.conf文件:

代码语言:javascript
复制
...

#track_activities = on
track_counts = on
#track_functions = none         # none, pl, all
#track_activity_query_size = 1024   # (change requires restart)
#update_process_title = on
#stats_temp_directory = 'pg_stat_tmp'

...

autovacuum = on     # Enable autovacuum subprocess?  'on' 
                    # requires track_counts to also be on.
#log_autovacuum_min_duration = -1   # -1 disables, 0 logs all actions and
                    # their durations, > 0 logs only
                    # actions running at least this number
                    # of milliseconds.
autovacuum_max_workers = 5     # max number of autovacuum subprocesses
                    # (change requires restart)
#autovacuum_naptime = 1min      # time between autovacuum runs
#autovacuum_vacuum_threshold = 50   # min number of row updates before
                    # vacuum
#autovacuum_analyze_threshold = 50  # min number of row updates before
                    # analyze
#autovacuum_vacuum_scale_factor = 0.2   # fraction of table size before vacuum
#autovacuum_analyze_scale_factor = 0.1  # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000  # maximum XID age before forced vacuum
                    # (change requires restart)
#autovacuum_vacuum_cost_delay = 20ms    # default vacuum cost delay for
                    # autovacuum, in milliseconds;
                    # -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1  # default vacuum cost limit for
                    # autovacuum, -1 means use
                    # vacuum_cost_limit

以下是psql在重启后报告的内容:

代码语言:javascript
复制
mydb=# show autovacuum;
 autovacuum 
------------
 on
(1 row)

mydb=# show track_counts;
 track_counts 
--------------
 off
(1 row)

非常感谢任何有见地的人!

EN

回答 2

Stack Overflow用户

发布于 2013-07-09 02:18:55

您是否在进行更改后重新加载了postgresql.conf文件?例如,作为超级用户("postgres")

代码语言:javascript
复制
select pg_reload_conf();
票数 1
EN

Stack Overflow用户

发布于 2014-11-27 00:53:33

仔细检查日志。在您列出的行之前,您是否获得了以下行:

代码语言:javascript
复制
LOG:  could not bind socket for statistics collector: Cannot assign requested address
LOG:  disabling statistics collector for lack of working socket

如果是这样的话,先解决这个问题。要解决这个问题,您最有可能需要做的就是向/etc/hosts文件中添加一个类似以下内容的条目:

127.0.0.1本地主机

很可能的情况是,该文件当前将本地主机分配给IPv6,并使用类似于下面的行:

::1 localhost ipv6-localhost ipv6-loopback

如果是这种情况,您还需要将该行更改为:

::1 IPv6-本地主机IPv6-环回

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17533333

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档