Thingworx高可用集群部署(四)-Pgpool-II安装

主机:10.10.10.71、10.10.10.72、10.10.10.73 VIP: 10.10.10.101

用户:postgres

配置互信

passwd postgres
密码 postgres
vi /etc/sudoers
postgres         ALL=(ALL)       NOPASSWD: ALL
su - postgres
ssh-keygen
ssh-keygen -t rsa -f .ssh/id_rsa_pgpool
ssh-copy-id -i .ssh/id_rsa_pgpool.pub 10.10.10.71
ssh-copy-id -i .ssh/id_rsa_pgpool.pub 10.10.10.72
ssh-copy-id -i .ssh/id_rsa_pgpool.pub 10.10.10.73测试
ssh -i ~/.ssh/id_rsa_pgpool 10.10.10.71 date
ssh -i ~/.ssh/id_rsa_pgpool 10.10.10.72 date
ssh -i ~/.ssh/id_rsa_pgpool 10.10.10.73 date

配置pgpass

su - postgres
echo "10.10.10.71:5432:replication:repuser:Repuser@2024_RP" >> ~/.pgpass
echo "10.10.10.72:5432:replication:repuser:Repuser@2024_RP" >> ~/.pgpass
echo "10.10.10.73:5432:replication:repuser:Repuser@2024_RP" >> ~/.pgpass
echo "10.10.10.71:5432:postgres:postgres:Postgres@2024_PG" >> ~/.pgpass
echo "10.10.10.72:5432:postgres:postgres:Postgres@2024_PG" >> ~/.pgpass
echo "10.10.10.73:5432:postgres:postgres:Postgres@2024_PG" >> ~/.pgpass
chmod 600 ~/.pgpass

pcp免密

echo 'localhost:9898:postgres:postgres' > ~/.pcppass
chmod 600 ~/.pcppass

安装pgpool-II

yum install -y https://www.pgpool.net/yum/rpms/4.1/redhat/rhel-7-x86_64/pgpool-II-release-4.1-3.noarch.rpmrpm -e pgdg-redhat-repo-42.0-28.noarch-- 4.1.14
yum -y install pgpool-II-pg12
yum -y install pgpool-II-pg12-debuginfo
yum -y install pgpool-II-pg12-devel
yum -y install pgpool-II-pg12-extensions

授权

chown postgres.postgres /var/run/pgpool
mkdir -p /var/log/pgpool/
chown -R postgres.postgres /var/log/pgpool/cd  /etc/pgpool-II
cp failover.sh.sample failover.sh
cp follow_master.sh.sample follow_master.sh
cp recovery_1st_stage.sample recovery_1st_stage
cp pgpool_remote_start.sample pgpool_remote_startchown postgres.postgres /etc/pgpool-II/{failover.sh,follow_master.sh,recovery_1st_stage,pgpool_remote_start} -R
chmod u+x /etc/pgpool-II/{failover.sh,follow_master.sh,recovery_1st_stage,pgpool_remote_start} -Rchmod u+x /usr/sbin/ip
chmod u+s /usr/sbin/arping
chmod u+s /sbin/ip
chmod u+s /sbin/ifup
chmod u+s /bin/ping
chmod u+s /sbin/arping

配置pcp.conf

pg_md5 Postgres@2024_PG vi /etc/pgpool-II/pcp.confecho "postgres:0b4854363bbbde1021c518850f0e5f32" >> /etc/pgpool-II/pcp.confpg_md5 -m -p -u postgres /etc/pgpool-II/pool_passwd
Postgres@2024_PG pg_md5 -m -p -u twadmin /etc/pgpool-II/pool_passwd
TW_admin@2024_TH

配置hba.conf

vi /etc/pgpool-II/pool_hba.confhost    all         all         0.0.0.0/0          md5
host    all         all         0/0                md5

配置pgpool.conf

vi pgpool.conf

