在编译安装执行init all出现错误
Closed this issue · 1 comments
dhtium commented
(1) 依照官方文档进行操作配置,在最后一步init all时出现错误
命令行报错日志:GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(1722):2109262141_08 Start GTM master
pgxc_ctl(1722):2109262141_10 gtm_ctl: could not send stop signal (PID: 2096): No such process
pgxc_ctl(1722):2109262141_10 gtm_ctl: another server might be running; trying to start server anyway
......
pgxc_ctl(5127):2109252330_06 LOCATION: GTM_PrintControlData, gtm_xlog.c:2015
...skipping...
pgxc_ctl(5127):2109252330_29 Done.
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'CREATE NODE cn001 WITH (TYPE=''coordinator'', HOST=''node1'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'CREATE NODE cn002 WITH (TYPE=''coordinator'', HOST=''node2'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'ALTER NODE dn001 WITH (TYPE=''datanode'', HOST=''node1'', PORT=40004, PRIMARY, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'CREATE NODE dn002 WITH (TYPE=''datanode'', HOST=''node2'', PORT=40004, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'SELECT pgxc_pool_reload()';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'CREATE NODE cn001 WITH (TYPE=''coordinator'', HOST=''node1'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'CREATE NODE cn002 WITH (TYPE=''coordinator'', HOST=''node2'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'CREATE NODE dn001 WITH (TYPE=''datanode'', HOST=''node1'', PORT=40004, PRIMARY, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'ALTER NODE dn002 WITH (TYPE=''datanode'', HOST=''node2'', PORT=40004, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'SELECT pgxc_pool_reload()';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 Done.
pgxc_ctl(5127):2109252330_49 PGXC exit
...skipping...
pgxc_ctl(5127):2109252330_29 Done.
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'CREATE NODE cn001 WITH (TYPE=''coordinator'', HOST=''node1'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'CREATE NODE cn002 WITH (TYPE=''coordinator'', HOST=''node2'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'ALTER NODE dn001 WITH (TYPE=''datanode'', HOST=''node1'', PORT=40004, PRIMARY, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'CREATE NODE dn002 WITH (TYPE=''datanode'', HOST=''node2'', PORT=40004, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn001) 'SELECT pgxc_pool_reload()';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'CREATE NODE cn001 WITH (TYPE=''coordinator'', HOST=''node1'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'CREATE NODE cn002 WITH (TYPE=''coordinator'', HOST=''node2'', PORT=30004)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'CREATE NODE dn001 WITH (TYPE=''datanode'', HOST=''node1'', PORT=40004, PRIMARY, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'ALTER NODE dn002 WITH (TYPE=''datanode'', HOST=''node2'', PORT=40004, PREFERRED)';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 EXECUTE DIRECT ON (dn002) 'SELECT pgxc_pool_reload()';
pgxc_ctl(5127):2109252330_34 ERROR: GTM error, could not obtain global timestamp. Current XID = 0, Autovac = 0
pgxc_ctl(5127):2109252330_34 Done.
(2) 使用的pgxc_ctl.conf
#!/bin/bash
pgxcInstallDir=/data/tbase/install
pgxcOwner=tbase
defaultDatabase=postgres
pgxcUser=$pgxcOwner
tmpDir=/tmp
localTmpDir=$tmpDir
configBackup=n
configBackupHost=pgxc-linker
configBackupDir=$HOME/pgxc
configBackupFile=pgxc_ctl.bak
#---- GTM ----------
gtmName=gtm
gtmMasterServer=node1
gtmMasterPort=50001
gtmMasterDir=/data/tbase/data/gtm
gtmExtraConfig=none
gtmMasterSpecificExtraConfig=none
gtmSlave=y
gtmSlaveServer=node2
gtmSlavePort=50001
gtmSlaveDir=/data/tbase/data/gtm
gtmSlaveSpecificExtraConfig=none
#---- Coordinators -------
coordMasterDir=/data/tbase/data/coord
coordArchLogDir=/data/tbase/data/coord_archlog
coordNames=(cn001 cn002)
coordPorts=(30004 30004)
poolerPorts=(31110 31110)
coordPgHbaEntries=(0.0.0.0/0)
coordMasterServers=(node1 node2)
coordMasterDirs=($coordMasterDir $coordMasterDir)
coordMaxWALsernder=2
coordMaxWALSenders=($coordMaxWALsernder $coordMaxWALsernder )
coordSlave=n
coordSlaveSync=n
coordArchLogDirs=($coordArchLogDir $coordArchLogDir)
coordExtraConfig=coordExtraConfig
cat > $coordExtraConfig <<EOF
#================================================
# Added to all the coordinator postgresql.conf
# Original: $coordExtraConfig
include_if_exists = '/data/tbase/global/global_tbase.conf'
wal_level = replica
wal_keep_segments = 256
max_wal_senders = 4
archive_mode = on
archive_timeout = 1800
archive_command = 'echo 0'
log_truncate_on_rotation = on
log_filename = 'postgresql-%M.log'
log_rotation_age = 4h
log_rotation_size = 100MB
hot_standby = on
wal_sender_timeout = 30min
wal_receiver_timeout = 30min
shared_buffers = 512MB
max_pool_size = 300
log_statement = 'ddl'
log_destination = 'csvlog'
logging_collector = on
log_directory = 'pg_log'
listen_addresses = '*'
max_connections = 100
EOF
coordSpecificExtraConfig=(none none)
coordExtraPgHba=coordExtraPgHba
cat > $coordExtraPgHba <<EOF
local all all trust
host all all 0.0.0.0/0 trust
host replication all 0.0.0.0/0 trust
host all all ::1/128 trust
host replication all ::1/128 trust
EOF
coordSpecificExtraPgHba=(none none)
coordAdditionalSlaves=n
cad1_Sync=n
#---- Datanodes ---------------------
dn1MstrDir=/data/tbase/data/dn001
dn2MstrDir=/data/tbase/data/dn002
dn1SlvDir=/data/tbase/data/dn001
dn2SlvDir=/data/tbase/data/dn002
dn1ALDir=/data/tbase/data/datanode_archlog
dn2ALDir=/data/tbase/data/datanode_archlog
primaryDatanode=dn001
datanodeNames=(dn001 dn002)
datanodePorts=(40004 40004)
datanodePoolerPorts=(41110 41110)
datanodePgHbaEntries=(0.0.0.0/0)
datanodeMasterServers=(node1 node2)
datanodeMasterDirs=($dn1MstrDir $dn2MstrDir)
dnWALSndr=4
datanodeMaxWALSenders=($dnWALSndr $dnWALSndr)
datanodeSlave=y
datanodeSlaveServers=(node2 node1)
datanodeSlavePorts=(50004 54004)
datanodeSlavePoolerPorts=(51110 51110)
datanodeSlaveSync=n
datanodeSlaveDirs=($dn1SlvDir $dn2SlvDir)
datanodeArchLogDirs=($dn1ALDir/dn001 $dn2ALDir/dn002)
datanodeExtraConfig=datanodeExtraConfig
cat > $datanodeExtraConfig <<EOF
#================================================
# Added to all the coordinator postgresql.conf
# Original: $datanodeExtraConfig
include_if_exists = '/data/tbase/global/global_tbase.conf'
listen_addresses = '*'
wal_level = replica
wal_keep_segments = 256
max_wal_senders = 4
archive_mode = on
archive_timeout = 1800
archive_command = 'echo 0'
log_directory = 'pg_log'
logging_collector = on
log_truncate_on_rotation = on
log_filename = 'postgresql-%M.log'
log_rotation_age = 4h
log_rotation_size = 100MB
hot_standby = on
wal_sender_timeout = 30min
wal_receiver_timeout = 30min
shared_buffers = 512MB
max_connections = 100
max_pool_size = 300
log_statement = 'ddl'
log_destination = 'csvlog'
wal_buffers = 512MB
EOF
datanodeSpecificExtraConfig=(none none)
datanodeExtraPgHba=datanodeExtraPgHba
cat > $datanodeExtraPgHba <<EOF
local all all trust
host all all 0.0.0.0/0 trust
host replication all 0.0.0.0/0 trust
host all all ::1/128 trust
host replication all ::1/128 trust
EOF
datanodeSpecificExtraPgHba=(none none)
datanodeAdditionalSlaves=n
walArchive=n
JennyJennyChen commented
错误在这里:
pgxc_ctl(1722):2109262141_08 Start GTM master
pgxc_ctl(1722):2109262141_10 gtm_ctl: could not send stop signal (PID: 2096): No such process
pgxc_ctl(1722):2109262141_10 gtm_ctl: another server might be running; trying to start server anyway
你的GTM没启动起来,