CDH postgreSQL启动报错DB initialization done. waiting for server to start.............. cloud not start
来源:互联网 发布:阿里云 代金券怎么用 编辑:程序博客网 时间:2024/05/02 06:46
CDH启动postgreSQL时无法正常启动 (事后问了专家,因为我kill -9 关闭postgreSQL造成的,以后还是正常关闭不要kill)
[root@server share]# service cloudera-scm-server-db start
pg_ctl: no server running
DB initialization done.
waiting for server to start............................... cloud not start
查看日志/var/lib/cloudera-scm-server-db/data/pg_log/postgresql-Fri.log
错误日志说明已经很清楚了:
2016-05-10 18:00:38 LOG: database system was shut down at 2016-05-07 21:08:48 中国标准时间
2016-05-10 18:00:38 LOG: record with zero length at 0/1A5D5AE8
2016-05-10 18:00:38 LOG: invalid primary checkpoint record
2016-05-10 18:00:38 LOG: record with zero length at 0/1A5D5A98
2016-05-10 18:00:38 LOG: invalid secondary checkpoint record
2016-05-10 18:00:38 PANIC: could not locate a valid checkpoint record
这说明WAL日志文件里边有不一致的记录,所以需要使用pg_resetxlog进行重置。
解决方法回归日志:
pg_resetxlog -f /var/lib/cloudera-scm-server-db/data
启动数据库
service cloudera-scm-server-db start
[root@ambariserver share]# service cloudera-scm-server-db restart
pg_ctl: no server running
DB initialization done.
waiting for server to start.... done
server started
关闭数据库
pg_ctl -D data -m f stop
帮助
psql --help
修改文件,不用使用密码即可登录:
/var/lib/cloudera-scm-server-db/data/pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Accept connections from all hosts
host amon amon 0.0.0.0/0 md5
host rman rman 0.0.0.0/0 md5
host nav nav 0.0.0.0/0 md5
host navms navms 0.0.0.0/0 md5
# block remote access for admin user and scm
host all cloudera-scm,scm 0.0.0.0/0 reject
# enable remote access for other users
host sameuser all 0.0.0.0/0 md5
修改(根据自己的需要进行修改)
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Accept connections from all hosts
host amon amon 0.0.0.0/0 md5
host rman rman 0.0.0.0/0 md5
host nav nav 0.0.0.0/0 md5
host navms navms 0.0.0.0/0 md5
# block remote access for admin user and scm
host all cloudera-scm,scm 0.0.0.0/0 trust
# enable remote access for other users
host sameuser all 0.0.0.0/0 md5
登录数据库
su - postgres
psql -p 7432
报错:
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql -U cloudera-scm -p 7432 -d postgres
或者
su - cloudera-scm (默认此用户无法登录)
psql -d postgres -p 7432
其他启动命令:
su - postgres -c "/usr/bin/pg_ctl start -l logfile -D /var/lib/cloudera-scm-server-db/data"
postgres -D /var/lib/cloudera-scm-server-db/data >logfile 2>&1 &
/usr/bin/pg_ctl -D /var/lib/cloudera-scm-server-db/data -l logfile start
[root@server share]# service cloudera-scm-server-db start
pg_ctl: no server running
DB initialization done.
waiting for server to start............................... cloud not start
查看日志/var/lib/cloudera-scm-server-db/data/pg_log/postgresql-Fri.log
错误日志说明已经很清楚了:
2016-05-10 18:00:38 LOG: database system was shut down at 2016-05-07 21:08:48 中国标准时间
2016-05-10 18:00:38 LOG: record with zero length at 0/1A5D5AE8
2016-05-10 18:00:38 LOG: invalid primary checkpoint record
2016-05-10 18:00:38 LOG: record with zero length at 0/1A5D5A98
2016-05-10 18:00:38 LOG: invalid secondary checkpoint record
2016-05-10 18:00:38 PANIC: could not locate a valid checkpoint record
这说明WAL日志文件里边有不一致的记录,所以需要使用pg_resetxlog进行重置。
解决方法回归日志:
pg_resetxlog -f /var/lib/cloudera-scm-server-db/data
启动数据库
service cloudera-scm-server-db start
[root@ambariserver share]# service cloudera-scm-server-db restart
pg_ctl: no server running
DB initialization done.
waiting for server to start.... done
server started
关闭数据库
pg_ctl -D data -m f stop
帮助
psql --help
修改文件,不用使用密码即可登录:
/var/lib/cloudera-scm-server-db/data/pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Accept connections from all hosts
host amon amon 0.0.0.0/0 md5
host rman rman 0.0.0.0/0 md5
host nav nav 0.0.0.0/0 md5
host navms navms 0.0.0.0/0 md5
# block remote access for admin user and scm
host all cloudera-scm,scm 0.0.0.0/0 reject
# enable remote access for other users
host sameuser all 0.0.0.0/0 md5
修改(根据自己的需要进行修改)
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Accept connections from all hosts
host amon amon 0.0.0.0/0 md5
host rman rman 0.0.0.0/0 md5
host nav nav 0.0.0.0/0 md5
host navms navms 0.0.0.0/0 md5
# block remote access for admin user and scm
host all cloudera-scm,scm 0.0.0.0/0 trust
# enable remote access for other users
host sameuser all 0.0.0.0/0 md5
登录数据库
su - postgres
psql -p 7432
报错:
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
发现CDH使用7432端口
再次进入数据库 加上端口
psql -U cloudera-scm -p 7432 -d postgres
或者
su - cloudera-scm (默认此用户无法登录)
psql -d postgres -p 7432
其他启动命令:
su - postgres -c "/usr/bin/pg_ctl start -l logfile -D /var/lib/cloudera-scm-server-db/data"
postgres -D /var/lib/cloudera-scm-server-db/data >logfile 2>&1 &
/usr/bin/pg_ctl -D /var/lib/cloudera-scm-server-db/data -l logfile start
0 0
- CDH postgreSQL启动报错DB initialization done. waiting for server to start.............. cloud not start
- Timeout waiting for JBOSS 4.2 to start. Server did not start after 50s
- Timeout waiting for JBOSS 4.2 to start. Server did not start after 50s: 50秒超时后,JBOSS 4.2仍不能启动。
- Timeout waiting for Tomcat v6.0 Server did not start
- Openfire for mac 启动报错:Could not start the Openfire server
- Oracle RAC root.sh 报错 Timed out waiting for the CRS stack to start 解决方法
- Oracle RAC root.sh 报错 Timed out waiting for the CRS stack to start 解决方法
- Oracle RAC 第二节点 root.sh 报错 Timed out waiting for the CRS stack to start
- Oracle RAC root.sh 报错 Timed out waiting for the CRS stack to start 解决方法—--范例篇
- Java--启动Tomcat报错:Server Tomcat v7.0 Server at localhost failed to start.
- 启动apache服务器报错:httpd not running, trying to start和Segmentation fault: 11 $HTTPD "$@"
- Unable To Start Admin Server with Error BEA-000386 (weblogic服务启动报错)
- DHCP request error:Timed out waiting for dhcpcd to start
- Streams AQ: qmn coordinator waiting for slave to start
- mysqld无法启动,报错:can;t start server解决方法
- Spring Boot启动报错Unable to start embedded Tomcat
- Spring Boot启动报错Unable to start embedded Tomcat
- tomcat启动的时候报错:Failed to start component
- 浏览器播放海康视频技术选型
- 关于异步,同步,阻塞与非阻塞
- Ajax 获取XmlHttpRequest对象
- make my android ps command on NDK
- binlog_error_action测试
- CDH postgreSQL启动报错DB initialization done. waiting for server to start.............. cloud not start
- Charles抓包
- MySQL第三方备份工具xtrabackup使用
- ios 将Log日志重定向输出到文件中保存
- 236. Lowest Common Ancestor of a Binary Tree
- Python学习笔记 —— 运算符
- Android中注解事件
- Java HashMap(LinkedHashMap)与Hashset(LinkedHashSet)的排序
- wampserver打开localhost显示域名重定向怎么办?localhost显示域名重定向解决办法