pid_file_name = '/var/run/pgpool/pgpool.pid'
logdir = '/var/run/pgpool' 
listen_addresses = '*'
port = 9999
pcp_listen_addresses = '*'
pcp_port = 9898backend_hostname0 = '10.10.10.71'           
backend_port0 = 5432
backend_weight0 = 1        
backend_data_directory0 = '/data/pg_data'
backend_flag0 = 'ALLOW_TO_FAILOVER'backend_hostname1 = '10.10.10.72'     
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/data/pg_data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_application_name0 = 'server1'backend_hostname2 = '10.10.10.73'  
backend_port2 = 5432
backend_weight2 = 1
backend_data_directory2 = '/data/pg_data'
backend_flag2 = 'ALLOW_TO_FAILOVER'
backend_application_name0 = 'server2'

流复制相关配置

replication_mode = off  
load_balance_mode = on 
master_slave_mode = on
master_slave_sub_mode = 'stream' 
sr_check_period = 5 
sr_check_user = 'repuser'
sr_check_password = 'Repuser@2024_RP'
sr_check_database = 'postgres'

数据库故障转移(故障后处理)

health_check_period = 10 
health_check_timeout = 20 
health_check_user = 'postgres'
health_check_password = 'Postgres@2024_PG' 
health_check_database = 'postgres' failover_command = '/etc/pgpool-II/failover.sh %d %h %p %D %m %H %M %P %r %R' 
follow_master_command = '/etc/pgpool-II/follow_master.sh %d %h %p %D %m %H %M %P %r %R'  recovery_user = 'postgres'
recovery_password = 'Postgres@2024_PG'
recovery_1st_stage_command = 'recovery_1st_stage' watchdog(看门狗)配置(用于检测pgpool-ii 节点状态, 为后续pgpool故障处理提供依据)
use_watchdog = on
wd_hostname = '10.10.10.71' 
wd_port = 9000 

虚拟IP指定

delegate_IP = '10.10.10.101'if_cmd_path = '/sbin'   
if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev ens192 label ens192:0'
if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev ens192'
arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I ens192'

watchdog 健康检查

wd_heartbeat_port = 9694 
wd_heartbeat_keepalive = 2
wd_heartbeat_deadtime = 30heartbeat_destination0 = '10.10.10.72'
heartbeat_destination_port0 = 9694
heartbeat_device0 = 'ens192'heartbeat_destination0 = '10.10.10.73'
heartbeat_destination_port0 = 9694
heartbeat_device0 = 'ens192'

其他pgpgool节点链接信息(多台请增加配置)

other_pgpool_hostname0 = '10.10.10.72'
other_pgpool_port0 = 9999
other_wd_port0 = 9000

watchdog 发生故障后, 处理的相关配置(宕机, pgpool进程终止)# 当某个节点故障后

other_pgpool_hostname1 = '10.10.10.73'
other_pgpool_port1 = 9999
other_wd_port1 = 9000      
failover_when_quorum_exists = on
failover_require_consensus = on
allow_multiple_failover_requests_from_node = on
enable_consensus_with_half_votes = on

修改failover.sh

