ITPub博客

首页 > 数据库 > > 操作系统预配置-设置corefile配置

操作系统预配置-设置corefile配置

作者:GaussDB_数据库 时间:2020-01-07 09:32:12 0 删除 编辑

corefile配置主要用于在数据库异常退出时生成core文件,便于定位数据库问题。

  1. 以root用户登录各服务器。
  2. 指定corefile文件大小的最大值。

    在配置文件/etc/profile中添加如下内容。推荐配置为unlimited,表示不限制生成core文件的大小。

    ulimit -c unlimited

  1. 指定corefile生成路径和corefile文件格式。

    在/etc/sysctl.conf中添加如下内容:

    kernel.core_pattern = /corefile/core.%p.%e

    其中/corefile目录为用户创建的core文件生成的路径,数据库运行用户需要对该目录有读写权限。core.%p.%e为文件生成的格式,可支持的配置格式如下:

    • %p:表示进程ID。
    • %e:表示执行文件的名称。

  1. 执行source /etc/profile和sysctl -p生效参数。
    source /etc/profile
    sysctl -p

  1. (可选)检查配置参数是否生效。
    ulimit -c
    unlimited
    sysctl -a | grep core_pattern
    kernel.core_pattern = /corefile/core.%p.%e

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3171192/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-01-06

  • 博文量
    2907
  • 访问量
    19180