GaussDB 100提供了gs_gucZenith工具来帮助完成在Online状态下对CN和DN的内核参数设置。
前提条件
- 已成功安装好集群。
- 需要设置的CN、DN实例状态为Online。
- 集群用户互信正常。
语法
- 设置DN、CN参数。
gs_gucZenith -c CMD [-I INSTANCENAMES | --force] [--scope=pfile]
配置用户白名单
- 增加用户白名单信息
gs_gucZenith -S "TYPE USER ADDRESS" [-I INSTANCENAMES | --force]
删除用户白名单信息
gs_gucZenith -R "TYPE USER ADDRESS" [-I INSTANCENAMES | --force]
显示帮助信息。
- 增加用户白名单信息
gs_gucZenith { -? | --help }
显示版本号信息。
gs_gucZenith { -V | --version }
参数说明
- -c
需要设置的参数(形式为:参数名=参数值,例如:"USE_LARGE_PAGES=TRUE")。
允许设置如下内核参数(各参数的详细信息请参见参数说明):
- DBWR_PROCESSES
- LOG_BUFFER_COUNT
- LOCK_WAIT_TIMEOUT
- SESSIONS
- DATA_BUFFER_SIZE
- SHARED_POOL_SIZE
- AUDIT_LEVEL
- LARGE_POOL_SIZE
- BUF_POOL_NUM
- LOG_BUFFER_SIZE
- TEMP_BUFFER_SIZE
- ALARM_LOG_DIR
- LOG_HOME
- QUORUM_ANY
- REPL_AUTH
- CR_POOL_SIZE
- CR_POOL_COUNT
- TEMP_POOL_NUM
- TABLESPACE_USAGE_ALARM_THRESHOLD
- _AGENT_STACK_SIZE
- COMMIT_MODE
- COMMIT_WAIT_LOGGING
- CHECKPOINT_PERIOD
- CHECKPOINT_PAGES
- TIMED_STATS
- STATS_LEVEL
- SQL_STAT
- REPL_WAIT_TIMEOUT
- MAX_ARCH_FILES_SIZE
- ARCH_CLEAN_IGNORE_BACKUP
- MERGE_SORT_BATCH_SIZE
- MAX_ALLOWED_PACKET
- INTERACTIVE_TIMEOUT
- LONGSQL_TIMEOUT
- COMMIT_ON_DISCONNECT
- TCP_VALID_NODE_CHECKING
- TCP_INVITED_NODES
- TCP_EXCLUDED_NODES
- _UNDO_ACTIVE_SEGMENTS
- VARIANT_MEMORY_AREA_SIZE
- LARGE_VARIANT_MEMORY_AREA_SIZE
- _VMP_CACHES_EACH_SESSION
- DB_ISOLEVEL
- TC_LEVEL
- CHECKPOINT_IO_CAPACITY
- LOG_REPLAY_PROCESSES
- UNDO_RETENTION_TIME
- RECYCLEBIN
- _DOUBLEWRITE
- MAX_CONNECTION_POOL_SIZE
- LOCK_WAIT_TIMEOUT
- COMMIT_WAIT
- FILESYSTEMIO_OPTIONS
- REACTOR_THREADS
- MAX_WORKER_THREADS
- OPTIMIZED_WORKER_THREADS
- JOB_QUEUE_PROCESSES
- _MAX_RM_COUNT
- SUPER_USER_RESERVED_SESSIONS
- DEFAULT_EXTENTS
- MAX_COLUMN_COUNT
- UDS_FILE_PERMISSIONS
- _SQL_POOL_FACTOR
- _QOS_CTRL_FACTOR
- _HINT_FORCE
- _THREAD_STACK_SIZE
- SHARD_RETRY_TIMES
- SHARD_RETRY_INTERVAL
- SSL_CERT
- SSL_KEY
- SSL_CA
- SSL_CRL
- _LOG_FILE_PERMISSIONS
- _LOG_PATH_PERMISSIONS
- ARCH_CLEAN_IGNORE_STANDBY
- ARCHIVE_FORMAT
- _UNDO_AUTO_SHRINK
- UNDO_RESERVE_SIZE
- _TX_ROLLBACK_PROC_NUM
- PAGE_CHECKSUM
- UDS_FILE_PATH
- USE_LARGE_PAGES
- _MAX_VM_FUNC_STACK_COUNT
- _SGA_CORE_DUMP_CONFIG
- DELAY_CLEANOUT
- _SERIALIZED_COMMIT
- _CHECKPOINT_MERGE_IO
- STATISTICS_SAMPLE_SIZE
- ENABLE_SAMPLE_LIMIT
- STATS_COST_LIMIT
- STATS_COST_DELAY
- STATS_MAX_BUCKET_SIZE
- _MAX_CONNECT_BY_LEVEL
- DB_FILE_NAME_CONVERT
- LOG_FILE_NAME_CONVERT
- _LNS_WAIT_TIME
- BLOCK_REPAIR_ENABLE
- BLOCK_REPAIR_TIMEOUT
- MAX_TEMP_TABLES
- LOCAL_TEMPORARY_TABLE_ENABLED
- USE_NATIVE_DATATYPE
- CBO
- JOB_THREADS
- FILE_OPTIONS
- INSTANCE_NAME
- CR_MODE
- DROP_NOLOGGING
- _AUTO_INDEX_RECYCLE
- _RCY_CHECK_PCN
- MASTER_SLAVE_DIFFTIME
- GLOBAL_SEQUENCE_CACHE_SIZE
- GTS_STRONG_CONSISTENCY
- RESOURCE_PLAN
- CPU_NODE_BIND
- SHARD_SERIAL_EXECUTION
- SHARD_REFUSESQL_LEVEL
- _PREFETCH_ROWS
- OPEN_CURSORS
- ENABLE_SQL_MAP
- _SQL_MAP_BUCKETS
- _ENABLE_QOS
- _QOS_SLEEP_TIME
- _QOS_RANDOM_RANGE
- _DISABLE_SOFT_PARSE
- _LOB_MAX_EXEC_SIZE
- _SPIN_COUNT
- _INDEX_BUFFER_SIZE
- _PRIVATE_KEY_LOCKS
- _PRIVATE_ROW_LOCKS
- _INIT_CURSORS
- ENABLE_ERR_SUPERPOSED
- MIN_CONNECTION_POOL_SIZE
- RESOURCE_LIMIT
- _SQL_CURSORS_EACH_SESSION
- _RESERVED_SQL_CURSORS
- MAX_REMOTE_PARAMS
- AUDIT_TRAIL_MODE
- _AUDIT_MAX_FILE_SIZE
- _AUDIT_BACKUP_FILE_COUNT
- ENABLE_ACCESS_DC
- ENABLE_SYS_REMOTE_LOGIN
- LOCAL_KEY
- _FACTOR_KEY
- UNAUTH_SESSION_EXPIRE_TIME
- SSL_VERIFY_PEER
- SSL_CIPHER
- SSL_KEY_PASSWORD
- SSL_EXPIRE_ALERT_THRESHOLD
- _ENCRYPTION_ITERATION
- _LOG_LEVEL
- _LOG_MAX_FILE_SIZE
- _LOG_BACKUP_FILE_COUNT
- _BLACKBOX_STACK_DEPTH
- WORKER_THREADS_SHRINK_THRESHOLD
- LSNR_ADDR
- LSNR_PORT
- REPL_ADDR
- REPL_PORT
- -S
指定需要增加的用户白名单信息(格式:'TYPE USER ADDRESS'),例如,-S 'host * 10.xx.xx.1'。该设置立即生效。
- -R
指定需要删除的用户白名单信息(格式:'TYPE USER ADDRESS'),例如,-R 'host * 10.xx.xx.1'。该设置立即生效。
- 不支持使用gs_gucZenith工具增加或删除集群内部节点IP。
- 在单机/主备部署模式下,支持为DN增加或删除白名单信息;在分布式部署模式下,只支持为CN增加或删除白名单信息,不支持为DN增加或删除白名单信息。
- 用户白名单信息的格式是'TYPE USER ADDRESS' , 其中ADDRESS字段声明允许连接的指定用户的IP地址范围,如果指定多个IP地址,各IP之间使用英文逗号分隔,并且各IP之间不允许有空格。
- 删除一条白名单信息,提供的ADDRESS字段,IP地址信息不允许带子网掩码。
- -I
需要设置的实例的实例名,多个实例需要使用半角逗号(“,”)分隔。
- --force
不指定-I参数且存在非ONLINE的CN或DN实例时,跳过该实例。
- --scope
设置内核参数的生效方式,不设置此参数则为默认生效。
取值范围:pfile(表示重启生效)。
- -?,--help
显示帮助信息。
- -V,--version
显示版本号信息。
示例
- 使用gs_gucZenith工具设置全部实例参数,重启生效。
[omm@plat1 script]\>gs_gucZenith -c "LOG_BUFFER_SIZE=16M" --scope=pfile
Get cluster status.
Start getting healthy zenith instances.
Successfully got healthy zenith instances.
Start verifying the specifications of the kernel parameter value...
Successfully verified the specifications of the kernel parameter value.
Start setting kernel parameter.
------------------------------
Current value of DB1_1 is "4M"
Set kernel parameter successfully! Instance: DB1_1
------------------------------
Current value of DB1_2 is "4M"
Set kernel parameter successfully! Instance: DB1_2
------------------------------
Current value of DB2_3 is "4M"
Set kernel parameter successfully! Instance: DB2_3
------------------------------
Current value of DB2_4 is "4M"
Set kernel parameter successfully! Instance: DB2_4
------------------------------
Current value of cn_401 is "4M"
Set kernel parameter successfully! Instance: cn_401
------------------------------
Current value of cn_402 is "4M"
Set kernel parameter successfully! Instance: cn_402
------------------------------
Successfully set kernel parameter.
Please restart the cluster to make the new value take effect.
- 使用gs_gucZenith工具修改部分实例配置文件,按默认方式生效。
[omm@plat1 script]\>gs_gucZenith -c "USE_LARGE_PAGES=TRUE" -I DB1_2,cn_401
Get cluster status.
Start getting healthy zenith instances.
Successfully got healthy zenith instances.
Start verifying the specifications of the kernel parameter value...
Successfully verified the specifications of the kernel parameter value.
Start setting kernel parameter.
------------------------------
Current value of DB1_2 is "TRUE"
Set kernel parameter successfully! Instance: DB1_2
------------------------------
Current value of cn_401 is "TRUE"
Set kernel parameter successfully! Instance: cn_401
------------------------------
Successfully set kernel parameter.
Please restart the cluster to make the new value take effect. - 分布式部署模式下,使用gs_gucZenith工具向所有CN的用户白名单配置中增加信息,立即生效。
[@plat1 script]\>gs_gucZenith -S 'host * 10.0.0.1'
Get cluster status.
Start getting healthy zenith instances.
Successfully got healthy zenith instances.
Start config user whitelist.
------------------------------
Set User whitelist successfully! Instance: cn_401
------------------------------
Set User whitelist successfully! Instance: cn_402
------------------------------
End config user whitelist. - 分布式部署模式下,使用gs_gucZenith工具从所有CN的用户白名单配置中删除信息,立即生效。
[@plat1 script]\>gs_gucZenith -R 'host * 10.0.0.1'
Get cluster status.
Start getting healthy zenith instances.
Successfully got healthy zenith instances.
Start config user whitelist.
------------------------------
Remove User whitelist successfully! Instance: cn_401
------------------------------
Remove User whitelist successfully! Instance: cn_402
------------------------------
End config user whitelist. - 分布式部署模式下,使用gs_gucZenith工具从所有CN的用户白名单中删除不存在的信息,立即生效。
[@plat1 script]\>gs_gucZenith -R 'host * 10.0.0.22'
Get cluster status.
Start getting healthy zenith instances.
Successfully got healthy zenith instances.
Start config user whitelist.
------------------------------
Warning: Entry 'host * 10.0.0.22' not found for instance cn_401. Skip to remove this config.
------------------------------
Warning: Entry 'host * 10.0.0.22' not found for instance cn_402. Skip to remove this config.
------------------------------
End config user whitelist. - 分布式部署模式下,使用gs_gucZenith工具添加用户白名单,立即生效。
[@plat1 script]\>gs_gucZenith -S 'host * 10.0.0.1'
Get cluster status.
Start getting healthy zenith instances.
Successfully got healthy zenith instances.
Start config user whitelist.
------------------------------
Set User whitelist successfully! Instance: cn_401
------------------------------
Set User whitelist successfully! Instance: cn_402
End config user whitelist.