PGHOME=/usr/pgsql-12
REPL_SLOT_NAME=${FAILED_NODE_HOST//[-.]/_}
POSTGRESQL_STARTUP_USER=postgres
SSH_KEY_FILE=id_rsa_pgpoolssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${NEW_MASTER_NODE_HOST} ${PGHOME}/bin/psql -p ${NEW_MASTER_NODE_PORT} -c \"select pg_promote\(true,30\)\"

修改follow_master.sh

#!/bin/bash
# This script is run after failover_command to synchronize the Standby with the new Primary.
# First try pg_rewind. If pg_rewind failed, use pg_basebackup.set -o xtrace
exec > >(logger -i -p local1.info) 2>&1# Special values:
# 1)  %d = node id
# 2)  %h = hostname
# 3)  %p = port number
# 4)  %D = database cluster path
# 5)  %m = new primary node id
# 6)  %H = new primary node hostname
# 7)  %M = old master node id
# 8)  %P = old primary node id
# 9)  %r = new primary port number
# 10) %R = new primary database cluster path
# 11) %N = old primary node hostname
# 12) %S = old primary node port number
# 13) %% = '%' characterNODE_ID="$1"
NODE_HOST="$2"
NODE_PORT="$3"
NODE_PGDATA="$4"
NEW_MASTER_NODE_ID="$5"
NEW_MASTER_NODE_HOST="$6"
OLD_MASTER_NODE_ID="$7"
OLD_PRIMARY_NODE_ID="$8"
NEW_MASTER_NODE_PORT="$9"
NEW_MASTER_NODE_PGDATA="${10}"PGHOME=/usr/pgsql-12
ARCHIVEDIR=/data/pg_arch
REPLUSER=repuser
REPLUSER_PD=Repuser@2024_RP
PCP_USER=postgres
PG_USER=postgres
PG_PD=Postgres@2024_PG
PGPOOL_PATH=/usr/bin
PCP_PORT=9898
REPL_SLOT_NAME=${NODE_HOST//[-.]/_}
POSTGRESQL_STARTUP_USER=postgres
SSH_KEY_FILE=id_rsa_pgpool
SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}"logger -i -p local1.info follow_master.sh: start: Standby node ${NODE_ID}# Check the connection status of Standby
${PGHOME}/bin/pg_isready -h ${NODE_HOST} -p ${NODE_PORT} > /dev/null 2>&1if [ $? -ne 0 ]; thenlogger -i -p local1.info follow_master.sh: node_id=${NODE_ID} is not running. skipping follow master commandexit 0
fi## Test passwordless SSH
ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${NEW_MASTER_NODE_HOST} ls /tmp > /dev/nullif [ $? -ne 0 ]; thenlogger -i -p local1.info follow_master.sh: passwordless SSH to postgres@${NEW_MASTER_NODE_HOST} failed. Please setup passwordless SSH.exit 1
fi## Get PostgreSQL major version
PGVERSION=`${PGHOME}/bin/initdb -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'`if [ $PGVERSION -ge 12 ]; thenRECOVERYCONF=${NODE_PGDATA}/myrecovery.conf
elseRECOVERYCONF=${NODE_PGDATA}/recovery.conf
fi# Synchronize Standby with the new Primary.
logger -i -p local1.info follow_master.sh: pg_rewind for node $NODE_ID# Create replication slot "${REPL_SLOT_NAME}"
${PGHOME}/bin/psql -h ${NEW_MASTER_NODE_HOST} -p ${NEW_MASTER_NODE_PORT} \-c "SELECT pg_create_physical_replication_slot('${REPL_SLOT_NAME}');"  >/dev/null 2>&1if [ $? -ne 0 ]; thenlogger -i -p local1.error follow_master.sh: create replication slot \"${REPL_SLOT_NAME}\" failed. You may need to create replication slot manually.
fissh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${NODE_HOST} "set -o errexit${PGHOME}/bin/pg_ctl -w -m f -D ${NODE_PGDATA} stop${PGHOME}/bin/pg_rewind -D ${NODE_PGDATA} --source-server=\"user=${PG_USER} password=${PG_PD} host=${NEW_MASTER_NODE_HOST} port=${NEW_MASTER_NODE_PORT}\"rm -rf ${NODE_PGDATA}/pg_replslot/*sed -i '/primary_conninfo/d' ${NODE_PGDATA}/postgresql.auto.confcat >> ${NODE_PGDATA}/postgresql.auto.conf << EOT
primary_conninfo = 'user=${REPLUSER} password=${REPLUSER_PD} host=${NEW_MASTER_NODE_HOST} port=${NEW_MASTER_NODE_PORT} sslmode=prefer sslcompression=0 gssencmode=prefer krbsrvname=postgres target_session_attrs=any'
EOTif [ ${PGVERSION} -ge 12 ]; thentouch ${NODE_PGDATA}/standby.signalecho \"standby_mode = 'on'\" > ${NODE_PGDATA}/standby.signalelseecho \"standby_mode = 'on'\" >> ${RECOVERYCONF}fi#${PGHOME}/bin/pg_ctl -l /dev/null -w -D ${NODE_PGDATA} startsudo systemctl restart postgresql-12"# If pg_rewind failed, try pg_basebackup
if [ $? -ne 0 ]; thenlogger -i -p local1.error follow_master.sh: end: pg_rewind failed. Try pg_basebackup.
fi# If start Standby successfully, attach this node
if [ $? -eq 0 ]; then# Run pcp_attact_node to attach Standby node to Pgpool-II.${PGPOOL_PATH}/pcp_attach_node -w -h localhost -U $PCP_USER -p ${PCP_PORT} -n ${NODE_ID}if [ $? -ne 0 ]; thenlogger -i -p local1.error follow_master.sh: end: pcp_attach_node failedexit 1fielse# If start Standby failed, drop replication slot "${REPL_SLOT_NAME}"${PGHOME}/bin/psql -h ${NEW_MASTER_NODE_HOST} -p ${NEW_MASTER_NODE_PORT} \-c "SELECT pg_drop_replication_slot('${REPL_SLOT_NAME}');"  >/dev/null 2>&1if [ $? -ne 0 ]; thenlogger -i -p local1.error follow_master.sh: drop replication slot \"${REPL_SLOT_NAME}\" failed. You may need to drop replication slot manually.filogger -i -p local1.error follow_master.sh: end: follow master command failedexit 1
filogger -i -p local1.info follow_master.sh: end: follow master command complete
exit 0

修改recovery_1st_stage

 #!/bin/bash# This script is executed by "recovery_1st_stage" to recovery a Standby node.set -o xtraceexec > >(logger -i -p local1.info) 2>&1PRIMARY_NODE_PGDATA="$1"DEST_NODE_HOST="$2"DEST_NODE_PGDATA="$3"PRIMARY_NODE_PORT="$4"DEST_NODE_ID="$5"DEST_NODE_PORT="$6"PRIMARY_NODE_HOST=$(hostname)PGHOME=/usr/pgsql-12ARCHIVEDIR=/data/pg_archREPLUSER=repuserREPLUSER_PD=Repuser@2024_RPREPL_SLOT_NAME=${DEST_NODE_HOST//[-.]/_}POSTGRESQL_STARTUP_USER=postgresSSH_KEY_FILE=id_rsa_pgpoolSSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}"logger -i -p local1.info recovery_1st_stage: start: pg_basebackup for Standby node $DEST_NODE_ID## Test passwordless SSHssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} ls /tmp > /dev/nullif [ $? -ne 0 ]; thenlogger -i -p local1.info recovery_1st_stage: passwordless SSH to postgres@${DEST_NODE_HOST} failed. Please setup passwordless SSH.exit 1fi## Get PostgreSQL major versionPGVERSION=`${PGHOME}/bin/initdb -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'`if [ $PGVERSION -ge 12 ]; thenRECOVERYCONF=${DEST_NODE_PGDATA}/myrecovery.confelseRECOVERYCONF=${DEST_NODE_PGDATA}/recovery.conffi## Create replication slot "${REPL_SLOT_NAME}"${PGHOME}/bin/psql -p ${PRIMARY_NODE_PORT} << EOQSELECT pg_create_physical_replication_slot('${REPL_SLOT_NAME}');EOQ## Execute pg_basebackup to recovery Standby nodessh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@$DEST_NODE_HOST "set -o errexitrm -rf $DEST_NODE_PGDATA/*rm -rf $ARCHIVEDIR/*${PGHOME}/bin/pg_basebackup -h $PRIMARY_NODE_HOST -U $REPLUSER -w -p $PRIMARY_NODE_PORT -D $DEST_NODE_PGDATA -X streamcat >> ${NODE_PGDATA}/postgresql.auto.conf << EOTprimary_conninfo = 'user=${REPLUSER} password=${REPLUSER_PD} host=${PRIMARY_NODE_HOST} port=${PRIMARY_NODE_PORT} sslmode=prefer sslcompression=0 gssencmode=prefer krbsrvname=postgres target_session_attrs=any'EOTif [ ${PGVERSION} -ge 12 ]; thentouch ${DEST_NODE_PGDATA}/standby.signalecho \"standby_mode = 'on'\" > ${NODE_PGDATA}/standby.signalelseecho \"standby_mode = 'on'\" >> ${RECOVERYCONF}fi"if [ $? -ne 0 ]; then${PGHOME}/bin/psql -p ${PRIMARY_NODE_PORT} << EOQSELECT pg_drop_replication_slot('${REPL_SLOT_NAME}');EOQlogger -i -p local1.error recovery_1st_stage: end: pg_basebackup failed. online recovery failedexit 1filogger -i -p local1.info recovery_1st_stage: end: recovery_1st_stage completeexit 0

修改pgpool_remote_start

#!/bin/bash
# This script is run after recovery_1st_stage to start Standby node.DEST_NODE_HOST="$1"
DEST_NODE_PGDATA="$2"PGHOME=/usr/pgsql-12
POSTGRESQL_STARTUP_USER=postgres
SSH_KEY_FILE=id_rsa_pgpool
SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}"logger -i -p local1.info pgpool_remote_start: start: remote start Standby node $DEST_NODE_HOST## Test passwordless SSH
ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} ls /tmp > /dev/nullif [ $? -ne 0 ]; thenlogger -i -p local1.info pgpool_remote_start: passwordless SSH to postgres@${DEST_NODE_HOST} failed. Please setup passwordless SSH.exit 1
fi## Start Standby node
ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} "#$PGHOME/bin/pg_ctl -l /dev/null -w -D $DEST_NODE_PGDATA startsudo systemctl restart postgresql-12
"if [ $? -ne 0 ]; thenlogger -i -p local1.error pgpool_remote_start: $DEST_NODE_HOST PostgreSQL start failed.exit 1
filogger -i -p local1.info pgpool_remote_start: end: $DEST_NODE_HOST PostgreSQL started successfully.
exit 0

