某日开发反馈测试环境的集群启动失败

报错内容如下:

[gpadmin@hadoop-test2:/root]
$ gpstart
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Starting gpstart with args:
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Gathering information and validating the environment...
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 5.0.0 build dev'
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Greenplum Catalog Version: ''
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Starting Master instance in admin mode
:::: gpstart:hadoop-test2:gpadmin-[CRITICAL]:-Failed to start Master instance in admin mode
:::: gpstart:hadoop-test2:gpadmin-[CRITICAL]:-Error occurred: non-zero rc:
Command was: 'env GPSESSID=0000000000 GPERA=None $GPHOME/bin/pg_ctl -D /home/gpadmin/gpdata/gpmaster/gpseg-1 -l /home/gpadmin/gpdata/gpmaster/gpseg-1/pg_log/startup.log
-w -t 600 -o " -p 2346 --gp_dbid=1 --gp_num_contents_in_cluster=0 --silent-mode=true -i -M master --gp_contentid=-1 -x 0 -c gp_role=utility " start'
rc=, stdout='waiting for server to start...................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
.................................................................................................................................. stopped waiting
', stderr='could not change directory to "/root"
pg_ctl: could not start server
Examine the log output.

查看启动日志发现:

vim /home/gpadmin/gpdata/gpmaster/gpseg-1/pg_log/startup.log
-- ::24.067241 GMT,,,p5464,th-,,,,,,,seg-,,,,,"WARNING","","""work_mem"": setting is deprecated, and may be removed in a future release.",,,,,,,,"set_config_option","guc.c",,
-- ::24.067612 GMT,,,p5464,th-,,,,,,,seg-,,,,,"WARNING","","""work_mem"": setting is deprecated, and may be removed in a future release.",,,,,,,,"set_config_option","guc.c",,
-- ::24.083813 GMT,,,p5465,th-,,,,,,,seg-,,,,,"LOG","","removing all temporary files",,,,,,,,"RemovePgTempFiles","fd.c",,
-- ::24.098673 GMT,,,p5465,th-,,,,,,,seg-,,,,,"FATAL","XX000","could not create shared memory segment: Invalid argument (pg_shmem.c:183)","Failed system call was shmget(key=2346001, size=177586016, 03600).","This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 177586016 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4000) and/or its max_connections parameter (currently 253).
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.",,,,,,"InternalIpcMemoryCreate","pg_shmem.c",183,1

内容大概是说/etc/sysctl.conf设置的内核参数shmmax过小,导致启动失败

查看/etc/sysctl.conf下的配置发现:

kernel.shmmax =
kernel.shmmni =
kernel.shmall =
kernel.sem =
kernel.sysrq =
kernel.core_uses_pid =
kernel.msgmnb =
kernel.msgmax =
kernel.msgmni =
net.ipv4.tcp_syncookies =
net.ipv4.ip_forward =
net.ipv4.conf.default.accept_source_route =
net.ipv4.tcp_tw_recycle =
net.ipv4.tcp_max_syn_backlog =
net.ipv4.conf.all.arp_filter =
net.ipv4.ip_local_port_range =
net.core.netdev_max_backlog =
net.core.rmem_max =
net.core.wmem_max =
vm.overcommit_memory =

对比官网建议的设置和参数定义以及集群已有的数据量,发现确实过小。于是改成官网建议的设置后启动。

:::: gpstart:hadoop-test2:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:hadoop-test2:gpadmin-[INFO]:- Successful segment starts =
:::: gpstart:hadoop-test2:gpadmin-[INFO]:- Failed segment starts =
:::: gpstart:hadoop-test2:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) =
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Successfully started of segment instances
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Starting Master instance hadoop-test2 directory /home/gpadmin/gpdata/gpmaster/gpseg-
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Command pg_ctl reports Master hadoop-test2 instance active
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-No standby master configured. skipping...
:::: gpstart:hadoop-test2:gpadmin-[INFO]:-Database successfully started

启动成功。

总结:pg启动相关的内核参数配置与实际情况不匹配时,会导致启动失败。可通过查看日志详细信息查找根源解决问题。

参考文档:

1、官网建议设置 http://gpdb.docs.pivotal.io/4380/prep_os-system-params.html#topic3

2、内核参数含义http://www.oicqzone.com/pc/2012091612901.html

