当前位置:   article > 正文

greenplum的主机名更改导致无法启动问题解决_安装opengauss以后再修改主机名启动失败

安装opengauss以后再修改主机名启动失败

查看报错日志

[gpadmin@mydb_master ~]$ cat /home/gpadmin/gpAdminLogs/gpstart_20210224.log
  • 1
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-   Successful segment starts                                            = 0
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[WARNING]:-Failed segment starts                                                = 1   <<<<<<<<
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-Successfully started 0 of 1 segment instances <<<<<<<<
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[WARNING]:-Segment instance startup failures reported
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[WARNING]:-Failed start 1 of 1 segment instances <<<<<<<<
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[WARNING]:-Review /home/gpadmin/gpAdminLogs/gpstart_20210224.log
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...
20210224:18:27:05:007350 gpstart:mydb_master:gpadmin-[ERROR]:-gpstart error: Do not have enough valid segments to start the array.
20210224:18:29:07:002358 gpstart:mydb_master:gpadmin-[INFO]:-Starting gpstart with args: 
20210224:18:29:07:002358 gpstart:mydb_master:gpadmin-[INFO]:-Gathering information and validating the environment...
20210224:18:29:07:002358 gpstart:mydb_master:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.10.0 build commit:cced3a78d1a0650ba21205438955d2df06644bc8'
20210224:18:29:07:002358 gpstart:mydb_master:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232'
20210224:18:29:07:002358 gpstart:mydb_master:gpadmin-[INFO]:-Starting Master instance in admin mode
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Obtaining Segment details from master...
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Setting new master era
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Master Started...
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Shutting down master
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:---------------------------
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Master instance parameters
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:---------------------------
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Database                 = template1
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Master Port              = 5432
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Master directory         = /data/gpdata/gpmaster/gpseg-1
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Timeout                  = 600 seconds
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Master standby           = Off 
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:---------------------------------------
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-Segment instances that will be started
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:---------------------------------------
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-   Host    Datadir                        Port
20210224:18:29:08:002358 gpstart:mydb_master:gpadmin-[INFO]:-   mydb1   /data/gpdata/gpdatap1/gpseg0   40000
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[WARNING]:-Ping to host: 'mydb1' FAILED
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[WARNING]:-Ping to host: 'mydb1' FAILED
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[WARNING]:-Skipping startup of segdb on mydb1 directory /data/gpdata/gpdatap1/gpseg0 Ping Failed <<<<<<
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[ERROR]:-No segment started for content: 0.
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[INFO]:-dumping success segments: []
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[INFO]:-DBID:2  FAILED  host:'mydb1' datadir:'/data/gpdata/gpdatap1/gpseg0' with reason:'Failed to Ping on host: mydb1'
20210224:18:29:15:002358 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

分析问题

我的master节点名称是 mydb_master,一个segment节点是 mydb_segment1,但是启动的时候,日志中 ping 的主机名却是 mydb1,说明gp内部的节点配置出了问题;

解决问题

  1. 以管理员模式启动数据库;
[gpadmin@mydb_master etc]$ gpstart -m
  • 1
  1. 登陆管理数据库;
  2. 查看节点配置文件;
  3. 更改系统表模式为可以修改;
  4. 更新hostname和address;
  5. 更改系统表模式为不能修改;
  6. 退出;
[gpadmin@mydb_master etc]$ PGOPTIONS="-c gp_session_role=utility" psql -d postgres
postgres=#  select * from gp_segment_configuration;
 dbid | content | role | preferred_role | mode | status | port  |   hostname    | address |            datadir            
------+---------+------+----------------+------+--------+-------+---------------+---------+-------------------------------
    1 |      -1 | p    | p              | n    | u      |  5432 | mydb_master   | mydb    | /data/gpdata/gpmaster/gpseg-1
    2 |       0 | p    | p              | n    | u      | 40000 | mydb_segment1 | mydb1   | /data/gpdata/gpdatap1/gpseg0
(2 rows)
postgres=# set allow_system_table_mods='true';
SET
postgres=# update gp_segment_configuration set hostname = 'mydb_master',address = 'mydb_master' where dbid = 1;
UPDATE 1
postgres=# update gp_segment_configuration set hostname = 'mydb_segment1',address = 'mydb_segment1' where dbid = 2;
UPDATE 1
postgres=# set allow_system_table_mods='false';
SET
postgres=# \q
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