recovery必须创建

su - postgrespsql template1 -c "CREATE EXTENSION pgpool_recovery"

拷贝文件

su - postgresscp /etc/pgpool-II/{pool_hba.conf,pcp.conf,pool_passwd,pgpool.conf,failover.sh,follow_master.sh} 10.10.10.72:/etc/pgpool-II/
scp /etc/pgpool-II/{pool_hba.conf,pcp.conf,pool_passwd,pgpool.conf,failover.sh,follow_master.sh} 10.10.10.73:/etc/pgpool-II/scp /etc/pgpool-II/{failover.sh,follow_master.sh,recovery_1st_stage,pgpool_remote_start} 10.10.10.72:/home/postgres
scp /etc/pgpool-II/{failover.sh,follow_master.sh,recovery_1st_stage,pgpool_remote_start} 10.10.10.73:/home/postgresmv /home/postgres/failover.sh /etc/pgpool-II/
mv /home/postgres/follow_master.sh /etc/pgpool-II/mv recovery_1st_stage /data/pg_data/
mv pgpool_remote_start /data/pg_data/

修改配置

#其他节点 修改以下几项即可vi pgpool.conf
wd_hostname = '10.10.10.72'               # 当前机器ip
wd_priority = 2heartbeat_destination0 = '10.10.10.71'  # 其他pg库机器(如10.10.10.71)
heartbeat_destination1 = '10.10.10.73'  # 其他pg库机器(如10.10.10.73)other_pgpool_hostname0 = '10.10.10.71'   # 其他pgpool节点机器
other_pgpool_hostname1 = '10.10.10.73'   # 其他pgpool节点机器