Greenplum启动失败Error occurred: non-zero rc: 1的修复的更多相关文章

  1. MyCat启动失败 Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: rebirth.a: rebirth.a: unknown error

    在使用Nactive连接MyCat的时候发现怎么连接都不ok,明明已经启动了(实际上启动失败了)! 粗心的我,后来看了下日志,果然,启动失败了 Error: Exception thrown by t ...

  2. supervisord 启动失败 Error: Another program is already listening on a port that one of our HTTP serve...

    Linux系统中 Supervisor 配置守护进程: 启动Supervisor 服务语句: supervisord -c /etc/supervisor/supervisord.conf 这个过程可 ...

  3. jboss服务启动失败报:Error occurred during initialization of VM

    今天下午突然间公司的GTV管理平台上不去了 访问确实,提示找不到页面 登录终端查看服务进程. ps -ef | grep jboss 发现没有这个进程.怎么办,启动被. 输入nohup /home/c ...

  4. Eclipse启动时发生An internal error occurred during: "Initializing Java Tooling".错误的解决方法

    问题描述: Eclipse启动时发生An internal error occurred during: "Initializing JavaTooling".错误的解决方法 解决 ...

  5. Eclipse无法启动报An internal error occurred during: "reload maven project". java.lang.NullPointerException

    由于没有正常关机导致eclipse无法将数据正常写入配置文件导致无法启动.报这样一个异常 An internal error occurred during: "reload maven p ...

  6. MyEclipse for Spring启动时报错"An internal error occurred during: 'Updating indexes'.Java heap space"的解决办法

    问题 MyEclipse for Spring在启动时,报如下错误:An internal error occurred during: 'Updating indexes'.Java heap sp ...

  7. Discuz云平台站点信息同步失败,An unknown error occurred. May be DNS Error.

    站点信息同步失败 An unknown error occurred. May be DNS Error. (ERRCODE:1) 经过Discuz教程网(http://www.1314study.c ...

  8. 启动Eclipse发生错误:An internal error occurred during: "Initializing Java Tooling".

    问题描述   由于上一次关闭 Eclipse 时没有正常关闭,再次启动 Eclipse 时报错:An internal error occurred during: "Initializin ...

  9. Eclipse启动报错An internal error occurred during: "Initializing Java Tooling"

    Eclipse启动报错An internal error occurred during: "Initializing Java Tooling" 解决方案: 删除工作空间work ...

随机推荐

  1. 在linux上安装svn

    1. 安装svn 输入命令:yum -y install subversion 检查是否安装成功: 输入命令:svn –version 2. 创建代码仓库 输入命令:mkdir -p /usr/loc ...

  2. DateTimeHelper

    本文参考文章: http://geekswithblogs.net/mnf/articles/my-datetimehelper-class.aspx https://referencesource. ...

  3. JAVA课程设计——一个简单的教务人事管理系统

    大三上学期期末总结,没错,上学期,写在下学期新学期开始,哈哈哈. 上学期学习了面向对象程序设计,课程设计的题目使用JAVA语言完成一个简单的教务人事管理系统,能够实现访问数据库的登录验证,分别按部门和 ...

  4. python工程遇到的错误

    1.SyntaxError: Non-ASCII character '\xe5' in file D:\eclipseworkspace\test\test_urllib2.py on line2 ...

  5. MyBatis学习总结(三)——多表关联查询与动态SQL

    在上一章中我们学习了<MyBatis学习总结(二)——MyBatis核心配置文件与输入输出映射>,这一章主要是介绍一对一关联查询.一对多关联查询与动态SQL等内容. 一.多表关联查询 表与 ...

  6. VS2013 OpenGL 开发程序时: error LNK2019: 无法解析的外部符号 __imp____glutInitWithExit@12,error LNK2019: 无法解析的外部符号 __imp____glutCreateWindowWithExit@8

    环境:Windows 下 OpenGL ,Used in VS2013 前言:刚接触 OpenGL 的人,第一件事当然就是配置环境,说起配置环境 OpenGL 和 DirectX 相差不多,同时也基本 ...

  7. 介绍一款文档神器:pandoc

    http://pandoc.org/ 因为工作需要,将一批markdown的文档转换成word文档,找来找去,这个pandoc真是神器 啊,推荐给大家 If you need to convert f ...

  8. PHP定界符eof 的使用

    PHP是一个Web编程语言,在编程过程中难免会遇到用echo来输出大段的html和javascript脚本的情况,如果用传统的输出方法 ——按字符串输出的话, 肯定要有大量的转义符来对字符串中的引号等 ...

  9. 8. 同步锁Lock

    package com.gf.demo07; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Ree ...

  10. python网络聊天器多线程版

    在之前的一篇文章(python网络编程-udp)中实现了一个简单的udp聊天器,只能在单线程下进行收发数据,在学习完多线程之后,实现一个能同时收发数据的udp聊天器. 说明: 编写一个有2个线程的程序 ...