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

报错内容如下:

[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. SpringBoot2.0源码分析(四):spring-data-jpa分析

    SpringBoot具体整合rabbitMQ可参考:SpringBoot2.0应用(四):SpringBoot2.0之spring-data-jpa JpaRepositories自动注入 当项目中存 ...

  2. vue-07-自定义指令

    1, 全局指令 在main.js中引入 // 注册一个全局自定义指令 `v-focus` Vue.directive('focus', { // 当被绑定的元素插入到 DOM 中时…… inserte ...

  3. Ubuntu 下 Galera cluster for MySQL 集群安装

    mysql galera cluster官网:http://galeracluster.com/documentation-webpages/ 相关安装教程:(不一定管用) http://blog.c ...

  4. Nginx下关于缓存控制字段cache-control的配置说明 - 运维小结

    HTTP协议的Cache -Control指定请求和响应遵循的缓存机制.在请求消息或响应消息中设置 Cache-Control并不会影响另一个消息处理过程中的缓存处理过程.请求时的缓存指令包括: no ...

  5. 计算n的阶乘有多少个尾随零

    思路一: 计算出n!= nValue,然后 nValue % 10 == 0 则nCount自增1,nValue /= 10 直到条件为否,最后nCount就是我们想要的结果,代码如下: int Co ...

  6. mysql服务器架构

    mysql是最广泛使用的开源数据库之一,作为后端开发人员,或多或少都会和mysql打交道,本篇文章会从sql查询语句的执行过程,来介绍mysql的服务器架构, 查询的过程大致分为从客户端到服务器,在服 ...

  7. linux平均负载的理解及原因排查

    当系统响应缓慢时,一般会用top或uptime命令查看系统负载是否过高. 例如输入uptime命令显示如下图,其中23:47:19表示现在的时间,up 260 days,14:39表示系统运行了多久, ...

  8. Python系列:二、数据类型--技术流ken

    标准数据类型 Python3 中有六个标准的数据类型: Number(数字) String(字符串) List(列表) Tuple(元组) Set(集合) Dictionary(字典) Python3 ...

  9. Django 系列博客(一)

    Django 系列博客(一) 前言 学习了 python 这么久,终于到了Django 框架.这可以说是 python 名气最大的web 框架了,那么从今天开始会开始从 Django框架的安装到使用一 ...

  10. TensorFlow(2)Softmax Regression

    Softmax Regression Chapter Basics generate random Tensors Three usual activation function in Neural ...