启动Pgpool-II

systemctl start pgpool.service 
systemctl status pgpool.service 

查看主节点

ip addrens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:50:56:96:d0:57 brd ff:ff:ff:ff:ff:ffinet 10.10.10.72/24 brd 10.10.243.255 scope global noprefixroute ens192valid_lft forever preferred_lft foreverinet 10.10.10.101/24 scope global secondary ens192:0valid_lft forever preferred_lft foreverinet6 fe80::250:56ff:fe96:d057/64 scope linkvalid_lft forever preferred_lft forever

集群维护

启动顺序:先启动所有的pg,再按照顺序启动pgpool
systemctl start postgresql-12
systemctl status postgresql-12systemctl start pgpool.service 
systemctl status pgpool.service关闭顺序:先顺序关闭pgpool,再关闭pg数据库
systemctl stop pgpool.service 
systemctl status pgpool.servicesystemctl stop postgresql-12
systemctl status postgresql-12

监控节点状态

psql -U postgres -h 10.10.10.101 -p 9999psql -h 10.10.10.101 -p9999 -Utwadmin -d thingworx
show pool_nodes;systemctl restart pgpool.service 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/758636.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【CNN轻量化】ParameterNet: Parameters Are All You Need 参数就是你所需要的

论文链接&#xff1a;http://arxiv.org/abs/2306.14525 代码链接&#xff1a;https://github.com/huawei-noah/Efficient-AI-Backbones 一、摘要 现有的低FLOPs模型&#xff08;轻量化模型&#xff09;无法从大规模预训练中受益。本文旨在增加大规模视觉预训练模型中的参数数量…

