3.0.3版本功能介绍
1、集群管理工具CM
#CM详细技术介绍
https://docs.opengauss.org/zh/docs/latest/docs/Toolreference/%E7%BB%9F%E4%B8%80%E6%95%B0%E6%8D%AE%E5%BA%93%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7.html
https://mp.weixin.qq.com/s/ZAgW4hptTKuSZtWC6hd6sA
#bilibili直播介绍
https://www.bilibili.com/video/BV1e3411M7j2/?spm_id_from=333.337.search-card.all.click
2、CM升级与数据库内核升级解耦
#获取CM版本
cm_ctl -V
#执行CM升级
gs_upgradectl -t upgrade-cm --upgrade-package PACKAGE_PATH
#校验CM版本
cm_ctl -V
3、指定节点升级
#指定单节点升级
gs_upgradectl -t auto-upgrade -X install.xml --grey -h hostname0
#指定多节点升级
gs_upgradectl -t auto-upgrade -X install.xml --grey -h hostname0,hostnamen
#升级剩余节点
gs_upgradectl -t auto-upgrade -X install.xml --grey --continue
#详细请参考
https://docs.opengauss.org/zh/docs/3.1.0/docs/UpgradeGuide/%E5%8D%87%E7%BA%A7%E6%93%8D%E4%BD%9C.html
4、发布订阅
3.0.3版本发布订阅能力介绍
支持gs_probackup备份发布端的逻辑复制槽,使得发布端使用gs_probackup备份恢复后复制槽不丢失,保证发布订阅的连接正常。 不支持发布订阅同步基础数据。当在创建发布订阅关系之前,发布端的表中已存在数据,这部分基础数据在创建订阅之后会同步到订阅端。23年330发布的5.0.0版本正式具备该能力。 支持以二进制格式发送数据。发布端和订阅端之间传输数据可以使用二进制的格式进行传输,而不是只能使用文本格式进行传输。 支持发布端主备切换不断开。发布端发生主备切换后,订阅端能够自动连接到新的发布端主机,而无需手动修改订阅端的连接信息。
#特性概述
https://docs.opengauss.org/zh/docs/3.0.0/docs/CharacteristicDescription/%E5%8F%91%E5%B8%83%E8%AE%A2%E9%98%85.html
#发布订阅技术详情
https://docs.opengauss.org/zh/docs/3.0.0/docs/Developerguide/%E5%8F%91%E5%B8%83%E8%AE%A2%E9%98%85.html
#向当前数据库添加一个新发布
https://docs.opengauss.org/zh/docs/3.0.0/docs/Developerguide/CREATE-PUBLICATION.html
#修改发布属性
https://docs.opengauss.org/zh/docs/3.0.0/docs/Developerguide/ALTER-PUBLICATION.html
#删除数据库实例中的一个发布
https://docs.opengauss.org/zh/docs/3.0.0/docs/Developerguide/DROP-PUBLICATION.html
#为当前数据库添加一个新的订阅
https://docs.opengauss.org/zh/docs/3.0.0/docs/Developerguide/CREATE-SUBSCRIPTION.html
#修改订阅属性
https://docs.opengauss.org/zh/docs/3.0.0/docs/Developerguide/ALTER-SUBSCRIPTION.html
#删除数据库实例中的一个订阅
https://docs.opengauss.org/zh/docs/3.0.0/docs/Developerguide/DROP-SUBSCRIPTION.html
5、建议的基线参数配置
5.1 系统sysctl.conf配置参数
#预安装时自动修改校验
net.ipv4.tcp_retries1=5
net.ipv4.tcp_syn_retries=5
net.ipv4.tcp_synack_retries=5
net.ipv4.tcp_fin_timeout=60
net.ipv4.tcp_sack=1
net.ipv4.tcp_timestamps=1
vm.extfrag_threshold=500
vm.overcommit_ratio=90
net.ipv4.tcp_max_tw_buckets = 10000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_retries2 = 12
net.ipv4.ip_local_reserved_ports = 9000-9007,20050-20057
net.core.wmem_max = 21299200
net.core.rmem_max = 21299200
net.core.wmem_default = 21299200
net.core.rmem_default = 21299200
net.sctp.sctp_mem = 94500000 915000000 927000000
net.sctp.sctp_rmem = 8192 250000 16777216
net.sctp.sctp_wmem = 8192 250000 16777216
kernel.sem = 250 6400000 1000 25600
net.ipv4.tcp_rmem = 8192 250000 16777216
net.ipv4.tcp_wmem = 8192 250000 16777216
vm.min_free_kbytes = 26398941
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.core.somaxconn = 65535
kernel.shmall = 1152921504606846720
kernel.shmmax = 18446744073709551615
5.2 系统limit.conf 参数配置
soft nofile 1000000
hard nofile 1000000
root soft nproc unlimited
openGauss_user soft nproc unlimited
同步到如下系统文件
cat /etc/security/limits.d/90-nproc.conf
5.3 CMS配置参数
log_dir = $GAUSSLOG/omm/cm/cm_server
log_file_size = 16MB
log_min_messages = WARNING
thread_count = 1000
instance_heartbeat_timeout = 6
instance_failover_delay_timeout = 0
cmserver_ha_connect_timeout = 2
cmserver_ha_heartbeat_timeout = 6
cmserver_ha_status_interval = 1
cmserver_self_vote_timeout = 6
phony_dead_effective_time = 5
cm_server_arbitrate_delay_base_time_out = 10
cm_server_arbitrate_delay_incrememtal_time_out = 3
alarm_component = '/opt/snas/bin/snas_cm_cmd'
alarm_report_interval = 3
alarm_report_max_count = 1
instance_keep_heartbeat_timeout = 40
az_switchover_threshold = 100
az_check_and_arbitrate_interval = 2
az_connect_check_interval = 60
az_connect_check_delay_time = 150
cmserver_demote_delay_on_etcd_fault = 8
instance_phony_dead_restart_interval = 21600
enable_transaction_read_only = on
datastorage_threshold_check_interval = 10
datastorage_threshold_value_check = 85
max_datastorage_threshold_check = 43200
enable_az_auto_switchover = 1
cm_auth_method = trust
cm_krb_server_keyfile ='${GAUSSHOME}/kerberos/{UserName}.keytab'
switch_rto = 600
force_promote = 0
backup_open = 0
enable_dcf = off
ddb_type = 0 # 0 etcd 1 dcc
enable_ssl = off
ssl_cert_expire_alert_threshold = 90
ssl_cert_expire_check_interval = 86400
delay_arbitrate_timeout = 0
ddb_log_level = RUN_ERR|RUN_WAR|DEBUG_ERR|OPER|RUN_INF|PROFILE
ddb_log_backup_file_count = 10
ddb_max_log_file_size = 10M
ddb_log_suppress_enable = 1
ddb_election_timeout = 3
5.4 CMA配置文件
log_dir = $GAUSSLOG/omm/cm/cm_agent
log_file_size = 16MB
log_min_messages = WARNING
incremental_build = on
security_mode = off
upgrade_from = 92606
alarm_component = '/opt/snas/bin/snas_cm_cmd'
agent_report_interval = 1
agent_heartbeat_timeout = 5
agent_connect_timeout = 1
agent_connect_retries = 15
agent_kill_instance_timeout=0
alarm_report_interval = 1
alarm_report_max_count = 1
agent_check_interval = 2
enable_log_compress = on
process_cpu_affinity = 0
enable_xc_maintenance_mode = on
log_threshold_check_interval = 1800
log_max_size=10240
log_max_count=10000
log_saved_days=90
agent_phony_dead_check_interval = 10
unix_socket_directory = $GAUSSHOME/cluster/app #directory of unix socket
dilatation_shard_count_for_disk_capacity_alarm = 1
enable_dcf = off
disaster_recovery_type = 0
agent_backup_open = 0
5.5 数据库参数配置
max_process_memory=内存*0.7
shared_buffers=内存*0.7*0.4
modify_initial_password=false
listen_addresses='*'
archive_mode=on
synchronous_commit=on
archive_dest=/ogarchive
max_connections=3000
work_mem=64MB
maintenance_work_mem=2GB
cstore_buffers=16MB
wal_buffers=1GB
wal_level=logical
full_page_writes=off
wal_log_hints=off
wal_keep_segments=1024
xloginsert_locks=48
advance_xlog_file_num=10
logging_collector=on
log_duration=on
log_line_prefix='%m %u %d %r %p %S'
log_checkpoints=on
vacuum_cost_limit=1000
autovacuum_max_workers=10
autovacuum_naptime=20s
autovacuum_vacuum_cost_delay=10
autovacuum_vacuum_scale_factor=0.05
autovacuum_analyze_scale_factor=0.02
autovacuum_vacuum_threshold=200
autovacuum_analyze_threshold=200
max_wal_senders=16
recovery_max_workers=4
most_available_sync=on
checkpoint_segments=1024
checkpoint_completion_target=0.8
password_encryption_type=1
session_timeout=0
enable_alarm=off
enable_codegen=off
lc_messages='en_US.UTF-8'
lc_monetary='en_US.UTF-8'
lc_numeric='en_US.UTF-8'
lc_time='en_US.UTF-8'
enable_wdr_snapshot=off
#不允许主机向任何备机主动同步配置文件
sync_config_strategy='none_node'
audit_enabled=off
wal_receiver_timeout=60s
plog_merge_age=0
autovacuum_io_limits=104857600
update_lockwait_timeout=1min
lockwait_timeout=1min
max_prepared_transactions=3000
instr_unique_sql_count=50000
enable_auto_clean_unique_sql=on
enable_save_datachanged_timestamp=off
track_sql_count=off
enable_instr_rt_percentile=off
enable_instance_metric_persistent=off
enable_logical_io_statistics=off
enable_user_metric_persistent=off
enable_mergejoin=on
enable_nestloop=on
enable_pbe_optimization=off
max_replication_slots=32
password_reuse_time=0
password_lock_time=0
password_effect_time=0
max_files_per_process=100000
pagewriter_sleep=200
max_size_for_xlog_prune=104857600
log_filename='postgresql_%d.log'
log_truncate_on_rotation=on
standby_shared_buffers_fraction=1
enable_asp=off
behavior_compat_options='display_leading_zero'
local_syscache_threshold=16MB
upgrade_mode=0
catchup2normal_wait_time=0
thread_pool_attr='240,2,(allbind)' #根据实际环境调整
#用于记录慢SQL问题,可以在statement_history中记录超过20ms的SQL,每条记录显示1024个字节的query语句。
enable_stmt_track=on
track_stmt_stat_level=’OFF,L0’
track_stmt_session_slot=1000
track_stmt_details_size=4096
track_stmt_retention_time='3600,172800'
log_min_duration_statement=20ms
track_activity_query_size = 1024
enable_slot_log=on
gs_clean_timeout=60
enable_ustore=off
try_vector_engine_strategy=off
enable_dcf=off
enable_global_syscache=on
global_syscache_threshold=16MB
#不开启延迟进入最大可用时间
keep_sync_window=0
参数概述:开启归档、astore、日志按月轮转、不开启审计、不开启wdr、记录超过20ms的SQL。