重启数据库

[gpadmin@mydb_master etc]$ gpstop
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-Starting gpstop with args: 
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-Gathering information and validating the environment...
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-Obtaining Segment details from master...
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.10.0 build commit:cced3a78d1a0650ba21205438955d2df06644bc8'
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:---------------------------------------------
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-Master instance parameters
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:---------------------------------------------
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Master Greenplum instance process active PID   = 7521
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Database                                       = template1
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Master port                                    = 5432
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Master directory                               = /data/gpdata/gpmaster/gpseg-1
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Shutdown mode                                  = smart
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Timeout                                        = 120
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Shutdown Master standby host                   = Off
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:---------------------------------------------
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-Segment instances that will be shutdown:
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:---------------------------------------------
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Host            Datadir                        Port    Status
20210224:18:53:10:007825 gpstop:mydb_master:gpadmin-[INFO]:-   mydb_segment1   /data/gpdata/gpdatap1/gpseg0   40000   u

Continue with Greenplum instance shutdown Yy|Nn (default=N):
> y
20210224:18:53:11:007825 gpstop:mydb_master:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20210224:18:53:11:007825 gpstop:mydb_master:gpadmin-[INFO]:-Master segment instance directory=/data/gpdata/gpmaster/gpseg-1
20210224:18:53:11:007825 gpstop:mydb_master:gpadmin-[INFO]:-Stopping master segment and waiting for user connections to finish ...
server shutting down
20210224:18:53:12:007825 gpstop:mydb_master:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20210224:18:53:12:007825 gpstop:mydb_master:gpadmin-[INFO]:-Terminating processes for segment /data/gpdata/gpmaster/gpseg-1
20210224:18:53:12:007825 gpstop:mydb_master:gpadmin-[INFO]:-No standby master host configured
20210224:18:53:12:007825 gpstop:mydb_master:gpadmin-[INFO]:-Targeting dbid [2] for shutdown
20210224:18:53:12:007825 gpstop:mydb_master:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...
20210224:18:53:12:007825 gpstop:mydb_master:gpadmin-[INFO]:-0.00% of jobs completed
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-100.00% of jobs completed
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Segments stopped successfully      = 1
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-   Segments with errors during stop   = 0
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-Successfully shutdown 1 of 1 segment instances 
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-Cleaning up leftover gpmmon process
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-No leftover gpmmon process found
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts
20210224:18:53:13:007825 gpstop:mydb_master:gpadmin-[INFO]:-Cleaning up leftover shared memory
[gpadmin@mydb_master etc]$ gpstart
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Starting gpstart with args: 
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Gathering information and validating the environment...
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.10.0 build commit:cced3a78d1a0650ba21205438955d2df06644bc8'
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232'
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Starting Master instance in admin mode
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Obtaining Segment details from master...
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Setting new master era
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Master Started...
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Shutting down master
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:---------------------------
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Master instance parameters
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:---------------------------
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Database                 = template1
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Master Port              = 5432
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Master directory         = /data/gpdata/gpmaster/gpseg-1
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Timeout                  = 600 seconds
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Master standby           = Off 
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:---------------------------------------
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-Segment instances that will be started
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:---------------------------------------
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-   Host            Datadir                        Port
20210224:18:53:17:007928 gpstart:mydb_master:gpadmin-[INFO]:-   mydb_segment1   /data/gpdata/gpdatap1/gpseg0   40000

Continue with Greenplum instance startup Yy|Nn (default=N):
> y
20210224:18:53:20:007928 gpstart:mydb_master:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-Process results...
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-   Successful segment starts                                            = 1
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-Successfully started 1 of 1 segment instances 
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-----------------------------------------------------
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-Starting Master instance mydb_master directory /data/gpdata/gpmaster/gpseg-1 
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-Command pg_ctl reports Master mydb_master instance active
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-Connecting to dbname='template1' connect_timeout=15
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-No standby master configured.  skipping...
20210224:18:53:21:007928 gpstart:mydb_master:gpadmin-[INFO]:-Database successfully started
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87

参考文章

Deepgreen/Greenplum删除节点步骤

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/66410
推荐阅读
  

闽ICP备14008679号