跟着cherno手搓游戏引擎【29】Batch简单合批

思路&#xff1a; CPU和GPU都开辟同样大小的一大块内存&#xff08;为了存储顶点信息&#xff09; 索引在程序运行时生成对应规则后绑定到索引缓冲中 动态生成顶点信息&#xff08;现在改成Drawquad只是确定图形顶点的位置&#xff09; 然后在Endscene&#xff0c;将CPU的动…

蓝桥杯之简单数论冲刺

文章目录 取模快速幂 取模 这道题目有两个注意点&#xff1a; 1.当你的取模之后刚好等于0的话&#xff0c;后面就不用进行后面的计算 2.if sum detail[i] > q: 这个语句的等号也很重要 import os import sys# 请在此输入您的代码a,b,n map(int,input().split())week a*5 …

从政府工作报告探计算机行业发展

政府工作报告作为政府工作的全面总结和未来规划&#xff0c;不仅反映了国家整体的发展态势&#xff0c;也为各行各业提供了发展的指引和参考。随着信息技术的快速发展&#xff0c;计算机行业已经成为推动经济社会发展的重要引擎之一。因此&#xff0c;从政府工作报告中探寻计算…

docker常用命令大全

服务相关命令​ 启动 docker 服务​ systemctl start docker 停止 docker 服务​ systemctl stop docker 重启 docker 服务​ systemctl restart docker 查看 docker 服务状态​ systemctl status docker 设置开机启动 docker 服务​ systemctl enable docker 镜像相…

初始Java篇(JavaSE基础语法)(2)

个人主页&#xff08;找往期文章包括但不限于本期文章中不懂的知识点&#xff09;&#xff1a;我要学编程(ಥ_ಥ)-CSDN博客 目录 逻辑控制 顺序结构 分支结构 if语句 switch 语句 循环结构 while 循环 for 循环 do while 循环 输入输出 输出到控制台 从键盘输入 …

详解隐私计算框架及技术要点

隐语架构一览 为什么这样分层&#xff1f; 完备性透明性开放性 隐语架构解析 产品层 算法层 隐语PSI特点 PIR Data Analysis SCQL 核心特性 联邦学习 特色 计算层 SPU 核心 HEU 同态加密设备 TEEU 密码原语 资源层 kuscia 互联互通 跨域管控 最后

ucloud、阿里云、硅云的香港服务器哪家更好?

近年香港云服务器比较受到外贸建站、企业建站人士的欢迎&#xff0c;其中Ucloud、硅云和阿里云三家的香港服务器比较火热&#xff0c;那么该三家的香港服务器有哪些特点呢&#xff1f; 1、ucloud香港服务器 优点&#xff1a;价格低廉 缺点&#xff1a;线路不稳&#xff0c;高…

在Java中对象与对象之间可以互相赋值吗?

在Java中&#xff0c;对象与对象之间可以互相赋值&#xff0c;但是这实际上是将对象的引用进行赋值&#xff0c;而不是对象本身的复制。当一个对象赋值给另一个对象时&#xff0c;它们将引用同一个内存地址&#xff0c;因此对其中一个对象的修改会影响到另一个对象。 例如&…

多家中国车企宣布将搭载英伟达最新车载芯片;Altman 曝全新 GPT-5 细节丨 RTE 开发者日报 Vol.168

开发者朋友们大家好&#xff1a; 这里是 「RTE 开发者日报」 &#xff0c;每天和大家一起看新闻、聊八卦。我们的社区编辑团队会整理分享 RTE &#xff08;Real Time Engagement&#xff09; 领域内「有话题的 新闻 」、「有态度的 观点 」、「有意思的 数据 」、「有思考的 文…

