首页 > 其他分享 >openGauss修改CM集群某个节点IP

openGauss修改CM集群某个节点IP

时间:2024-11-21 22:45:02浏览次数:1  
标签:testosa dn CM IP omm 192.168 1.81 openGauss opengauss

操作系统信息

[omm@testosa ~]$ arch
x86_64
[omm@testosa ~]$ uname -a
Linux testosa 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[omm@testosa ~]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[omm@testosa ~]$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[omm@testosa ~]$

集群信息

[omm@testosa ~]$ cm_ctl query -Cvdip
[ CMServer State ]

node node_ip instance state
---------------------------------------------------------------------
1 testosa 192.168.1.80 1 /opengauss/cmserver/cm_server Primary
2 testosb 192.168.1.81 2 /opengauss/cmserver/cm_server Standby
3 testosc 192.168.1.82 3 /opengauss/cmserver/cm_server Standby
4 testosd 192.168.1.83 4 /opengauss/cmserver/cm_server Standby

[ Cluster State ]

cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL

[ Datanode State ]

node node_ip instance state
--------------------------------------------------------------------------
1 testosa 192.168.1.80 6001 12345 /opengauss/data/dn P Primary Normal
2 testosb 192.168.1.81 6002 12345 /opengauss/data/dn S Standby Normal
3 testosc 192.168.1.82 6003 12345 /opengauss/data/dn S Standby Normal
4 testosd 192.168.1.83 6004 12345 /opengauss/data/dn C Cascade Standby Normal
[omm@testosa ~]$

版本信息

