hghac和hgproxy版本升级相关操作和注意事项
文章目录
- 环境
- 文档用途
- 详细信息
环境
系统平台:N/A
版本:4.5.6,4.5.7,4.5.8
文档用途
本文档用于高可用集群环境中hghac组件和hgproxy组件替换和升级操作
详细信息
1.关闭服务
所有数据节点都执行
1、关闭hgproxy服务
[root@hgdb01 tools]# systemctl stop hgproxy.service
[root@hgdb02 tools]# systemctl stop hgproxy.service
2、关闭hghac服务
[root@hgdb01 tools]# systemctl stop hghac.service
[root@hgdb02 tools]# systemctl stop hghac.service
3、关闭etcd服务
[root@hgdb01 tools]# systemctl stop etcd.service
[root@hgdb02 tools]# systemctl stop etcd.service
[root@localhost ~]# systemctl stop etcd.service
2.升级过程
操作前请先备份原集群配置文件。
1、安装软件包
验证md5值
[root@hgdb01 tools]# md5sum hghac4.2.3.3-see-17f931d-20240620.x86_64.rpm
0d960d0ac4925b272c30849e415031fd hghac4.2.3.3-see-17f931d-20240620.x86_64.rpm
安装软件包
[root@hgdb01 tools]# rpm -ivh hghac4.2.3.3-see-17f931d-20240620.x86_64.rpm
准备中... ################################# [100%]
正在升级/安装...
1:hghac-4.2.3.3-17f931d ################################# [100%]
Created symlink from /etc/systemd/system/multi-user.target.wants/hghac.service to /usr/lib/systemd/system/hghac.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/etcd.service to /usr/lib/systemd/system/etcd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/vip-manager.service to /usr/lib/systemd/system/vip-manager.service.
2、配置并启动etcd
01节点:
[root@hgdb01 tools]# vim /usr/local/hghac/etcd/etcd.yml
# This is the configuration file for the etcd server.# Human-readable name for this member.
name: 'etcd_01'# Path to the data directory.
data-dir: /usr/local/hghac/etcd/etcd01# Path to the dedicated wal directory.
wal-dir:# Number of committed transactions to trigger a snapshot to disk.
snapshot-count: 10000# Time (in milliseconds) of a heartbeat interval.
heartbeat-interval: 100# Time (in milliseconds) for an election to timeout.
election-timeout: 1000# Raise alarms when backend size exceeds the given quota. 0 means use the
# default quota.
quota-backend-bytes: 0# List of comma separated URLs to listen on for peer traffic.
listen-peer-urls: http://x.x.0.101:2380# List of comma separated URLs to listen on for client traffic.
listen-client-urls: http://x.x.0.101:2379,http://127.0.0.1:2379# Maximum number of snapshot files to retain (0 is unlimited).
max-snapshots: 5# Maximum number of wal files to retain (0 is unlimited).
max-wals: 5# Comma-separated white list of origins for CORS (cross-origin resource sharing).
cors:# List of this member's peer URLs to advertise to the rest of the cluster.
# The URLs needed to be a comma-separated list.
initial-advertise-peer-urls: http://x.x.0.101:2380# List of this member's client URLs to advertise to the public.
# The URLs needed to be a comma-separated list.
advertise-client-urls: http://x.x.0.101:2379# Discovery URL used to bootstrap the cluster.
discovery:# Valid values include 'exit', 'proxy'
discovery-fallback: 'proxy'# HTTP proxy to use for traffic to discovery service.
discovery-proxy:# DNS domain used to bootstrap initial cluster.
discovery-srv:# Initial cluster configuration for bootstrapping.
initial-cluster: etcd_01=http://x.x.0.101:2380,etcd_02=http://x.x.0.102:2380,etcd_03=http://x.x.0.103:2380# Initial cluster token for the etcd cluster during bootstrap.
initial-cluster-token: 'etcd-cluster'# Initial cluster state ('new' or 'existing').
initial-cluster-state: 'new'# Reject reconfiguration requests that would cause quorum loss.
strict-reconfig-check: false# Accept etcd V2 client requests
enable-v2: true# Enable runtime profiling data via HTTP server
enable-pprof: false# Valid values include 'on', 'readonly', 'off'
proxy: 'off'# Time (in milliseconds) an endpoint will be held in a failed state.
proxy-failure-wait: 5000# Time (in milliseconds) of the endpoints refresh interval.
proxy-refresh-interval: 30000# Time (in milliseconds) for a dial to timeout.
proxy-dial-timeout: 1000# Time (in milliseconds) for a write to timeout.
proxy-write-timeout: 5000# Time (in milliseconds) for a read to timeout.
proxy-read-timeout: 0client-transport-security:# DEPRECATED: Path to the client server TLS CA file.ca-file:# Path to the client server TLS cert file.cert-file:# Path to the client server TLS key file.key-file:# Enable client cert authentication.client-cert-auth: false# Path to the client server TLS trusted CA cert file.trusted-ca-file:# Client TLS using generated certificatesauto-tls: falsepeer-transport-security:# DEPRECATED: Path to the peer server TLS CA file.ca-file:# Path to the peer server TLS cert file.cert-file:# Path to the peer server TLS key file.key-file:# Enable peer client cert authentication.peer-client-cert-auth: false# Path to the peer server TLS trusted CA cert file.trusted-ca-file:# Peer TLS using generated certificates.auto-tls: false# Enable debug-level logging for etcd.
debug: false# Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG'.
log-package-levels:# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
log-output: default# Force to create a new one member cluster.
force-new-cluster: false
02节点配置
# This is the configuration file for the etcd server.# Human-readable name for this member.
name: 'etcd_02'# Path to the data directory.
data-dir: /usr/local/hghac/etcd/etcd02# Path to the dedicated wal directory.
wal-dir:# Number of committed transactions to trigger a snapshot to disk.
snapshot-count: 10000# Time (in milliseconds) of a heartbeat interval.
heartbeat-interval: 100# Time (in milliseconds) for an election to timeout.
election-timeout: 1000# Raise alarms when backend size exceeds the given quota. 0 means use the
# default quota.
quota-backend-bytes: 0# List of comma separated URLs to listen on for peer traffic.
listen-peer-urls: http://x.x.0.102:2380# List of comma separated URLs to listen on for client traffic.
listen-client-urls: http://x.x.0.102:2379,http://127.0.0.1:2379# Maximum number of snapshot files to retain (0 is unlimited).
max-snapshots: 5# Maximum number of wal files to retain (0 is unlimited).
max-wals: 5# Comma-separated white list of origins for CORS (cross-origin resource sharing).
cors:# List of this member's peer URLs to advertise to the rest of the cluster.
# The URLs needed to be a comma-separated list.
initial-advertise-peer-urls: http://x.x.0.102:2380# List of this member's client URLs to advertise to the public.
# The URLs needed to be a comma-separated list.
advertise-client-urls: http://x.x.0.102:2379# Discovery URL used to bootstrap the cluster.
discovery:# Valid values include 'exit', 'proxy'
discovery-fallback: 'proxy'# HTTP proxy to use for traffic to discovery service.
discovery-proxy:# DNS domain used to bootstrap initial cluster.
discovery-srv:# Initial cluster configuration for bootstrapping.
initial-cluster: etcd_01=http://x.x.0.101:2380,etcd_02=http://x.x.0.102:2380,etcd_03=http://x.x.0.103:2380# Initial cluster token for the etcd cluster during bootstrap.
initial-cluster-token: 'etcd-cluster'# Initial cluster state ('new' or 'existing').
initial-cluster-state: 'new'# Reject reconfiguration requests that would cause quorum loss.
strict-reconfig-check: false# Accept etcd V2 client requests
enable-v2: true# Enable runtime profiling data via HTTP server
enable-pprof: false# Valid values include 'on', 'readonly', 'off'
proxy: 'off'# Time (in milliseconds) an endpoint will be held in a failed state.
proxy-failure-wait: 5000# Time (in milliseconds) of the endpoints refresh interval.
proxy-refresh-interval: 30000# Time (in milliseconds) for a dial to timeout.
proxy-dial-timeout: 1000# Time (in milliseconds) for a write to timeout.
proxy-write-timeout: 5000# Time (in milliseconds) for a read to timeout.
proxy-read-timeout: 0client-transport-security:# DEPRECATED: Path to the client server TLS CA file.ca-file:# Path to the client server TLS cert file.cert-file:# Path to the client server TLS key file.key-file:# Enable client cert authentication.client-cert-auth: false# Path to the client server TLS trusted CA cert file.trusted-ca-file:# Client TLS using generated certificatesauto-tls: falsepeer-transport-security:# DEPRECATED: Path to the peer server TLS CA file.ca-file:# Path to the peer server TLS cert file.cert-file:# Path to the peer server TLS key file.key-file:# Enable peer client cert authentication.peer-client-cert-auth: false# Path to the peer server TLS trusted CA cert file.trusted-ca-file:# Peer TLS using generated certificates.auto-tls: false# Enable debug-level logging for etcd.
debug: false# Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG'.
log-package-levels:# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
log-output: default# Force to create a new one member cluster.
force-new-cluster: false
03节点配置
# This is the configuration file for the etcd server.# Human-readable name for this member.
name: 'etcd_03'# Path to the data directory.
data-dir: /usr/local/hghac/etcd/etcd03# Path to the dedicated wal directory.
wal-dir:# Number of committed transactions to trigger a snapshot to disk.
snapshot-count: 10000# Time (in milliseconds) of a heartbeat interval.
heartbeat-interval: 100# Time (in milliseconds) for an election to timeout.
election-timeout: 1000# Raise alarms when backend size exceeds the given quota. 0 means use the
# default quota.
quota-backend-bytes: 0# List of comma separated URLs to listen on for peer traffic.
listen-peer-urls: http://x.x.0.103:2380# List of comma separated URLs to listen on for client traffic.
listen-client-urls: http://x.x.0.103:2379,http://127.0.0.1:2379# Maximum number of snapshot files to retain (0 is unlimited).
max-snapshots: 5# Maximum number of wal files to retain (0 is unlimited).
max-wals: 5# Comma-separated white list of origins for CORS (cross-origin resource sharing).
cors:# List of this member's peer URLs to advertise to the rest of the cluster.
# The URLs needed to be a comma-separated list.
initial-advertise-peer-urls: http://x.x.0.103:2380# List of this member's client URLs to advertise to the public.
# The URLs needed to be a comma-separated list.
advertise-client-urls: http://x.x.0.103:2379# Discovery URL used to bootstrap the cluster.
discovery:# Valid values include 'exit', 'proxy'
discovery-fallback: 'proxy'# HTTP proxy to use for traffic to discovery service.
discovery-proxy:# DNS domain used to bootstrap initial cluster.
discovery-srv:# Initial cluster configuration for bootstrapping.
initial-cluster: etcd_01=http://x.x.0.101:2380,etcd_02=http://x.x.0.102:2380,etcd_03=http://x.x.0.103:2380# Initial cluster token for the etcd cluster during bootstrap.
initial-cluster-token: 'etcd-cluster'# Initial cluster state ('new' or 'existing').
initial-cluster-state: 'new'# Reject reconfiguration requests that would cause quorum loss.
strict-reconfig-check: false# Accept etcd V2 client requests
enable-v2: true# Enable runtime profiling data via HTTP server
enable-pprof: false# Valid values include 'on', 'readonly', 'off'
proxy: 'off'# Time (in milliseconds) an endpoint will be held in a failed state.
proxy-failure-wait: 5000# Time (in milliseconds) of the endpoints refresh interval.
proxy-refresh-interval: 30000# Time (in milliseconds) for a dial to timeout.
proxy-dial-timeout: 1000# Time (in milliseconds) for a write to timeout.
proxy-write-timeout: 5000# Time (in milliseconds) for a read to timeout.
proxy-read-timeout: 0client-transport-security:# DEPRECATED: Path to the client server TLS CA file.ca-file:# Path to the client server TLS cert file.cert-file:# Path to the client server TLS key file.key-file:# Enable client cert authentication.client-cert-auth: false# Path to the client server TLS trusted CA cert file.trusted-ca-file:# Client TLS using generated certificatesauto-tls: falsepeer-transport-security:# DEPRECATED: Path to the peer server TLS CA file.ca-file:# Path to the peer server TLS cert file.cert-file:# Path to the peer server TLS key file.key-file:# Enable peer client cert authentication.peer-client-cert-auth: false# Path to the peer server TLS trusted CA cert file.trusted-ca-file:# Peer TLS using generated certificates.auto-tls: false# Enable debug-level logging for etcd.
debug: false# Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG'.
log-package-levels:# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
log-output: default# Force to create a new one member cluster.
force-new-cluster: false
启动etcd(三台间隔时间不要太长)
[root@hgdb01 ~]# systemctl start etcd.service
[root@hgdb02 ~]# systemctl start etcd.service
[root@hgdb03 ~]# systemctl start etcd.service
查看etcd集群状态
[root@hgdb01 tools]# /usr/local/hghac/etcd/etcdctl --endpoints=http://x.x.0.101:2379,http://x.x.0.102:2379,http://x.x.0.103:2379 endpoint status --write-out=table
+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| http://x.x.0.101:2379 | 7a586afca670fdcd | 3.4.15 | 20 kB | false | false | 2 | 8 | 8 | |
| http://x.x.0.102:2379 | 5506b0263532a5d | 3.4.15 | 25 kB | false | false | 2 | 8 | 8 | |
| http://x.x.0.103:2379 | 21d26eb730319e20 | 3.4.15 | 25 kB | true | false | 2 | 8 | 8 | |
+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
3、配置hghac组件
01节点
scope: highgo-see-cluster
namespace: /service/
name: see_01 restapi:listen: x.x.0.101:8008connect_address: x.x.0.101:8008etcd3:hosts: x.x.0.101:2379,x.x.0.102:2379,x.x.0.103:2379#zookeeper:
# hosts: ['x.x.31.101:2181', 'x.x.31.102:2181', 'x.x.31.103:2181']bootstrap:dcs:ttl: 30loop_wait: 10retry_timeout: 10maximum_lag_on_failover: 1048576master_start_timeout: 300synchronous_mode: falsepostgresql:use_pg_rewind: trueparameters:wal_level: replicahot_standby: "on"wal_keep_size: 100max_wal_senders: 10max_replication_slots: 10wal_log_hints: "on"archive_mode: "off"archive_timeout: 1800slogging_collector: "on"method: initdb_keygeninitdb_keygen:command: /usr/local/hghac/hac/initdb_keygen.shkeep_existing_recovery_conf: Trueno_params: Truepostgresql:database: highgolisten: 0.0.0.0:5866connect_address: x.x.0.101:5866bin_dir: /opt/highgo/hgdb-see-4.5.8/bindata_dir: /data/highgo/dataconfig_dir: /data/highgo/datapgpass: /tmp/.pgpassauthentication:replication:username: sysdbapassword: Hello@1234rewind:username: sysdbapassword: Hello@1234sysdba:password: Hello@1234syssso:password: Hello@1234syssao:password: Hello@1234parameters:ssl: 'on'ssl_cert_file: /data/highgo/data/server.crtssl_key_file: /data/highgo/data/server.keypg_hba:- local all all sm3- host all all 0.0.0.0/0 sm3- host all all ::1/128 sm3- local replication all sm3- host replication all 0.0.0.0/0 sm3- host replication all ::1/128 sm3tags:nofailover: falsenoloadbalance: falseclonefrom: falsenosync: falselog:level: INFOtraceback_level: INFOdir: /usr/local/hghac/hac
启动hghac
# systemctl start hgahc.service
查看集群状态
# /usr/local/hghac/hac/hghactl/hghactl -c /usr/local/hghac/hac/hghac.yml list
02节点
scope: highgo-see-cluster
namespace: /service/
name: see_02 restapi:listen: x.x.0.102:8008connect_address: x.x.0.102:8008etcd3:hosts: x.x.0.101:2379,x.x.0.102:2379,x.x.0.103:2379#zookeeper:
# hosts: ['x.x.31.101:2181', 'x.x.31.102:2181', 'x.x.31.103:2181']bootstrap:dcs:ttl: 30loop_wait: 10retry_timeout: 10maximum_lag_on_failover: 1048576master_start_timeout: 300synchronous_mode: falsepostgresql:use_pg_rewind: trueparameters:wal_level: replicahot_standby: "on"wal_keep_size: 100max_wal_senders: 10max_replication_slots: 10wal_log_hints: "on"archive_mode: "off"archive_timeout: 1800slogging_collector: "on"method: initdb_keygeninitdb_keygen:command: /usr/local/hghac/hac/initdb_keygen.shkeep_existing_recovery_conf: Trueno_params: Truepostgresql:database: highgolisten: 0.0.0.0:5866connect_address: x.x.0.102:5866bin_dir: /opt/highgo/hgdb-see-4.5.8/bindata_dir: /data/highgo/dataconfig_dir: /data/highgo/datapgpass: /tmp/.pgpassauthentication:replication:username: sysdbapassword: Hello@1234rewind:username: sysdbapassword: Hello@1234sysdba:password: Hello@1234syssso:password: Hello@1234syssao:password: Hello@1234parameters:ssl: 'on'ssl_cert_file: /data/highgo/data/server.crtssl_key_file: /data/highgo/data/server.keypg_hba:- local all all sm3- host all all 0.0.0.0/0 sm3- host all all ::1/128 sm3- local replication all sm3- host replication all 0.0.0.0/0 sm3- host replication all ::1/128 sm3tags:nofailover: falsenoloadbalance: falseclonefrom: falsenosync: falselog:level: INFOtraceback_level: INFOdir: /usr/local/hghac/hac
启动hghac
# systemctl start hgahc.service
查看集群状态
# /usr/local/hghac/hac/hghactl/hghactl -c /usr/local/hghac/hac/hghac.yml list
4、配置hgproxy
所有节点配置相同
[root@hgdb01 hgproxy]# cat /usr/local/hgproxy/etc/proxy.conf
# version: 4.0.27[Log]
log_collector = on# 是否开始日志功能log_level = log# 可选日志级别如下:# debug5# debug4# debug3# debug2 - 显示设置路由节点的关键点# debug1 - 显示语句与协议包的路由节点# log - 显示会话的开始与结束# commerror# info# notice# warning# error# fatal# paniclog_destination = file# stdout: 标准输出# stderr: 标准错误输出# file: 输出到文件log_filename = /data/hglog/hgproxy.log# 日志输出文件# 设置按日期输出到不同文件, 只需要在文件名中添加时间转换字符 %d(%Y%m%d), 例如:/tmp/log/hgproxy.%d(%Y%m%d).log, 输出文件名样式为:hgproxy.20200808.loglog_format = "%d.%us %-7V [pid:%-7p cid:%-7U %18F:%-5L] %m%n"# 格式说明:# %d :时间格式(2012-01-01 17:03:12)# %d.%ms :时间格式(2012-01-01 17:03:12.123)# %d.%us :时间格式(2012-01-01 17:03:12.123456)# %m :用户日志(必须)# %n :换行符(必须)# %p :进程id# %t :线程id# %U :协程id# %V :日志级别,大写# %v :日志级别,小写# %F :源代码文件名# %L :源代码行数log_rotation_size = 500MB# 日志文件自动转存大小(转存文件后缀数字越大,日志时间越新).# 设置为0, 则关闭此功能.log_max_rotation_file_num = 0# 转存文件最大保留个数(设置的值大于1时, 此功能生效).# 当转存文件达到设置的个数时,依次自动删除最旧的文件.# 当日志文件比较重要时,请谨慎决定是否打开此功能.[Proxy]
listen_addresses = *
port = 5888
socket_dir = /tmpprocess_nums = 0# 负责处理会话的进程个数(建议设置为服务器核心数; 设置为0时, 自动获取CPU核心数进行设置)session_balance = on# 以轮询的的方式使进程间处理的会话尽量均衡process_bind_cpu = off# 负责处理会话的进程, 是否绑定CPU运行extension_module = librwsplit.so# hgproxy扩展模块, 目前只有读写分离模块,默认即可auto_replace_application_name = "hgproxy: app[__IP__:__PORT__:__ORIGINAL__]"# 自动修改 application_name 参数.# __IP__ : 应用的IP.# __PORT__ : 应用的端口.# __ORIGINAL__ : 原始数据.# 注意:由于数据库限制,开启此功能后,hgproxy会添加额外的信息,因此应用可自定义设置的 application_name 字符串会减少。# 参数值设置为空,则关闭此功能use_mctx = off# 使用内存上下文机制管理内存transaction_mode = Auto# Auto 事务内会进行读写分离,路由节点自动判断# Primary 事务内不进行读写分离,固定发往主节点read_write_separation = on# 读写分离开关# 该配置项支持使用 proxy_ctl reloadcfg 生效,无需重启[BackendNode]
node_num = 2# 后端节点数量load_balancing_mode = 1# 负载均衡模式(目前只有一种模式,默认即可)# 1:权重模式startup_check = off# 启动时, 检查配置的数据库是否能够连接hostname0 = x.x.0.101
port0 = 5866
backend_weigh0 = 1# hostnameN 第N个节点IP# portN 第N个节点端口# backend_weightN 第N个节点权重比hostname1 = x.x.0.102
port1 = 5866
backend_weigh1 = 1#hostname2 = 127.0.0.1
#port2 = 5868
#backend_weigh2 = 1read_timeout_close = 0# 当读取数据库超时自动断开连接.# 此值不能设置为负数,设置的值大于0时, 此功能生效.# 单位:秒,取值最大为604800(一周)standby_additional_check = "select count(pid) > 0 from pg_stat_wal_receiver;"# 备节点额外的检测# 请确保该SQL的返回结果为单行单列,且值为 t 或 f;[Replication]streaming_replication_delay_time = 100000# 假设流复制延迟时间, 单位: 微秒# 设置为 0 则关闭此功能# 取值范围: 0 - 3600000000(1小时)[DatabaseCheck]lifecheck_user = sysdba# 用于检测时的用户名lifecheck_dbname = highgo# 用于检测时的数据库lifecheck_time = 10# 连接间隔时间,取值范围 1 - 3600, 单位:秒lifecheck_num = 3# 连续连接失败指定次数,达到该次数,节点将置为异常, 取值范围 1 - 10[routing]
null_query_routing = both# 空语句发送的节点: primary/standby/both# 该配置项支持使用 proxy_ctl reloadcfg 生效,无需重启regex_routing_file =# 正则路由配置文件,配置模板文件见 etc/regex_routing_settings.json# 注意事项:请配置 json 文件绝对路径# 该配置项支持使用 proxy_ctl reloadcfg 生效,无需重启routing_unnamed_parse_to_both = no# 未命名的 parse 协议是否发送到双节点# 该配置项支持使用 proxy_ctl reloadcfg 生效,无需重启[BlackList]# 此配置参数未来会移除,建议使用 regex_routing_file 配置
ignore_regex_case = off# on: 匹配时忽略大小写# off: 匹配时不忽略大小写# 此配置参数未来会移除,建议使用 regex_routing_file 配置
black_regex_token_list =# 匹配到了发往主节点# 此配置参数未来会移除,建议使用 regex_routing_file 配置
white_regex_token_list =# 匹配成功发往备节点object_relationship_list = /usr/local/hgproxy/etc/object_relationship_list.json[watchdog]server_watchdog = on# 检测 hgproxy 端口是否可以连接server_watchdog_interval = 30# 检测时间间隔(秒)# 取值范围: 1 - 3600server_watchdog_auto_restart = on# 检测 hgproxy 端口不可用后, 是否自动重启 hgproxy.server_watchdog_failed_count = 3# 连续失败次数, 达到该计数后,# 如果 server_watchdog_auto_restart 为 on, 则会自动重启 hgproxy# 取值范围: 1 - 3600status_watchdog = on# 内部统计打印日志输出status_watchdog_interval = 60# 内部统计打印日志输出时间间隔(秒)# 取值范围: 1 - 3600status_watchdog_pretty_log = off# 是否对日志输出进行美化处理[SSL]
ssl_switch = offssl_cert = /usr/local/hgproxy/etc/server.crt
ssl_key = /usr/local/hgproxy/etc/server.key
ssl_ca_cert = /usr/local/hgproxy/etc/root.crt
ssl_ca_cert_dir = /usr/local/hgproxy/etcssl_ciphers = HIGH:MEDIUM:+3DES:!aNULL
ssl_prefer_server_ciphers = on
ssl_ecdh_curve = prime256v1
ssl_dh_params_file =[admin]virtual_database = hgproxy# 虚拟数据库, 无需数据中存在virtual_user = hgproxy# 虚拟用户, 无需数据中存在virtual_user_auth_method = password# 可选取值: "md5", "password"virtual_user_password = hgproxy@123# 如果 virtual_user_auth_method 配置为 md5,# md5密码生成方法: echo -n "123456hgproxy" | md5sum# 123456 是登录密码, hgproxy 是 virtual_user 配置的用户名
拷贝ssl证书文件
[root@xxdb01 etc]# cp /data/highgo/data/server.* /opt/HighGo/tools/hgproxy/etc/
[root@xxdb01 etc]# cp /data/highgo/data/root.crt /opt/HighGo/tools/hgproxy/etc/
初始化hgproxy
[root@hgdb01 etc]# /usr/local/hgproxy/bin/proxy_ctl init -h x.x.0.101 -U sysdba -d highgo -p 5866
ip == [x.x.0.101]
port == [5866]
database == [highgo]
username == [sysdba]please enter password:
init successfully
启动服务
[root@xxdb01 etc]# systemctl start hgproxy
验证登录
[root@xxdb01 etc]# psql highgo sysdba -p 5888
3.注意事项
1、如果用的是tar包安装,etcd.service和hghac.service需要手动拷贝到/usr/lib/systemd/system/文件夹下
# cp /usr/local/hghac/etcd/etcd.service /usr/lib/systemd/system/
# cp /usr/local/hghac/hac/hghac.service /usr/lib/systemd/system/
# systemctl daemon-reload
2、关闭服务时先停止hghac.service,再关闭etcd.service,防止数据库都变成备库模式。
3、注意备份原集群配置文件,参数尽量保持与原配置相同。
相关文章:
hghac和hgproxy版本升级相关操作和注意事项
文章目录 环境文档用途详细信息 环境 系统平台:N/A 版本:4.5.6,4.5.7,4.5.8 文档用途 本文档用于高可用集群环境中hghac组件和hgproxy组件替换和升级操作 详细信息 1.关闭服务 所有数据节点都执行 1、关闭hgproxy服务 [roothgdb01 tools]# system…...
【超分辨率专题】一种考量视频编码比特率优化能力的超分辨率基准
这是一个Benchmark,超分辨率视频编码(2024) 专题介绍一、研究背景二、相关工作2.1 SR的发展2.2 SR benchmark的发展 三、Benchmark细节3.1 数据集制作3.2 模型选择3.3 编解码器和压缩标准选择3.4 Benchmark pipeline3.5 质量评估和主观评价研…...
操作系统之进程和线程听课笔记
计算机的上电运行就是构建进程树,进程调度就是在进程树节点进程进行切换 进程间通信的好处 经典模型 生产者和消费者 进程和线程的区别 线程引入带来的问题线程的优势 由于unix70年代产生,90年代有线程,当时数据库系统操作需要线程,操作系统没有来得及重造,出现了用户态线…...
Mac安装Navicat16
我的电脑用的是M3芯片,然后在安装的时候也踩了很多的坑 先分享一下链接 通过网盘分享的文件:Navicat Premium v16.2.dmg 链接: https://pan.baidu.com/s/1ENLtU7VLCvzntLKqSyFiqg?pwd1234 提取码: 1234 其实按理说用navicat17也是可以的 首先下载完成后…...
表的设计、聚合函数
目录 1、表的设计 1.1、一对一 1.2、一对多 1.3、多对多 2、插入查询结果 3、聚合查询 3.1、聚合函数 3.2、GROUP BY子句 1、表的设计 根据实际的需求场景,明确当前要创建几个表,每个表什么样子,这些表之间是否存在一定联系 1. 梳理…...
React学习———React Router
React Router React Router 是 React 应用中用于管理路由的流行库,它允许你在单页应用(SPA)中实现导航和页面切换而无需重新加载页面。 安装 npm install react-router-dom核心组件 <BrowserRouter> 使用HTML5的历史记录API&#…...
【前端】[vue3] [uni-app]使用 vantUI 框架
npm 安装: npm i vant/weapp -S --productionmain.js 中挂载 App.vue 引入 vantUI 样式 完成:...
upload-labs通关笔记-第8关 文件上传之点绕过
目录 一、点绕过原理 二、deldot()函数 三、源码分析 四、渗透实战 1、构建脚本test8.php 2、打开靶场 3、bp开启拦截 4、点击上传 5、bp拦截 6、后缀名增加点 7、发包并获取脚本地址 8、访问脚本 本文通过《upload-labs靶场通关笔记系列》来进行upload-labs靶场的渗…...
XML简要介绍
实际上现在的Java Web项目中更多的是基于springboot开发的,所以很少再使用xml去配置项目。所以我们的目的就是尽可能快速的去了解如何读懂和使用xml文件,对于DTD,XMLSchema这类约束的学习可以放松,主要是确保自己知道这里面的大致…...
我设计的一个安全的 web 系统用户密码管理流程
作为一名有多年经验的前端,在刚开始学习web后端的时候,就对如何设计一个安全的 web 系统用户密码管理流程有很多疑问。之前自己也实践过几种方法,但一直觉得不是十分安全。 我们知道,用户在注册或登录界面填写的密码是明文的&…...
事件驱动架构:从传统服务到实时响应的IT新风潮
文章目录 事件驱动架构的本质:从请求到事件的范式转变在EDA中: 事件驱动架构的演进:从消息队列到云原生标配核心技术:事件驱动架构的基石与工具链1. 消息队列:事件传递的枢纽2. 消费者:异步处理3. 事件总线…...
YOLOv11改进 | Neck篇 | 轻量化跨尺度跨通道融合颈部CCFM助力YOLOv11有效涨点
YOLOv11改进 | Neck篇 | 轻量化跨尺度跨通道融合颈部CCFM助力YOLOv11有效涨点 引言 在目标检测领域,YOLO系列算法因其卓越的速度-精度平衡而广受欢迎。YOLOv11作为该系列的最新演进版本,在Neck部分引入了创新的跨尺度跨通道融合模块(CCFM, Cross-scale…...
Unity:场景管理系统 —— SceneManagement 模块
目录 🎬 什么是 Scene(场景)? Unity 项目中的 Scene 通常负责什么? 🌍 一个 Scene 包含哪些元素? Scene 的切换与管理 📁 如何创建与管理 Scenes? 什么是Scene Man…...
官方 Elasticsearch SQL NLPChina Elasticsearch SQL
官方的可以在kibana 控制台上进行查询: POST /_sql { “query”: “SELECT client_ip, status FROM logs-2024-05 WHERE status 500” } NLPChina Elasticsearch SQL就无法以在kibana 控制台上进行查询,但是可以使用postman接口进行查询:...
Kubernetes 1.28 无 Docker 运行时环境下的容器化构建实践:Kaniko + Jenkins 全链路详解
背景说明 随着 Kubernetes 1.28 正式弃用 Docker 作为默认容器运行时(CRI 规范演进),传统的 docker build 方式已无法直接在集群内运行。Kaniko 作为 Google 开源的容器镜像构建工具,凭借其无需特权容器、兼容 OCI 标准的特性&am…...
【Linux】序列化与反序列化、会话与进程组、守护进程
一.序列化和反序列化 协议其实就是结构化的数据。但是再网络通信中,我们不直接发送结构化的数据给对方。我们一般会将结构化的数据序列化成字符串/字节流,然后通过网络在发送出去。而接收方收到之后,要对收到的字符串/流式数据进行反序列化&…...
Python机器学习笔记(二十五、算法链与管道)
对于许多机器学习算法,特定数据表示非常重要。首先对数据进行缩放,然后手动合并特征,再利用无监督机器学习来学习特征。因此,大多数机器学习应用不仅需要应用单个算法,而且还需要将许多不同的处理步骤和机器学习模型链接在一起。Pipeline类可以用来简化构建变换和模型链的…...
自媒体工作室如何矩阵?自媒体矩阵养号策略
一、自媒体工作室矩阵搭建方法 1.纵向矩阵:在主流平台都开设账号,覆盖不同用户触达场景。 短视频:抖音、快手、视频号(侧重私域沉淀) 2.主账号导流:通过关联账号、评论区跳转链接实现流量互通 本地生活…...
Pywinauto:轻松实现Windows桌面自动化实战
你是否厌倦了每天重复点击软件界面的枯燥操作?是否希望能像自动化网页那样,轻松控制桌面程序?在自动化测试逐渐扩展到客户端桌面的今天,你还不知道 pywinauto,就真的落后了! 手动测试Windows桌面应用&…...
告别传统的防抖机制,提交按钮的新时代来临
目录 背景 目标 核心代码 样式定义:让图标居中、响应父级颜色 SVG 图标:轻量、无依赖的 loading 图标 指令注册:全局注册 v-bLoading DOM 操作:添加与清除 loading 图标 1. 添加 loading 图标 2. 清除 loading 图标 动画…...
【Linux】Linux安装并配置MongoDB
目录 1.添加仓库 2.安装 MongoDB 包 3.启动 MongoDB 服务 4. 验证安装 5.配置 5.1.进入无认证模式 5.2.1创建用户 5.2.2.开启认证 5.2.3重启 5.2.4.登录 6.端口变更 7.卸载 7.1.停止 MongoDB 服务 7.2.禁用 MongoDB 开机自启动 7.3.卸载 MongoDB 包 7.4.删除数…...
PT2031K单触控单输出触摸IC
1.产品概述 ● PT2031K是一款电容式触摸控制ASIC,支持单通道触摸输入和单路同步开关输出。适用于雾化器、车载用品、电子玩具、消费类电子产品等领域,具有低功耗、高抗干扰、宽工作电压范围的突出优势。 2.主要特性 ● 工作电压范围:2.4~5.5…...
MySQL 与 FastAPI 交互教程
目录 1. 使用 Docker 启动 MySQL2. 创建 FastAPI 应用安装必要的依赖创建项目结构创建数据库连接模块创建数据模型创建 Pydantic 模型(用于请求和响应)创建主应用 3. 运行和测试应用启动应用访问 API 文档 4. 测试 API 端点创建用户获取所有用户获取特定…...
分布式 ID 生成的五种方法:优缺点与适用场景
0.简介 在分布式系统中,生成全局唯一的id是一个常见的需求。由于分布式系统的特性(多节点,网络分区,时钟不同步等),传统的单机ID生成方式不再适用,所以一些分布式生成方式应运而生,…...
ES(Elasticsearch)的应用与代码示例
Elasticsearch应用与代码示例技术文章大纲 一、引言 Elasticsearch在现代化应用中的核心作用典型应用场景分析(日志分析/全文检索/数据聚合) 二、环境准备(前提条件) Elasticsearch 8.x集群部署要点IK中文分词插件配置指南Ingest Attachment插件安装…...
MinIO 开源的分布式文件服务器
如下是java代码调用MinIO的SDK实现文件的上传,并获取url <dependency><groupId>com.squareup.okhttp3</groupId><artifactId>okhttp</artifactId><version>4.9.3</version> <!-- 你可以选择4.8.1或更高版本 --></dependenc…...
蓝牙AVRCP协议概述
AVRCP(Audio/Video Remote Control Profile)定义了蓝牙设备和 audio/video 控制功能通信的特 点和过程,另用于远程控制音视频设备,底层传输基于 AVCTP 传输协议。该 Profile 定义了AV/C 数字命令控制集。命令和信息通过 AVCTP(Audio/Video Control Trans…...
【全网首发】解决coze工作流批量上传excel数据文档数据重复的问题
注意:目前方法将基于前一章批量数据库导入的修改!!!!请先阅读上篇文章的操作。抄袭注明来源 背景 上一节说的方法可以批量导入文件到数据库,但是无法解决已经上传的条目更新问题。简单来说,不…...
Hue面试内容整理-Hue 架构与前后端通信
Cloudera Hue 是一个基于 Web 的 SQL 助手,旨在为数据分析师和工程师提供统一的界面,以便与 Hadoop 生态系统中的各个组件(如 Hive、Impala、HDFS 等)进行交互。其架构设计强调前后端的分离与高效通信,确保系统的可扩展性和可维护性。以下是 Hue 架构及其前后端通信机制的…...
【八股战神篇】Java高频基础面试题
1 面向对象编程有哪些特性? 面向对象编程(Object-Oriented Programming,简称 OOP)是一种以对象为核心的编程范式,它通过模拟现实世界中的事物及其关系来组织代码。OOP 具有三大核心特性:封装、继承、多态。…...
matlab建立整车模型,求汽车的平顺性
在MATLAB中建立整车模型评估汽车平顺性,通常采用多自由度振动模型。以下是基于四分之一车模型的详细步骤和代码示例,可扩展至整车模型。 1. 四分之一车模型(简化版) 模型描述 自由度:2个(车身垂直位移 z2…...
在Linux服务器上部署Jupyter Notebook并实现ssh无密码远程访问
Jupyter notebook版本7.4.2(这个版本AI提示我Jupyter7(底层是 jupyter_server 2.x) 服务器开启服务 安装Jupyter notebook 7.4.2成功后,终端输入 jupyter notebook --generate-config 这将在 ~/.jupyter/ 目录下生成 jupyter_…...
C#数组与集合
🧠 一、数组(Array) 1. 定义和初始化数组 // 定义并初始化数组 int[] numbers new int[5]; // 默认值为 0// 声明并赋值 string[] names { "Tom", "Jerry", "Bob" };// 使用 new 初始化 double[] scores …...
服务器内部可以访问外部网络,docker内部无法访问外部网络,只能docker内部访问
要通过 iptables 将容器中的特定端口请求转发到特定服务器,你需要设置 DNAT(目标地址转换)规则。以下是详细步骤: 假设场景 容器端口: 8080(容器内服务监听的端口)目标服务器: 192.168.1.100(请…...
mathematics-2024《Graph Convolutional Network for Image Restoration: A Survey》
推荐深蓝学院的《深度神经网络加速:cuDNN 与 TensorRT》,课程面向就业,细致讲解CUDA运算的理论支撑与实践,学完可以系统化掌握CUDA基础编程知识以及TensorRT实战,并且能够利用GPU开发高性能、高并发的软件系统…...
ssti刷刷刷
[NewStarCTF 公开赛赛道]BabySSTI_One 测试发现过滤关键字,但是特殊符号中括号、双引号、点都能用 可以考虑拼接或者编码,这里使用拼接 ?name{{()["__cla"~"ss__"]}}?name{{()["__cla"~"ss__"]["__ba&…...
Zephyr OS Nordic芯片的Flash 操作
目录 概述 1. 软硬件环境 1.1 软件开发环境 1.2 硬件环境 2 Flash操作库函数 2.1 nRF52832的Flash 2.2 Nordic 特有的 Flash 操作 2.2.1 nrfx_nvmc_bytes_write 函数 2.2.2 nrfx_nvmc_page_erase函数 2.2.3 nrfx_nvmc_write_done_check 函数 3 操作Flash的接口函数…...
傅里叶变换实战:图像去噪与边缘提取
傅里叶变换在图像处理中的应用与实践详解(超详细教程实战代码) 🚀 本文从零开始详解傅里叶变换在图像处理中的应用,手把手教你实现图像去噪与边缘提取!全文配套Python代码,新手也能轻松上手! 一…...
go-中间件的使用
中间件介绍 Gin框架允许开发者在处理请求的过程中加入用户自己的钩子(Hook)函数这个钩子函数就是中间件,中间件适合处理一些公共的业务逻辑比如登录认证,权限校验,数据分页,记录日志,耗时统计 1.定义全局中间件 pac…...
昇腾NPU环境搭建
如果进入服务器输入npu-smi info可以看到npu情况,请直接跳转第三步 STEP1: 服务器安装依赖 sudo yum install -y gcc gcc-c make cmake unzip zlib-devel libffi-devel openssl-devel pciutils net-tools sqlite-devel lapack-devel gcc-gfortran python3-develyu…...
【HTML5学习笔记2】html标签(下)
1表格标签 1.1表格作用 显示数据 1.2基本语法 <table><tr> 一行<td>单元格1</td></tr> </table> 1.3表头单元格标签 表头单元格会加粗并且居中 <table><tr> 一行<th>单元格1</th></tr> </table&g…...
开源轻量级地图解决方案leaflet
Leaflet 地图:开源轻量级地图解决方案 Leaflet 是一个开源的 JavaScript 库,用于在网页中嵌入交互式地图。它以轻量级、灵活性和易用性著称,适用于需要快速集成地图功能的项目。以下是关于 Leaflet 的详细介绍和使用指南。 1. Leaflet 的核心…...
LLM学习笔记(六)线性代数
公式速查表 1. 向量与矩阵:表示、转换与知识存储的基础 向量表示 (Vectors): 语义的载体 在LLM中,向量 x ∈ R d \mathbf{x}\in\mathbb{R}^d x∈Rd 是信息的基本单元,承载着丰富的语义信息: 词嵌入向量 (Word Embeddings)&am…...
Vue 3.0双向数据绑定实现原理
Vue3 的数据双向绑定是通过响应式系统来实现的。相比于 Vue2,Vue3 在响应式系统上做了很多改进,主要使用了 Proxy 对象来替代原来的 Object.defineProperty。本文将介绍 Vue3 数据双向绑定的主要特点和实现方式。 1. 响应式系统 1.1. Proxy对象 Vue3 …...
Quasar组件 Carousel走马灯
通过对比两个q-carousel组件来,了解该组件的属性 官方文档请参阅:Carousel 预览 源代码 <template><div class"q-pa-md"><div class"q-gutter-md"><q-carouselv-model"slide"transition-prev&quo…...
Vue 2.0学习
个人简介 👨💻个人主页: 魔术师 📖学习方向: 主攻前端方向,正逐渐往全栈发展 🚴个人状态: 研发工程师,现效力于政务服务网事业 🇨🇳人生格言&…...
LangFlow技术深度解析:可视化编排LangChain应用的新范式 -(3)组件系统
Component System | langflow-ai/langflow | DeepWiki 组件系统 相关源文件 组件系统是核心基础设施,使 Langflow 能够在工作流中创建、配置和连接模块化构建块。该系统通过为组件提供一致的接口来定义其输入、输出、执行行为以及与其他组件的连接,从…...
【Win32 API】 lstrcmpA()
作用 比较两个字符字符串(比较区分大小写)。 lstrcmp 函数通过从第一个字符开始检查,若相等,则检查下一个,直到找到不相等或到达字符串的末尾。 函数 int lstrcmpA(LPCSTR lpString1, LPCSTR lpString2); 参数 lpStr…...
LabVIEW光谱检测系统
腔衰荡光谱技术(CRDS)凭借高精度和高灵敏度特性,成为微量气体浓度检测的常用方法,而准确获取衰荡时间是该技术应用的关键。基于LabVIEW平台设计腔衰荡信号在线处理系统,实现对衰荡信号的实时采集、平均、拟合、显示和保…...
深入解读WPDRRC信息安全模型:构建中国特色的信息安全防护体系
目录 前言1 WPDRRC模型概述2 模型结构详解2.1 预警(Warning)2.2 保护(Protect)2.3 检测(Detect)2.4 响应(React)2.5 恢复(Restore)2.6 反击(Count…...