启停openGauss

启动openGauss

  1. 以操作系统用户omm登录数据库主节点。

  2. 使用以下命令启动openGauss。

    1. gs_ctl start -D /opt/data

    启停openGauss - 图1 说明: 如果提示找不到gs_ctl,请检查是否source过环境变量文件(默认是~/.bashrc),若不想source环境变量文件也可以手动切换到安装路径下执行该命令。

停止openGauss

  1. 以操作系统用户omm登录数据库主节点。

  2. 使用以下命令停止openGauss。

    1. gs_ctl stop -D /opt/data

    启停openGauss - 图2 说明: 启停节点操作请参见《工具与命令参考》中“系统内部调用的工具 > gs_ctl”章节。

示例

启动openGauss:

  1. gs_ctl start -D /opt/data
  2. [2022-01-08 09:11:24.666][4179575][][gs_ctl]: waiting for server to start...
  3. .0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
  4. 0 LOG: [Alarm Module]Host Name: pekphispra59074
  5. 0 LOG: [Alarm Module]Host IP: 192.168.6.247
  6. 0 LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
  7. 0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
  8. 0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
  9. 0 WARNING: failed to parse feature control file: gaussdb.version.
  10. 0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
  11. .....The core dump path is an invalid directory
  12. 2022-01-08 09:11:30.381 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
  13. 2022-01-08 09:11:30.381 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
  14. 2022-01-08 09:11:30.381 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: pekphispra59074
  15. 2022-01-08 09:11:30.454 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.6.247
  16. 2022-01-08 09:11:30.454 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
  17. 2022-01-08 09:11:30.455 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
  18. 2022-01-08 09:11:30.459 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: loaded library "security_plugin"
  19. 2022-01-08 09:11:30.459 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
  20. 2022-01-08 09:11:30.459 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
  21. 2022-01-08 09:11:30.461 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] WARNING: No explicit IP is configured for listen_addresses GUC.
  22. 2022-01-08 09:11:30.461 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
  23. 2022-01-08 09:11:30.462 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: reserved memory for backend threads is: 220 MB
  24. 2022-01-08 09:11:30.462 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: reserved memory for WAL buffers is: 128 MB
  25. 2022-01-08 09:11:30.462 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: Set max backend reserve memory is: 348 MB, max dynamic memory is: 11038 MB
  26. 2022-01-08 09:11:30.462 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: shared memory 389 Mbytes, memory context 11386 Mbytes, max process memory 12288 Mbytes
  27. 2022-01-08 09:11:30.526 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [CACHE] LOG: set data cache size(402653184)
  28. 2022-01-08 09:11:30.576 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [CACHE] LOG: set metadata cache size(134217728)
  29. 2022-01-08 09:11:30.612 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [SEGMENT_PAGE] LOG: Segment-page constants: DF_MAP_SIZE: 8156, DF_MAP_BIT_CNT: 65248, DF_MAP_GROUP_EXTENTS: 4175872, IPBLOCK_SIZE: 8168, EXTENTS_PER_IPBLOCK: 1021, IPBLOCK_GROUP_SIZE: 4090, BMT_HEADER_LEVEL0_TOTAL_PAGES: 8323072, BktMapEntryNumberPerBlock: 2038, BktMapBlockNumber: 25, BktBitMaxMapCnt: 512
  30. 2022-01-08 09:11:30.641 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: gaussdb: fsync file "/opt/data/gaussdb.state.temp" success
  31. 2022-01-08 09:11:30.641 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Normal)
  32. 2022-01-08 09:11:30.723 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: max_safe_fds = 979, usable_fds = 1000, already_open = 11
  33. The core dump path is an invalid directory
  34. 2022-01-08 09:11:30.727 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: the configure file /opt/install/etc/gscgroup_xwj.cfg doesn't exist or the size of configure file has changed. Please create it by root user!
  35. 2022-01-08 09:11:30.727 [unknown] [unknown] localhost 281472877080592 0[0:0#0] 0 [BACKEND] LOG: Failed to parse cgroup config file.
  36. .
  37. [2022-01-08 09:11:31.764][4179575][][gs_ctl]: done
  38. [2022-01-08 09:11:31.764][4179575][][gs_ctl]: server started (/opt/data)

停止openGauss:

  1. gs_ctl stop -D /opt/data
  2. [2022-01-08 09:21:01.284][4183642][][gs_ctl]: gs_ctl stopped ,datadir is /opt/data
  3. waiting for server to shut down......... done
  4. server stopped

错误排查

如果启动openGauss或者停止openGauss服务失败,请根据日志文件中的日志信息排查错误,参见日志参考