[omm@testosa ~]$ gs_ssh -c "gsql -d postgres -p 12345 -c \"select regexp_substr(version(),'.*\d{2} ') as version\""
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
version
-------------------------------------------------------------------
(openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06
(1 row)

[SUCCESS] testosb:
version
-------------------------------------------------------------------
(openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06
(1 row)

[SUCCESS] testosc:
version
-------------------------------------------------------------------
(openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06
(1 row)

[SUCCESS] testosd:
version
-------------------------------------------------------------------
(openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06
(1 row)

[omm@testosa ~]$
[omm@testosa ~]$ gs_ssh -c "gaussdb -V"
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
gaussdb (openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06 commit 0 last mr
[SUCCESS] testosb:
gaussdb (openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06 commit 0 last mr
[SUCCESS] testosc:
gaussdb (openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06 commit 0 last mr
[SUCCESS] testosd:
gaussdb (openGauss 3.0.3 build 46134f73) compiled at 2022-12-30 20:48:06 commit 0 last mr

[omm@testosa ~]$ gs_ssh -c "cm_ctl -V"
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
cm_ctl (openGauss CM 3.0.3 build 313feba8) compiled at 2022-12-30 20:58:21 Release
[SUCCESS] testosb:
cm_ctl (openGauss CM 3.0.3 build 313feba8) compiled at 2022-12-30 20:58:21 Release
[SUCCESS] testosc:
cm_ctl (openGauss CM 3.0.3 build 313feba8) compiled at 2022-12-30 20:58:21 Release
[SUCCESS] testosd:
cm_ctl (openGauss CM 3.0.3 build 313feba8) compiled at 2022-12-30 20:58:21 Release

[omm@testosa ~]$ gs_ssh -c "gs_om -V"
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
gs_om (openGauss OM 3.0.3 build 698397ea) compiled at 2022-12-30 20:58:12 commit 0 last mr
[SUCCESS] testosb:
gs_om (openGauss OM 3.0.3 build 698397ea) compiled at 2022-12-30 20:58:12 commit 0 last mr
[SUCCESS] testosc:
gs_om (openGauss OM 3.0.3 build 698397ea) compiled at 2022-12-30 20:58:12 commit 0 last mr
[SUCCESS] testosd:
gs_om (openGauss OM 3.0.3 build 698397ea) compiled at 2022-12-30 20:58:12 commit 0 last mr

[omm@testosa ~]$

测试说明

[root@testosb ~]# hostname
testosb
[root@testosb ~]# ifconfig|awk '/broadcast/ {print $2}'
192.168.1.81
[root@testosb ~]# cat /etc/hosts|grep testosb
192.168.1.81 testosb #Gauss OM IP Hosts Mapping
[root@testosb ~]#

如上testosb节点当前的IP地址为192.168.1.81,现在需要修改为192.168.1.90

测试过程

停止数据库集群

[omm@testosa ~]$ cm_ctl stop

修改主机IP信息

[root@testosb ~]# grep IPADDR /etc/sysconfig/network-scripts/ifcfg-ens33
IPADDR="192.168.1.81"
sed -i '/IPADDR/s/192.168.1.81/192.168.1.90/' /etc/sysconfig/network-scripts/ifcfg-ens33
[root@testosb ~]# sed -i '/IPADDR/s/192.168.1.81/192.168.1.90/' /etc/sysconfig/network-scripts/ifcfg-ens33
[root@testosb ~]# grep IPADDR /etc/sysconfig/network-scripts/ifcfg-ens33
IPADDR="192.168.1.90"

重启网络服务

systemctl restart network

查询ip信息

[root@testosb ~]# ifconfig|awk '/broadcast/ {print $2}'
192.168.1.90
[root@testosb ~]#

修改/etc/hosts文件

#将当前各个节点的/etc/hosts中的192.168.1.81替换为192.168.1.90
[root@testosa ~]# sed -i 's/192.168.1.81/192.168.1.90/' /etc/hosts
[root@testosb ~]# sed -i 's/192.168.1.81/192.168.1.90/' /etc/hosts
[root@testosc ~]# sed -i 's/192.168.1.81/192.168.1.90/' /etc/hosts
[root@testosd ~]# sed -i 's/192.168.1.81/192.168.1.90/' /etc/hosts

修复子用户互信

# 修改子用户互信的known_hosts文件
[omm@testosa ~]$ grep '192.168.1.81' /home/omm/.ssh/known_hosts
192.168.1.81 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJUFWSx4LdDZPSiG2YJL8e7elgSWhT7BiVADsZ1rVML1 #OM
[omm@testosa ~]$ sed -i 's/192.168.1.81/192.168.1.90/' /home/omm/.ssh/known_hosts
[omm@testosa ~]$ grep '192.168.1.81' /home/omm/.ssh/known_hosts
[omm@testosa ~]$

[omm@testosb ~]$ grep '192.168.1.81' /home/omm/.ssh/known_hosts
192.168.1.81 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJUFWSx4LdDZPSiG2YJL8e7elgSWhT7BiVADsZ1rVML1 #OM
[omm@testosb ~]$ sed -i 's/192.168.1.81/192.168.1.90/' /home/omm/.ssh/known_hosts
[omm@testosb ~]$ grep '192.168.1.81' /home/omm/.ssh/known_hosts
[omm@testosb ~]$

[omm@testosc ~]$ grep '192.168.1.81' /home/omm/.ssh/known_hosts
192.168.1.81 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJUFWSx4LdDZPSiG2YJL8e7elgSWhT7BiVADsZ1rVML1 #OM
[omm@testosc ~]$ sed -i 's/192.168.1.81/192.168.1.90/' /home/omm/.ssh/known_hosts
[omm@testosc ~]$ grep '192.168.1.81' /home/omm/.ssh/known_hosts
[omm@testosc ~]$

[root@testosd ~]# grep '192.168.1.81' /home/omm/.ssh/known_hosts
192.168.1.81 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJUFWSx4LdDZPSiG2YJL8e7elgSWhT7BiVADsZ1rVML1 #OM
[root@testosd ~]# sed -i 's/192.168.1.81/192.168.1.90/' /home/omm/.ssh/known_hosts
[root@testosd ~]# grep '192.168.1.81' /home/omm/.ssh/known_hosts
[root@testosd ~]#

# 检查子用户互信(四个节点都查询),保证子用户互信恢复正常
for i in {testosa,testosb,testosc,testosd,192.168.1.80,192.168.1.90,192.168.1.82,192.168.1.83};do
ssh $i hostname
done

修改各节点数据库配置文件

postgresql.conf

# 修改testosb节点数据库配置文件(将192.168.1.81修改为当前的192.168.1.90)
[omm@testosb dn]$ grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
listen_addresses = 'localhost,192.168.1.81' # what IP address(es) to listen on;
local_bind_address = '192.168.1.81'
replconninfo1 = 'localhost=192.168.1.81 localport=12346 localheartbeatport=12350 localservice=12349 remotehost=192.168.1.80 remoteport=12346 remoteheartbeatport=12350 remoteservice=12349' # replication connection information used to connect primary on standby, or standby on primary,
replconninfo2 = 'localhost=192.168.1.81 localport=12346 localheartbeatport=12350 localservice=12349 remotehost=192.168.1.82 remoteport=12346 remoteheartbeatport=12350 remoteservice=12349' # replication connection information used to connect secondary on primary or standby,
replconninfo3 = 'localhost=192.168.1.81 localport=12346 localheartbeatport=12350 localservice=12349 remotehost=192.168.1.83 remoteport=12346 remoteheartbeatport=12350 remoteservice=12349 iscascade=true' # replication connection information used to connect primary on standby, or standby on primary,

[omm@testosb dn]$ sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/postgresql.conf
[omm@testosb dn]$ grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
[omm@testosb dn]$

# 修改其他节点的数据库配置文件(将192.168.1.81修改为当前的192.168.1.90)
[omm@testosa ~]$ grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
replconninfo1 = 'localhost=192.168.1.80 localport=12346 localheartbeatport=12350 localservice=12349 remotehost=192.168.1.81 remoteport=12346 remoteheartbeatport=12350 remoteservice=12349' # replication connection information used to connect primary on standby, or standby on primary,
[omm@testosa ~]$ sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/postgresql.conf
[omm@testosa ~]$ grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
[omm@testosa ~]$

[root@testosc ~]# grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
replconninfo2 = 'localhost=192.168.1.82 localport=12346 localheartbeatport=12350 localservice=12349 remotehost=192.168.1.81 remoteport=12346 remoteheartbeatport=12350 remoteservice=12349' # replication connection information used to connect secondary on primary or standby,
[root@testosc ~]# sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/postgresql.conf
[root@testosc ~]# grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
[root@testosc ~]#

[root@testosd ~]# grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
replconninfo2 = 'localhost=192.168.1.83 localport=12346 localheartbeatport=12350 localservice=12349 remotehost=192.168.1.81 remoteport=12346 remoteheartbeatport=12350 remoteservice=12349' # replication connection information used to connect secondary on primary or standby,
[root@testosd ~]# sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/postgresql.conf
[root@testosd ~]# grep '192.168.1.81' /opengauss/data/dn/postgresql.conf
[root@testosd ~]#

修改各个节点pg_hba.conf文件

[omm@testosa dn]$ grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
host all omm 192.168.1.81/32 trust
host all all 192.168.1.81/32 sha256
[omm@testosa dn]$ sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/pg_hba.conf
[omm@testosa dn]$ grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
[omm@testosa dn]$

[omm@testosb dn]$ grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
host all omm 192.168.1.81/32 trust
host all all 192.168.1.81/32 sha256
[omm@testosb dn]$ sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/pg_hba.conf
[omm@testosb dn]$ grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
[omm@testosb dn]$

[root@testosc ~]# grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
host all omm 192.168.1.81/32 trust
host all all 192.168.1.81/32 sha256
[root@testosc ~]# sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/pg_hba.conf
[root@testosc ~]# grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
[root@testosc ~]#

[root@testosd ~]# grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
host all omm 192.168.1.81/32 trust
host all all 192.168.1.81/32 sha256
[root@testosd ~]# sed -i 's/192.168.1.81/192.168.1.90/' /opengauss/data/dn/pg_hba.conf
[root@testosd ~]# grep '192.168.1.81' /opengauss/data/dn/pg_hba.conf
[root@testosd ~]#

重新生成静态配置文件

如下可以看出静态配置文件里面存的还是旧的IP(192.168.1.81)需要修改为192.168.1.90

[omm@testosa dn]$ gs_om -t view|grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'
sshChannel 1:192.168.1.80
datanodeListenIP 1:192.168.1.80
datanodeLocalHAIP 1:192.168.1.80
datanodePeer0HAIP 1:192.168.1.81
datanodePeer1HAIP 1:192.168.1.82
datanodePeer2HAIP 1:192.168.1.83
sshChannel 1:192.168.1.81
datanodeListenIP 1:192.168.1.81
datanodeLocalHAIP 1:192.168.1.81
datanodePeer0HAIP 1:192.168.1.80
datanodePeer1HAIP 1:192.168.1.82
datanodePeer2HAIP 1:192.168.1.83
sshChannel 1:192.168.1.82
datanodeListenIP 1:192.168.1.82
datanodeLocalHAIP 1:192.168.1.82
datanodePeer0HAIP 1:192.168.1.80
datanodePeer1HAIP 1:192.168.1.81
datanodePeer2HAIP 1:192.168.1.83
sshChannel 1:192.168.1.83
datanodeListenIP 1:192.168.1.83
datanodeLocalHAIP 1:192.168.1.83
datanodePeer0HAIP 1:192.168.1.80
datanodePeer1HAIP 1:192.168.1.81
datanodePeer2HAIP 1:192.168.1.82
[omm@testosa dn]$

修改xml文件里面的IP

[omm@testosa dn]$ grep '192.168.1.81' /tmp/3standby_cm.xml
<PARAM name="backIp1s" value="192.168.1.80,192.168.1.81,192.168.1.82,192.168.1.83"/>
<PARAM name="cmServerListenIp1" value="192.168.1.80,192.168.1.81,192.168.1.82,192.168.1.83"/>
<PARAM name="cmServerHaIp1" value="192.168.1.80,192.168.1.81,192.168.1.82,192.168.1.83"/>
<PARAM name="backIp1" value="192.168.1.81"/>
<PARAM name="sshIp1" value="192.168.1.81"/>
[omm@testosa dn]$ sed -i 's/192.168.1.81/192.168.1.90/' /tmp/3standby_cm.xml
[omm@testosa dn]$ grep '192.168.1.81' /tmp/3standby_cm.xml
[omm@testosa dn]$

生成分发静态配置文件

[omm@testosa ~]$ gs_om -t generateconf -X /tmp/3standby_cm.xml --distribute
Generating static configuration files for all nodes.
Creating temp directory to store static configuration files.
Successfully created the temp directory.
Generating static configuration files.
Successfully generated static configuration files.
Static configuration files for all nodes are saved in /opengauss/om/script/static_config_files.
Distributing static configuration files to all nodes.
Successfully distributed static configuration files.
[omm@testosa ~]$

如下四个节点查询静态配置文件里面已经没有192.168.1.81这个IP了

[omm@testosa ~]$ gs_ssh -c "gs_om -t view|grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'"|awk -F : '{print $2}'|sort|uniq

192.168.1.80
192.168.1.82
192.168.1.83
192.168.1.90
[omm@testosa ~]$

cm配置处理

删除dcf元数据

[omm@testosa ~]$ gs_ssh -c "ls -ld /opengauss/cmserver/dcf_data/metadata"
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
drwx------ 2 omm dbgrp 72 Feb 1 22:33 /opengauss/cmserver/dcf_data/metadata
[SUCCESS] testosb:
drwx------ 2 omm dbgrp 72 Feb 1 22:33 /opengauss/cmserver/dcf_data/metadata
[SUCCESS] testosc:
drwx------ 2 omm dbgrp 72 Feb 1 22:33 /opengauss/cmserver/dcf_data/metadata
[SUCCESS] testosd:
drwx------ 2 omm dbgrp 72 Feb 1 22:33 /opengauss/cmserver/dcf_data/metadata

[omm@testosa ~]$

[omm@testosa ~]$ gs_ssh -c "rm -rf /opengauss/cmserver/dcf_data/metadata"
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
[SUCCESS] testosb:
[SUCCESS] testosc:
[SUCCESS] testosd:

[omm@testosa ~]$ gs_ssh -c "ls -ld /opengauss/cmserver/dcf_data/metadata"
Failed to execute command on all nodes.

Output:
[GAUSS-51400] : Failed to execute the command: sh /opengauss/tmp/ClusterCall_71151.sh. Error:
[FAILURE] testosa:
ls: cannot access /opengauss/cmserver/dcf_data/metadata: No such file or directory
[FAILURE] testosb:
ls: cannot access /opengauss/cmserver/dcf_data/metadata: No such file or directory
[FAILURE] testosc:
ls: cannot access /opengauss/cmserver/dcf_data/metadata: No such file or directory
[FAILURE] testosd:
ls: cannot access /opengauss/cmserver/dcf_data/metadata: No such file or directory
[omm@testosa ~]$

删除动态文件

[omm@testosa ~]$ gs_ssh -c "ls -l /opengauss/app_46134f73/bin/cluster_dynamic_config"
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
-rw------- 1 omm dbgrp 9068 Feb 1 22:38 /opengauss/app_46134f73/bin/cluster_dynamic_config
[SUCCESS] testosb:
-rw------- 1 omm dbgrp 9068 Feb 1 22:53 /opengauss/app_46134f73/bin/cluster_dynamic_config
[SUCCESS] testosc:
-rw------- 1 omm dbgrp 9068 Feb 1 22:53 /opengauss/app_46134f73/bin/cluster_dynamic_config
[SUCCESS] testosd:
-rw------- 1 omm dbgrp 9068 Feb 1 22:53 /opengauss/app_46134f73/bin/cluster_dynamic_config

[omm@testosa ~]$

[omm@testosa ~]$ gs_ssh -c "rm -rf /opengauss/app_46134f73/bin/cluster_dynamic_config"
Successfully execute command on all nodes.

Output:
[SUCCESS] testosa:
[SUCCESS] testosb:
[SUCCESS] testosc:
[SUCCESS] testosd:

[omm@testosa ~]$

 

启动集群

[omm@testosa ~]$ cm_ctl start
cm_ctl: checking cluster status.
cm_ctl: checking cluster status.
cm_ctl: checking finished in 480 ms.
cm_ctl: start cluster.
cm_ctl: start nodeid: 1
cm_ctl: start nodeid: 2
cm_ctl: start nodeid: 3
cm_ctl: start nodeid: 4
................
cm_ctl: start cluster successfully.
[omm@testosa ~]$

查询集群状态

[omm@testosa ~]$ cm_ctl query -Cvdip
[ CMServer State ]

node node_ip instance state
---------------------------------------------------------------------
1 testosa 192.168.1.80 1 /opengauss/cmserver/cm_server Primary
2 testosb 192.168.1.90 2 /opengauss/cmserver/cm_server Standby
3 testosc 192.168.1.82 3 /opengauss/cmserver/cm_server Standby
4 testosd 192.168.1.83 4 /opengauss/cmserver/cm_server Standby

[ Cluster State ]

cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL

[ Datanode State ]

node node_ip instance state
---------------------------------------------------------------------------
1 testosa 192.168.1.80 6001 12345 /opengauss/data/dn P Primary Normal
2 testosb 192.168.1.90 6002 12345 /opengauss/data/dn S Standby Normal
3 testosc 192.168.1.82 6003 12345 /opengauss/data/dn S Standby Normal
4 testosd 192.168.1.83 6004 12345 /opengauss/data/dn C Cascade Standby Normal
[omm@testosa ~]$

 

标签:testosa,dn,CM,IP,omm,192.168,1.81,openGauss,opengauss
From: https://www.cnblogs.com/yuweijade/p/18561708

相关文章

  • STAR-CCM+案例04|90度弯管内部流场特性分析(结构网格)
    本文摘要(由AI生成):本文介绍了一个使用STAR-CCM+模拟90度弯管内部流动特性的案例。通过本案例,可以学习到如何生成高质量的结构网格、进行CFD分析的一般过程、选择STAR-CCM+湍流模型和近壁面处理方法。案例中,研究对象为90度弯头,进水口速度已知为5m/s,水温为常温25℃,水管直径为10mm......
  • IP路由基础
    路由的概述路由的基本概念:路由:指导报文转发的路径信息,可以确定转发IP报文的路径路由中包含的信息:(路由表信息)​      目的网络​      网段掩码​      出接口:离开本路由器的接口​      下一条:下一跳设备的地址​      路由......
  • 『模拟赛』多校A层冲刺NOIP2024模拟赛25
    Rank极限了,感觉还行感觉T3不是一般人可做的,遂先来写赛记。A.图签。本来不是很一眼的,但看到给了这个和这个然后就很一眼了。用longlong状压每个点所有操作下是否属于S/T集合的状态,那么发现对于一条边\((i,j)\),只有某一次操作满足\(i\inS\)且\(j\inT\)......
  • 第十章 JavaScript的应用
    10.1JavaScript概述10.1.1JavaScript简介JavaScript是一种基于对象(0bject)和事件驱动(EventDriven)并具有安全性能的脚本语言,能够与HTML(超文本标记语言)、Java语言一起在Web页面中与Web客户交互它无须经过先将数据传给服务器端(Server)、再传回来的过程,而直接可以由客户......
  • 1(5)led灯闪烁、常见ip核介绍
    内容工程设计框架采用top-down设计思路代码设计采用down-top设计思路注:由于zynq7020上面的pll输出范围不包括5,因此设置为10生成ip时线程越多速度越快生成好后在这里可以找到对应的例化模板选择I/O:上板验证:实际效果:可以观察到led灯1s翻转一次......
  • NOIP 模拟 18
    NOIP模拟18最近老是犯唐,这次也是。T1图容易得到暴力代码:namespaces1{ boolsta[MAXN*MAXN]; boolS[MAXN],T[MAXN]; strings; intans; intmain(){cin>>n>>m; for(inti=1;i<=m;++i){ cin>>s; memset(S,0,sizeof(bool)*(n+5)); memset(T,......
  • [NOIP2016 提高组] 蚯蚓 题解
    考场思路考虑要动态维护最大值,可以直接使用优先队列进行维护,但是,考虑到我们并不好直接修改优先队列中的每一个元素,所以决定使用vector先排一遍序,再使用冒泡排序进行动态维护,时间复杂度\(O(mn)\),可以拿35pts。代码#include<iostream>#include<vector>#include<algorithm>......
  • 【调试记录】GT ip跑aurora 64b66b协议
    1.IP配置2.协议理解2.1变速箱Gearbox的理解64B66B编码,数据输入是64bit,输出是66bit,所以这之间存在着2bit的带宽差,Gearbox就是用来解决这种差异的,实现方式是:将66bit数据拿出来2bit先存入Gearbox,然后输出64bit.当发送32次后,用户这边暂停发送一帧,让Gearbox当中的64bit数据......
  • 新手使用代理ip介入代码怎么写?
    Python语言(使用requests库为例)在上述代码中:首先导入了requests库,它是Python中常用的用于发送HTTP请求的库。然后定义了一个字典格式的proxy变量,用于配置代理IP的相关信息,分别针对http和https协议指定代理的地址和端口(这里的http://和https://要按照你获取的代理的实际协议情......
  • 2024年第十四届APMCM亚太地区大学生数C题第一版本超详细解题思路——一文速通C题学建
    亚太近三年题目类型较为固定,A题为图像处理类题目;B题为纯优化类问题;C题为数据收集、分析、处理类题目。今年又加入了D题,偏优化类型题目,QUBO(二次无约束二元优化)模型题目。与每年妈杯D题相近。基于往年C题选题人数占总人数80%+,本次助攻初步暂定为C题提供两个版本,完全不同的解题思......