Linux环境开发工具之vim

前言 上一期我们已经介绍了软件包管理器yum&#xff0c; 已经可以在linux上查找、安装、卸载软件了&#xff0c;本期我们来介绍一下文本编辑器vim。 本期内容介绍 什么是vim vim的常见的模式以及切换 vim命令模式常见的操作 vim底行模式常见的操作 解决普通用户无法执行sudo问…

代码随想录打卡一刷总结篇

这两个月里我收获的还是蛮多的&#xff0c;系统的学完了数组、链表、哈希表、字符串、双指针法、栈与队列、二叉树、回溯算法、贪心算法、动态规划、单调栈这十一个板块。一路磕磕碰碰的走过来&#xff0c;中间有断过&#xff0c;后面也都花时间补上来了。如果自己一个人刷的话…

鸿蒙开发实战:【文件管理】

介绍 本示例主要展示了文件管理相关的功能&#xff0c;使用[ohos.multimedia.medialibrary]、[ohos.filemanagement.userFileManager] 、[ohos.fileio] 、[ohos.file.fs]、[ohos.app.ability.contextConstant] 等接口&#xff0c;实现了增添文件、删除文件、查找指定类型文件…

C/C++中枚举(enum)和结构体(struct)的异同

一、枚举 enum 1.普通枚举&#xff0c;枚举在C中使用比C使用简单 C语言: enum Color {red,green,blue }; enum Color c red;C语言 enum Color {red,green,blue }; Color c red;C认为这种枚举方式会污染名字&#xff0c;即&#xff1a;枚举使用的名字&#xff0c;在同一个作…

网络通信中的 payload 简介

在网络通信中&#xff0c;payload&#xff08;有效载荷&#xff09;是指数据包或消息中包含的实际业务数据部分。在数据传输过程中&#xff0c;一个完整的数据包通常由多个组成部分构成&#xff1a; 报头 (Header)&#xff1a;包含了用于路由、识别和处理数据包所需的所有控制信…

WRF高精度气象模拟技术及在地学领域中的应用

随着生态文明建设和“碳中和”战略的持续推进&#xff0c;我国及全球气候变化及应对是政府、科学界及商业界关注的焦点。气候是多个领域&#xff08;生态、水资源、风资源及碳中和等问题&#xff09;的主要驱动因素&#xff0c;合理认知气候变化有利于解释生态环境变化机理及过…

(56)删除每行中的最大值

文章目录 1. 每日一言2. 题目3. 解题思路4. 代码5. 结语 1. 每日一言 抱怨过去发生的一切&#xff0c;就等于丧失了力量&#xff0c;白白浪费了往事要带给我们的成长。 2. 题目 题目链接&#xff1a;删除每行中的最大值 给你一个 m x n 大小的矩阵 grid &#xff0c;由若干正…

python 常用装饰器

文章目录 property的介绍与使用作用使用场景装饰方法防止属性被修改 实现setter和getter的行为 staticmethod 与 classmethod作用代码示例 两者区别使用区别代码演示 abstractmethod参考资料 property的介绍与使用 python的property是python的一种装饰器&#xff0c;是用来修饰…

【动态规划】算法例题

目录 一维动态规划&#xff1a; 137. 爬楼梯 ① 138. 打家劫舍 ② 139. 单词拆分 ② 140. 零钱兑换 ② 141. 最长递增子序列 ② 多维动态规划&#xff1a; 142. 三角形最小路径和 ② 143. 最小路径和 ② 144. 不同路径 II ② 145. 最长回文子串 ② 146. 交错字符串…

SpringCloud-深度理解ElasticSearch

一、Elasticsearch概述 1、Elasticsearch介绍 Elasticsearch&#xff08;简称ES&#xff09;是一个开源的分布式搜索和分析引擎&#xff0c;构建在Apache Lucene基础上。它提供了一个强大而灵活的工具&#xff0c;用于全文搜索、结构化搜索、分析以及数据可视化。ES最初设计用…