首页
统计信息
友情链接
壁纸
Search
1
【更新】CommentToMail typecho2017&v4.1& Mailer三版本,支持php5.6/7,插件详解
158,012 阅读
2
CentOS 7安装bbr教程
12,767 阅读
3
纯小白10分钟变身linux建站高手?宝塔linux面板全体验
12,364 阅读
4
深信服超融合架构测试介绍
11,596 阅读
5
【开源免费】第三代哈弗H6、哈弗大狗、H6经典版车机升级地图、安装软件全流程打通
7,860 阅读
技术相关
ACG相关
胡言乱语
数码杂烩
登录
Search
标签搜索
进击的巨人
漫画
宝塔
php
typecho
diy
vps
折腾
动漫
优酷路由宝
ubuntu
路由器
QQ
KMS
王忘杰
累计撰写
270
篇文章
累计收到
179
条评论
首页
栏目
技术相关
ACG相关
胡言乱语
数码杂烩
页面
统计信息
友情链接
壁纸
搜索到
270
篇与
的结果
2024-12-27
VMware vSphere 笔记记录
最新版本下载:https://customerconnect.vmware.com/cn/downloads/#all_products1、loading esxi installer 卡死在 loading /lsi_mr3.v00 使用UEFI模式安装2、vSphere Clustering Service (vCLS)虚拟机异常处理 缺少功能进BIOS把MWAIT开启3、vCenter Converter standalone 转换物理机到虚拟机问题 提交任务后,总是停留在1%,进度信息停在:Connecting to the Converter helper server on the destination virtual machine.但是错误提示,一直等待。取消任务后,提示:Unable to connect to the Converter helper server on the destination virtual machine问题解决:因为Converter Server在 vCenter上创建的 helper vm虚拟机的缺省网络设置是自动获取ip地址,而网络上没有可用的dhcp服务,所以Converter Server和helper vm通讯失败。应该在vCenter Converter提交任务前的配置页,静态配置helper vm的ip地址,最好用ipv4,并且和vCenter Converter同网段,速度会更快。————————————————版权声明:本文为CSDN博主「我是超级用户」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/petrosofts/article/details/750034594、VMware EXSI 启用vMotion 选择编辑 VMkernel适配器启用 vMotion功能5、vSphere下载 当前下载还是免费的https://support.broadcom.com/group/ecx/solutionfiles?displayGroup=VMware%20vSphere%20-%20Standard&os=&release=7.0&solution=VMware%20vSphere%20-%20Standard&subfamily=VMware%20vSphere6、vSAN 内部版本建议警报“vSAN 内部版本建议引擎” https://vcsa.vmware.com/ph/api/v1/results?deploymentId=2d02e861-7e93-4954-9a73-b08692a330d1&collectorId=VsanCloudHealth.6_5&objectId=0c3e9009-ba5d-4e5f6-bae8-f25ec506d219&type=vsan-updates-json下载文件,从文件更新7、vSAN 硬件兼容性警报“vSAN HCL 数据库最新版本” https://partnerweb.vmware.com/service/vsan/all.json 下载文件,从文件更新
2024年12月27日
792 阅读
0 评论
0 点赞
2024-12-14
【开源免费】第三代哈弗H6、哈弗大狗、H6经典版车机升级地图、安装软件全流程打通
本文适用于2025年OTA后的 第三代哈弗H6、哈弗大狗、H6经典版创作声明: 注意:任何对车机原有功能的修改,均属于破解范畴。对车机升级高德地图版本、安装自定义软件的行为,会降低车辆安全性,安装带有后门、或不稳定的软件,会对行车安全造成严重危害,对车机软件的修改造成故障,不属于车辆质保范畴,当你使用本文所提到的方法时,请确保自身能够承担相应后果。本文内容不保证软件安全性、不持有相关软件版权、不进行盈利活动,仅作为技术交流使用。防骗指南:工具完全免费,收费即为骗子 {lamp/}一句话总结骗局 某达利用网上公开技术和视频、冒充作者、冒充长城官方人员、使用卡顿、收钱后质疑就踢出群拉黑。 90APT王忘杰所有教程、工具、视频均免费公开,谨防上当受骗。 {lamp/}哈弗车机技术交流QQ群:468902455 本群为公开、免费技术交流群,,请注意识别,任何人私聊你,以任何名义收费,均为骗子。若你无法看懂下面的文章,建议放弃,以免造成车机损坏无法使用。快速概要 本文中所有软件下载,包含群友分享OTA包 不保证能用 来源不明 使用后果自负!!123网盘 使用123网盘APP下载不限速不限流量https://www.123865.com/s/UaOljv-5xOHv?提取码:ZyBEhttps://www.123684.com/s/UaOljv-5xOHv?提取码:ZyBE百度网盘 不开会员下的慢https://pan.baidu.com/s/1S3enQhKy91FAal5M-WJRDw?pwd=2yw4 提取码: 2yw4华阳开启内置ADB无需DNS工程模式 https://www.bilibili.com/video/BV129cBe5ExL/ 电脑使用搞机工具箱或手机安装甲壳虫后可开启无线ADB甲壳虫开华阳无线ADB、清数据给权限、装软件高德8.1、开机自启 https://www.bilibili.com/video/BV1wGCwYdErF/ 安波福工程调试模式DNS搭建 https://www.bilibili.com/video/BV16rcUeAEfP 免费DNS使用方法 免费工程DNS安波福验证方法 https://www.bilibili.com/video/BV1YnwVe9ERD/ 安波福工程模式DNS 115.120.216.97 验证时间20250116正常本DNS为免费DNS,由90APT.com提供搭建和教程,点击可查看详细教程,由于免费行为触动车圈知名骗子哈弗益达利益,群号和DNS持续被哈弗益达举报,因此DNS失效时间不确定,90apt从未授权哈弗益达使用本站的DNS、技术原理和方法,收费均为骗子,谨防上当。DNS使用方法1、车机恢复出厂。准备一个wifi或手机热点,提供一个稳定的WIFI网络2、准备第二部手机,第二部需要连接上面的wifi并且能够同时共享热点3、第二部手机的wifi修改DNS为免费DNS的IP4、启动车辆,车辆连接第二部手机的热点,点击智能手册,即可安装工装工程模式使用ADB{lamp/}一、 原车功能 若你对车机导航、音乐等功能不满意,推荐先使用原车手机互联功能,车机内置CarPlay、亿连,均支持有线和无线方式,详细请咨询长城汽车官方。示例:VIVO车载 {lamp/}二、车机破解、升级地图、安装软件如果上面的手机互联方案不满足,仍想破解车机,可查看以下内容。1、整体流程1.1识别车机系统厂家分为安波福主机、华阳主机1.2安装工程模式安波福安装工程模式后可以直接打开无线ADB华阳启用有线ADB后,需要使用公对公USB线,可使用笔记本或手机OTG开通无线ADB功能。1.3升级地图安波福可通过代码进行内置地图升级华阳无需代码可直接高德8.1地图,若地图无法打开,则需要清除APP数据、给予权限后才能正常打开软件。1.4安装软件、调优连接有线、无线ADB后,可通过手机甲壳虫、电脑搞机助手进行软件安装、软件全屏调整等操作。2、详细步骤2.1识别车机系统打开车机系统设置-多次点击版本号出现密码框,输入密码,根据密码可判断车机版本*#34434ab *#4435ab *#1138ab *#1831aa能够进入,为安波福车机输入adayo2002能够进入,为华阳车机2.2安装工程模式 华阳站起来了,在车机上直接开启ADB功能 系统设置-系统信息-连续点击系统版本号-输入密码 adayo2002 进入工厂模式-连续点击 MCU_Version 后面的版本号,输入密码@Fygw50*找到其他设置-就会出现usb mode device ADB开关,开启后即可通过USB连接ADB安波福使用DNS、一键包等方式安装调试模式2.2.1笔记本一键包4.1版本smartDNS+nginx实现,开发中本文中所有软件下载,包含群友分享OTA包 不保证能用 来源不明 使用后果自负!!123网盘 使用123网盘APP下载不限速不限流量https://www.123865.com/s/UaOljv-5xOHv?提取码:ZyBEhttps://www.123684.com/s/UaOljv-5xOHv?提取码:ZyBE百度网盘 不开会员下的慢https://pan.baidu.com/s/1S3enQhKy91FAal5M-WJRDw?pwd=2yw4 提取码: 2yw4一键包4.0开发思路、使用 视频教程2.2.2服务器一键包如果你同意免费共享给大家使用,群内联系我,我远程进行搭建。2.2.3打开ADB安波福打开工程模式后,可直接打开无线ADB功能开启无线ADB 华阳打开工程模式后,使用双头USB连接电脑,开启无线ADB功能视频教程:甲壳虫开华阳无线ADB、清数据给权限、装软件、开机自启 https://www.bilibili.com/video/BV1wGCwYdErF/ 笔记本使用搞机工具箱ADB命令开启 https://jamcz.com/adb tcpip 5555手机安装甲壳虫连接车机后开启无线ADB2.3升级高德地图2.3.1安波福运行笔记本一键包4.0后,可以跑代码升级地图,termux也放置在一键包中 运行笔记本一键包3.1后,手机运行termux部署基本环境 必须运行运行笔记本一键包4.0后,车机开启无线ADB后,运行代码,可本地升级高德地图apt update; apt upgrade -y;apt install iproute2 wget unzip bash curl android-tools openssl libssh2 -y curl -o new.sh -k https://dzsms.gwm.com.cn/haval/new.sh ; bash new.sh2.3.2华阳直装地图一键部署工程模式使用双头usb开无线adb使用甲壳虫或搞机助手直接安装高德8.1注意:华阳8.1流畅丝滑、支持导航红绿灯、HUD、语音控制,但不支持飞屏、卡片、巡航红绿灯2.4其他软件安装、调优、高德地图升级调整、开机自启动亿连2.4.1 安装软件安波福、华阳 使用甲壳虫APP可以安装软件2.4.2 调优软件遮挡设置全屏使用ADB命令全屏沉浸: adb shell settings put global policy_control immersive.full=* 沉浸状态栏: adb shell settings put global policy_control immersive.status=* 沉浸导航栏: adb shell settings put global policy_control immersive.navigation=* 我们还可以单独控制哪些app不沉浸,例如以下代码设置google即时桌面不沉浸,其他程序沉浸: adb shell settings put global policy_control immersive.full=apps,-com.google.android.googlequicksearchbox 如果想恢复到正常模式,运行下面的代码: adb shell settings put global policy_control null2.4.3高德地图声音调整若升级后高德地图8.1声音异常、无声、声音巨大先清空高德地图APP数据、给予权限,然后调整声道,高德声道第一个选10或11,第二个1,第七个1,第14个1,第17个1高德设置-播报图标连续点击10次-进入隐藏设置 https://www.bilibili.com/video/BV1Cg411Z7gz/ 2.4.4亿连自动启动安装自动启动APK,使用ADB命令设置软件全屏,勾选亿连设置自动启动即可2.4.5 CarLife群里和网盘中有此应用,手机互联更快更稳定三、更多应用 0、群友项目 EXE一键启动本文中所有软件下载,包含群友分享OTA包 不保证能用 来源不明 使用后果自负!!123网盘 使用123网盘APP下载不限速不限流量https://www.123865.com/s/UaOljv-5xOHv?提取码:ZyBEhttps://www.123684.com/s/UaOljv-5xOHv?提取码:ZyBE百度网盘 不开会员下的慢https://pan.baidu.com/s/1S3enQhKy91FAal5M-WJRDw?pwd=2yw4 提取码: 2yw4容器部署 https://github.com/car-factory/car_apk_manager/tree/master 1、一部安卓手机实现服务器+跑代码功能 因难度较高仅供参考 注意,手机root后失去保修,量力而行。 技术架构部署服务我使用的是红米note7pro,解锁BL安装面具magisk,注入boot,刷入,获取root权限tsu后成功获取root权限激活自带的Systemless Hosts模块修改hosts文件,劫持dzsms.gwm.com.cn请求路径 /data/adb/modules/hosts/system/etc/hostsIP为手机热点的IP,可以用其他手机连上看看网关我这里红米为192.168.43.1 dzsms.gwm.com.cn保存重启手机,面具会将这个hosts文件作为系统请求的hosts部署nginx服务,将需要的代码和脚本都放入指定手机中,使用root运行nginx测试直接实战手机升级高德地图8.1长城三代哈弗H6哈弗大狗坦克300安波福华阳笔记本一键部署3.1DNS工程模式跑代码 https://www.bilibili.com/video/BV14vk2Y9EzA/ 2、一键包自己添加地图 直接实战 修改代码安装高德地图8.1长城三代哈弗H6哈弗大狗坦克300安波福华阳笔记本一键部署3.1DNS工程模式跑代码 https://www.bilibili.com/video/BV1ZukYYPEC7/ 3、原理解析 ADB在哪里在第三代哈弗H6车机中,ADB程序位于工程模式中,在2021、2022出厂的车固件中内置,2023年起移除;这个程序只有厂家有,我们可以从2023之前的系统中,用ADB工具将工程模式APP导出。完成第一项:获得ADB程序车机有没有对外请求数据由于没有了ADB程序,我们是无法安装工程模式到车机中的,这时候就需要利用哈弗车机的一个漏洞,即智能手册APP证书无验证漏洞。进入智能手册APP后,APP会向哈弗服务器一个URL发送请求,用来请求最新版本,让车机WIFI连接到我们的设备进行抓包,查看请求状态,智能手册APP会解析JSON格式的回复内容判断是否下载APK升级。完成第二项:获取一个系统漏洞怎么把ADB装进去我们参照官方服务器,自行搭建DNS和web服务器,让车机连到我们的DNS服务器上,进行请求的劫持,这样,我们自己的APP就会被以程序更新的方式发送到车机中进行安装。完成第三项:将ADB注入到车机中,重新取得ADB权限ADB安装软件开启无线ADB或使用有线ADB,都可以使用ADB工具进行软件安装,如安卓内置命令pm、电脑搞机工具箱、手机甲壳虫。ADB命令替换升级高德地图原车地图APP无法退出,官方8.1正式版地图,华阳可以直接升级,安波福需要替换运行脚本apt update; apt upgrade -y;apt install iproute2 wget unzip bash curl android-tools openssl libssh2 -y curl -o new.sh -k https://dzsms.gwm.com.cn/haval/new.sh ; bash new.sh关键代码 echo_color "开始升级预处理" cd $Work_Path rm -rf tmp mkdir tmp cd tmp wzget $AutoMap_Url $AutoMap_Apk unzip -o $AutoMap_Apk >/dev/null 2>&1 rm -rf automap mkdir -p automap/lib mv lib/armeabi-v7a automap/lib/arm cp $AutoMap_Apk automap/AutoMap.apk rm -rf $Work_Path/$AutoMap_Tar cd automap/ && tar -cvpf $Work_Path/$AutoMap_Tar * echo_color "释放进程...." adb shell "killall com.autonavi.amapauto 2>/dev/null" adb shell "killall com.autonavi.amapauto:push 2>/dev/null" adb shell "killall com.autonavi.amapauto:locationservice 2>/dev/null" adb shell "pm clear com.autonavi.amapauto" echo_color "卸载升级或者清理手动升级残留" adb shell "pm uninstall com.autonavi.amapauto >/dev/null" adb shell "pm uninstall --user 0 com.autonavi.amapauto >/dev/null" echo_color "查看Packages list信息" adb shell "pm list packages amap" adb shell "pm list packages -u amap" echo_color "释放空间...." adb shell "echo '' > /system/app/AutoMap/AutoMap.apk" echo_color "删除原车高德地图系统文件" adb shell "rm -rf /system/app/AutoMap/*" echo_color "测试清理用户目录" adb shell "rm -rf /data/user/0/com.autonavi.amapauto" adb shell "rm -rf /data/user_de/0/com.autonavi.amapauto" adb shell "rm -rf /data/app/*/com.autonavi.amapauto*" adb shell "rm -rf /data/media/0/amapauto9" adb shell "rm -rf /sdcard/amapauto9" adb shell "rm -rf /sdcard/Android/data/com.autonavi.amapauto" adb shell '[ -d "/system/app/AutoMap" ] || mkdir -p "/system/app/AutoMap"' echo_color "上传替换高德包" adb push $filename /data/local/tmp/ adb push $filename.md5 /data/local/tmp/ adb push check.sh /data/local/tmp/ adb shell chmod 777 /data/local/tmp/check.sh echo_color "执行替换操作" adb shell "tar -xvpf /data/local/tmp/$filename -C /system/app/AutoMap/" echo_color "校验文件完整性" adb shell "/data/local/tmp/check.sh $filename" echo_color "修复文件权限" adb shell "chown -R root:root /system/app/AutoMap/" adb shell "chmod -R 755 /system/app/AutoMap/" adb shell "chmod -R 644 /system/app/AutoMap/AutoMap.apk" adb shell "chmod -R 644 /system/app/AutoMap/lib/arm/*" echo_color "恢复APP状态及还原安装" adb shell "pm enable com.autonavi.amapauto" adb shell "pm unhide com.autonavi.amapauto" adb shell "pm default-state --user 0 com.autonavi.amapauto" echo_color "测试清理步骤" adb shell "rm -rf /data/system/package_cache/1/AutoMap*" echo_color "等待10秒后开始还原" sleep 10 echo_color "尝试还原" adb shell "cmd package install-existing com.autonavi.amapauto" echo_color "查看Packages list信息" adb shell "pm list packages amap" adb shell "pm list packages -u amap" echo_color "清理数据" adb shell "pm clear com.autonavi.amapauto" 4、修改导航栏遮蔽使用修改版ui_surface UI层map_surface 地图层android:layout_marginLeft="100.0dip" 左侧避让100dip使用原版ApkSignUtil.java 完整性校验MT管理器 去除签名校验开发助手 查看布局.\d2j-dex2jar.bat .\classes.dex --force 反编译classes文件java -jar .\apktool_2.10.0.jar empty-framework-dir --force 生成框架四、小结 OTA后新版本已足够完美,折腾的意义已经不大了
2024年12月14日
7,860 阅读
0 评论
143 点赞
2024-12-09
中小企业快速合规,快速部署开源堡垒机TELEPORT v3.x 解决win11黑屏问题
为什么不是JumpServer? 说起开源堡垒机,恐怕JumpServer已经成为了代表,如果中小型企业要部署一台堡垒机,为什么不是JumpServer? 这就要说JumpServer的两个小缺点: 1、大型且繁琐 随着版本的迭代,JumpServer已经变得大型且繁琐,安装、升级、配置维护都成了运维的负担。 2、不支持本地RDP客户端 开源版JumpServer只支持linux发起本地客户端,但不支持windowsRDP客户端,这对中小型企业来说相当不友好 而TELEPORT正是为了解决这个两个痛点而来。官方介绍: Teleport是一款简单易用的开源堡垒机系统,具有小巧、易用的特点,支持 RDP/SSH/SFTP/Telnet 协议的远程连接和审计管理。Teleport由两大部分构成:跳板核心服务 WEB操作界面Teleport非常小巧且极易安装部署:仅需一分钟,就可以安装部署一套您自己的堡垒机系统!!因为Teleport内建了所需的脚本引擎、WEB服务等模块,因此不需要额外安装其他的库或者模块,整个系统的安装与部署非常方便。官方网站: https://tp4a.com/一、安装 1、服务端服务端安装包下载https://tp4a.com/download安装文档https://docs.tp4a.com/install/安装tar -zxvf teleport-linux-3.x.tar.gz cd teleport-linux-3.x sudo ./setup.sh登录初始化即可http://teleport服务器IP:7190/系统界面2、客户端https://tp4a.com/download客户端放置在服务器位置,即可点击页面下载[root@baoleiji ~]# mkdir /usr/local/teleport/data/assist -p [root@baoleiji assist]# ls teleport-assist-macos-3.6.3.dmg teleport-assist-windows-3.6.3.exe二、接入用户 导入域账号 用户-用户管理-设置LDAP三、添加主机 添加主机 资产-主机及账号-添加主机四、添加账号 绑定账号 资产-主机及账号-账号数五、运维授权 创建授权 运维-运维授权-新建授权策略编辑授权策略 添加用户 添加主机六、审计授权-查看录像 审计授权与运维授权相同 审计-审计授权-新建授权策略 添加用户 添加主机查看录像 审计-会话审计-查看回放七、使用方式 普通用户安装客户端后登录浏览器提示时选择打开teleport助手登录主机 运维-主机运维1、windows主机选择合适的分辨率唤醒客户端登陆成功2、linux主机点击SSH唤醒客户端 登陆成功3、其他可在助手设置修改本地客户端类型八、故障处理 1、存在core服务崩溃BUG,可以通过定时任务启动*/10 * * * * /etc/init.d/teleport start2、win11远程黑屏默认路径RDP客户端为 C:\Windows\System32\mstsc.exe黑屏原因由于win11更新RDP客户端程序不兼容,导致TP堡垒机远程黑屏解决方案从win10 LTSC系统中提取RDP客户端程序给win11使用RDP程序所需文件wbem目录、zh-CH目录、mstsc.exe、mstscax.dll我这里放置在D盘mstsc目录下,堡垒机助手指定文件再次远程,恢复正常3、清理录像teleport V3堡垒机快速清除180天前的录像 cd /usr/local/teleport/data/replay/ find . -mtime +180 -exec ls -l {} \; find . -mtime +180 -exec rm -rf {} \;九、总结 开源、快速、功能强大项目捐赠:https://tp4a.com/donate
2024年12月09日
1,081 阅读
0 评论
6 点赞
2024-11-28
大型数据库sysbench测试结果 oceanbase4.3.4集群 MYSQL8.0.40单机调优 PGSQL17调优
一、系统配置和调优参数 MYSQL8.0.40单机 24C128G调优key_buffer_size=2048MB join_buffer_size=17000KB tmp_table_size=4096MB innodb_buffer_pool_size=8200MB sort_buffer_size=8200KB read_buffer_size=8200KB read_rnd_buffer_size=4096KB thread_stack=1024KB binlog_cache_size=512KB thread_cache_size=512 table_open_cache=4096 max_connections=10000PGSQL17单机 24C128G调优max_connections = 10000 shared_buffers = 2048MB work_mem = 512MB maintenance_work_mem = 1024MBOB集群 1zone6主机 租户24C48G默认设置二、测试参数 每个表行数1千万,350个表,总行数35亿,并发数80,在同一个超融合集群中三、测试数据 OB集群OLTP读写混合场景[ 10s ] thds: 80 tps: 260.33 qps: 5296.02 (r/w/o: 3718.86/1048.51/528.65) lat (ms,95%): 802.05 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 80 tps: 371.01 qps: 7423.65 (r/w/o: 5196.51/1485.13/742.02) lat (ms,95%): 502.20 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 80 tps: 608.00 qps: 12156.95 (r/w/o: 8509.74/2431.21/1216.01) lat (ms,95%): 193.38 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 80 tps: 793.99 qps: 15880.87 (r/w/o: 11117.61/3175.27/1587.99) lat (ms,95%): 137.35 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 80 tps: 922.80 qps: 18465.23 (r/w/o: 12924.92/3694.71/1845.60) lat (ms,95%): 114.72 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 80 tps: 929.30 qps: 18603.13 (r/w/o: 13023.95/3720.59/1858.59) lat (ms,95%): 130.13 err/s: 0.00 reconn/s: 0.00OB集群OLTP只读场景压测[ 10s ] thds: 80 tps: 1893.03 qps: 30354.81 (r/w/o: 26560.74/0.00/3794.06) lat (ms,95%): 68.05 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 80 tps: 2909.96 qps: 46562.29 (r/w/o: 40742.58/0.00/5819.71) lat (ms,95%): 41.10 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 80 tps: 2642.26 qps: 42274.92 (r/w/o: 36990.19/0.00/5284.73) lat (ms,95%): 50.11 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 80 tps: 3473.07 qps: 55563.89 (r/w/o: 48617.76/0.00/6946.14) lat (ms,95%): 37.56 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 80 tps: 3646.52 qps: 58341.39 (r/w/o: 51048.65/0.00/7292.74) lat (ms,95%): 31.37 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 80 tps: 3812.57 qps: 61006.78 (r/w/o: 53381.54/0.00/7625.23) lat (ms,95%): 29.19 err/s: 0.00 reconn/s: 0.00MYSQL单机OLTP读写混合场景[ 10s ] thds: 80 tps: 0.40 qps: 96.67 (r/w/o: 84.68/3.20/8.80) lat (ms,95%): 9799.46 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 80 tps: 8.00 qps: 144.01 (r/w/o: 93.10/34.90/16.00) lat (ms,95%): 19778.24 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 80 tps: 12.00 qps: 234.50 (r/w/o: 164.20/46.30/24.00) lat (ms,95%): 9284.15 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 80 tps: 10.90 qps: 238.60 (r/w/o: 173.20/43.60/21.80) lat (ms,95%): 10722.67 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 80 tps: 14.70 qps: 289.10 (r/w/o: 199.20/60.50/29.40) lat (ms,95%): 10722.67 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 80 tps: 16.40 qps: 323.10 (r/w/o: 225.80/64.50/32.80) lat (ms,95%): 8795.93 err/s: 0.00 reconn/s: 0.00MYSQL单机OLTP只读场景压测[ 10s ] thds: 80 tps: 19.20 qps: 372.12 (r/w/o: 325.73/0.00/46.39) lat (ms,95%): 6713.97 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 80 tps: 41.10 qps: 650.72 (r/w/o: 568.51/0.00/82.20) lat (ms,95%): 5217.92 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 80 tps: 59.50 qps: 958.60 (r/w/o: 839.60/0.00/119.00) lat (ms,95%): 3706.08 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 80 tps: 78.90 qps: 1260.00 (r/w/o: 1102.20/0.00/157.80) lat (ms,95%): 2932.60 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 80 tps: 94.80 qps: 1521.49 (r/w/o: 1331.90/0.00/189.60) lat (ms,95%): 2320.55 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 80 tps: 102.90 qps: 1640.71 (r/w/o: 1434.91/0.00/205.80) lat (ms,95%): 2082.91 err/s: 0.00 reconn/s: 0.00PG单机OLTP读写混合场景[ 10s ] thds: 80 tps: 8.29 qps: 249.21 (r/w/o: 188.56/36.07/24.58) lat (ms,95%): 8638.96 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 80 tps: 13.51 qps: 276.96 (r/w/o: 195.21/54.73/27.02) lat (ms,95%): 10343.39 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 80 tps: 15.90 qps: 308.30 (r/w/o: 214.70/61.80/31.80) lat (ms,95%): 9118.47 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 80 tps: 16.50 qps: 324.00 (r/w/o: 224.40/66.60/33.00) lat (ms,95%): 8638.96 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 80 tps: 15.10 qps: 308.70 (r/w/o: 217.20/61.30/30.20) lat (ms,95%): 9452.83 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 80 tps: 17.50 qps: 358.40 (r/w/o: 252.70/70.70/35.00) lat (ms,95%): 9118.47 err/s: 0.00 reconn/s: 0.00PG单机OLTP只读场景压测[ 10s ] thds: 80 tps: 317.53 qps: 5149.51 (r/w/o: 4506.46/0.00/643.05) lat (ms,95%): 1032.01 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 80 tps: 525.90 qps: 8423.06 (r/w/o: 7371.25/0.00/1051.81) lat (ms,95%): 337.94 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 80 tps: 789.40 qps: 12622.80 (r/w/o: 11044.10/0.00/1578.70) lat (ms,95%): 211.60 err/s: 0.00 reconn/s: 0.00 [ 40s ] thds: 80 tps: 1327.89 qps: 21255.90 (r/w/o: 18600.01/0.00/2655.89) lat (ms,95%): 99.33 err/s: 0.00 reconn/s: 0.00 [ 50s ] thds: 80 tps: 1347.00 qps: 21545.69 (r/w/o: 18851.69/0.00/2694.00) lat (ms,95%): 102.97 err/s: 0.00 reconn/s: 0.00 [ 60s ] thds: 80 tps: 1450.39 qps: 23206.88 (r/w/o: 20306.30/0.00/2900.59) lat (ms,95%): 95.81 err/s: 0.00 reconn/s: 0.00四、测试结果 OB集群占用空间大约628GMYSQL单机占用空间大约1.4TPG单机数据量大约860G读写混合场景下OB 53倍领先 >PG≈MYSQL PG、MYSQL几乎无法使用只读场景下OB 2.5倍领先>PG 10倍领先>MYSQL
2024年11月28日
210 阅读
0 评论
0 点赞
2024-11-22
快速部署Citus Postgres集群 6节点,SysBench对比测试mysql8.4、OceanBase 集群、Postgres17、mariaDB11
前文快速部署OceanBase 集群 1ZONE 6节点,使用SysBench对比测试mysql8.4单节点https://90apt.com/5039一、环境准备 1、安装规划仍在同一套超融合中部署测试,保证硬件性能相同。本次部署的对象为:Postgres17单机 32C64GmariaDB11单机 32C64GCitus Postgres单机6容器集群 2副本5工作节点哈希分布 32C64GCitus Postgres集群 2副本5工作节点32分片哈希分布 48C96GCitus Postgres集群 2副本5工作节点5分片哈希分布 48C96G关闭防火墙,避免影响实验 systemctl stop firewalld && systemctl disable firewalld2、安装部署Postgres17单机、mariaDB11单机使用anolis8系统 1panel面板一键部署Citus Postgres单机6容器集群 2副本5工作节点哈希分布 使用anolis8系统Citus Postgres集群 使用alma9系统二、1panel一键部署Postgres17单机、mariaDB11单机 1、使用1P面板一键部署即可Postgres17单机、mariaDB11单机2、性能测试2.1、MYSQL单机OLTP读写混合场景清除数据sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform --time=60 cleanup初始化测试数据sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform --time=60 prepare执行测试sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --time=60 --rand-type=uniform --db-ps-mode=disable run2.2、MYSQL单机OLTP只读场景压测准备数据sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 oltp_read_only prepare运行压测sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 --report-interval=1 oltp_read_only run清理数据sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 oltp_read_only cleanup2.3、PG单机OLTP读写混合场景清除数据sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=pgsql --pgsql-host=IP地址 --pgsql-port=端口 --pgsql-db=数据库名 --pgsql-user=用户名 --pgsql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform cleanup初始化测试数据sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=pgsql --pgsql-host=IP地址 --pgsql-port=端口 --pgsql-db=数据库名 --pgsql-user=用户名 --pgsql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform prepare执行测试sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=pgsql --pgsql-host=IP地址 --pgsql-port=端口 --pgsql-db=数据库名 --pgsql-user=用户名 --pgsql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --time=60 --rand-type=uniform --db-ps-mode=disable run 2.4、PG单机OLTP只读场景压测准备数据sysbench --db-driver=pgsql --pgsql-host=IP地址 --pgsql-port=端口 --pgsql-db=数据库名 --pgsql-user=用户名 --pgsql-password=密码 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 oltp_read_only prepare运行压测sysbench --db-driver=pgsql --pgsql-host=IP地址 --pgsql-port=端口 --pgsql-db=数据库名 --pgsql-user=用户名 --pgsql-password=密码 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 --report-interval=1 oltp_read_only run清理数据sysbench --db-driver=pgsql --pgsql-host=IP地址 --pgsql-port=端口 --pgsql-db=数据库名 --pgsql-user=用户名 --pgsql-password=密码 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 oltp_read_only cleanup最后放测试结果三、搭建Citus Postgres单机容器集群 1、Citus相关概念分布表分布在所有节点create_distributed_table参考表全部内容集中在一个分片中,每个数据节点复制该内容,保证数据一致性create_reference_table本地表协调节点不切分就是普通本地数据库,默认并行查询跨多个节点查询允许同时运行更多查询,协调节点需增强性能数据分布方式按哈希分布 默认 扩容节点需要迁移数据重新分布按数据范围分布按数据量分布2、下载docker镜像docker pull citusdata/citus3、创建docker网络bridge网桥模式docker network create --subnet=192.168.88.0/24 citus-network查看创建的网络docker network ls NETWORK ID NAME DRIVER SCOPE 3ba81d539b5d 1panel-network bridge local c24c0167d92e bridge bridge local de9fd59a6f8a citus-network bridge local a253a0857538 host host local 4aae934ed291 none null local4、启动citus服务创建协调节点 coordinate服务节点 docker run -dit --name citus-cod -p 5433:5432 -v /citus/citus-cod:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 --net=citus-network citusdata/citus -c listen_addresses="*" -c shared_preload_libraries='citus'创建工作节点docker run -dit --name citus-worker10 -v /citus/worker10:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -e POSTGRES_HOST_AUTH_METHOD='trust' --net=citus-network citusdata/citus -c listen_addresses="*" -c shared_preload_libraries='citus' docker run -dit --name citus-worker11 -v /citus/worker11:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -e POSTGRES_HOST_AUTH_METHOD='trust' --net=citus-network citusdata/citus -c listen_addresses="*" -c shared_preload_libraries='citus' docker run -dit --name citus-worker12 -v /citus/worker12:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -e POSTGRES_HOST_AUTH_METHOD='trust' --net=citus-network citusdata/citus -c listen_addresses="*" -c shared_preload_libraries='citus' docker run -dit --name citus-worker13 -v /citus/worker13:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -e POSTGRES_HOST_AUTH_METHOD='trust' --net=citus-network citusdata/citus -c listen_addresses="*" -c shared_preload_libraries='citus' docker run -dit --name citus-worker14 -v /citus/worker14:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -e POSTGRES_HOST_AUTH_METHOD='trust' --net=citus-network citusdata/citus -c listen_addresses="*" -c shared_preload_libraries='citus' docker run -dit --name citus-worker15 -v /citus/worker15:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -e POSTGRES_HOST_AUTH_METHOD='trust' --net=citus-network citusdata/citus -c listen_addresses="*" -c shared_preload_libraries='citus'5、往集群添加节点进入postgresql协调节点docker exec -it citus-cod psql -U postgres添加工作节点 select * from master_add_node('citus-worker10',5432); select * from master_add_node('citus-worker11',5432); select * from master_add_node('citus-worker12',5432); select * from master_add_node('citus-worker13',5432); select * from master_add_node('citus-worker14',5432); select * from master_add_node('citus-worker15',5432);查看工作节点select * from master_get_active_worker_nodes(); node_name | node_port ----------------+----------- citus-worker10 | 5432 citus-worker11 | 5432 ........6、管理节点删除工作节点 DELETE FROM pg_dist_placement WHERE groupid = (SELECT groupid FROM pg_dist_node WHERE nodename ='citus-worker11' AND nodeport = '5432' LIMIT 1);移除节点SELECT master_remove_node('citus-worker11', '5432');重新平衡分片SELECT rebalance_table_shards();7、数据库文件转入转出使用docker cp转入docker cp 主机文件 容器名:/容器文件使用docker cp转出docker cp 容器名:/容器文件 主机文件导入数据库备份pg_restore -U postgres -d postgres < 数据库备份.backup导出数据库备份pg_dump -U postgres postgres > 数据库备份.sql8、设置分布表分片、副本分片数为5set citus.shard_count = 5;副本数为2SET citus.shard_replication_factor = 2;分布表SELECT create_distributed_table('表名','主键'); SELECT create_distributed_table('sbtest1','id');查看分片数show citus.shard_count; citus.shard_count ------------------- 32 (1 row)查看分片详情select * from pg_dist_shard; 默认为hash分片 select * from pg_dist_shard_placement; 查看分片与节点的关系更改分片数SELECT alter_distributed_table('表名',shard_count:=2,cascade_to_colocated:=true); SELECT alter_distributed_table('sbtest1',shard_count:=2,cascade_to_colocated:=true);查看数据存放位置select get_shard_id_for_distribution_column('sbtest1',1);9、故障修复9.1、模拟协调节点故障 docker stop citus-cod工作节点仍然可以查询进入工作节点10docker exec -it citus-worker10 psql -U postgres查看数据select * from sbtest1;9.2、工作节点故障工作节点故障后,可以进行查询,不能进行写入;若要继续写入,需要先禁用故障节点citus_disable_node 恢复节点后在重新复制分片 replicate_table_shards10、性能测试命令与单机相同,但准备数据库,要先进行表分片,分片后测试性能SELECT create_distributed_table('sbtest1','id'); SELECT create_distributed_table('sbtest2','id'); ...... SELECT create_distributed_table('sbtest350','id');最后放测试结果四、搭建Citus Postgres集群 有上面的搭建经验,其实多主机集群就很简单了安装教程参考官网 https://docs.citusdata.com/en/stable/installation/multi_node_rhel.html#post-enterprise-rhel1、添加仓库curl https://install.citusdata.com/community/rpm.sh | sudo bash2、安装 PostgreSQL + Citus 并初始化数据库# 安装PG数据库和Citus扩展 sudo yum install -y citus121_16 # 初始化PG数据库 sudo /usr/pgsql-16/bin/postgresql-16-setup initdb # 加载Citus扩展 echo "shared_preload_libraries = 'citus'" | sudo tee -a /var/lib/pgsql/16/data/postgresql.conf3、配置连接和身份验证在启动数据库之前,让我们更改其访问权限。默认情况下,数据库服务器仅侦听 localhost 上的 Client 端。作为此步骤的一部分,我们指示它侦听所有 IP 接口,然后配置客户端身份验证文件以允许来自本地网络的所有传入连接。sudo vi /var/lib/pgsql/16/data/postgresql.conf # Uncomment listen_addresses for the changes to take effect listen_addresses = '*' sudo vi /var/lib/pgsql/16/data/pg_hba.conf # Allow unrestricted access to nodes in the local network. The following ranges # correspond to 24, 20, and 16-bit blocks in Private IPv4 address spaces. host all all 10.0.0.0/8 trust # Also allow the host unrestricted access to connect to itself host all all 127.0.0.1/32 trust host all all ::1/128 trust启动数据库服务器,创建 Citus 扩展# 启动数据库 sudo systemctl restart postgresql-16 # 配置开机启动 sudo systemctl enable postgresql-16 您必须将 Citus 扩展添加到要在集群中使用的每个数据库。以下示例将扩展添加到名为 postgres 的默认数据库。 sudo -i -u postgres psql -c "CREATE EXTENSION citus;"5、要在 coordinator 节点上执行的步骤在执行上述步骤后,只能在协调器节点上执行下面列出的步骤。5.1、添加 worker 节点信息我们需要通知 coordinator 有关其 worker 的信息。要添加此信息,请执行以下操作: 我们调用 UDF,它将节点信息添加到 pg_dist_node catalog 表,协调器使用该表来获取 worker 节点。对于我们的示例,我们假设有两个 worker(名为 worker-101、worker-102)。添加工作人员的 DNS 名称(或 IP 地址) 和服务器端口添加到表中。# Register the hostname that future workers will use to connect # to the coordinator node. # # You'll need to change the example, 'coord.example.com', # to match the actual hostname sudo -i -u postgres psql -c \ "SELECT citus_set_coordinator_host('coord.example.com', 5432);" # Add the worker nodes. # # Similarly, you'll need to change 'worker-101' and 'worker-102' to the # actual hostnames5.2、验证安装是否成功为了验证安装是否成功,我们检查协调器节点是否具有 选取所需的 worker 配置。此命令在 psql 中的 shell 应该输出我们添加到上面 pg_dist_node 表中的工作节点。sudo -i -u postgres psql -c "SELECT * FROM citus_get_active_worker_nodes();"6、性能测试与容器集群相同五、测试结果MYSQL单机OLTP读写混合场景[ 10s ] thds: 80 tps: 279.82 qps: 5649.14 (r/w/o: 3961.11/1120.39/567.64) lat (ms,95%): 467.30 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 336.51 qps: 6786.91 (r/w/o: 4759.38/1354.52/673.01) lat (ms,95%): 390.30 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 246.00 qps: 4918.91 (r/w/o: 3441.11/985.80/492.00) lat (ms,95%): 520.62 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 306.70 qps: 6129.61 (r/w/o: 4290.91/1225.30/613.40) lat (ms,95%): 434.83 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 354.50 qps: 7104.99 (r/w/o: 4974.69/1421.30/709.00) lat (ms,95%): 369.77 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 339.50 qps: 6785.12 (r/w/o: 4741.72/1364.40/679.00) lat (ms,95%): 376.49 err/s: 0.00 reconn/s: 0.00MYSQL单机OLTP只读场景压测[ 1s ] thds: 80 tps: 2322.83 qps: 37870.75 (r/w/o: 33145.27/0.00/4725.49) lat (ms,95%): 51.02 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 2927.99 qps: 46815.91 (r/w/o: 40960.92/0.00/5854.99) lat (ms,95%): 35.59 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 3440.21 qps: 55064.31 (r/w/o: 48183.89/0.00/6880.41) lat (ms,95%): 31.94 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 3973.17 qps: 63529.73 (r/w/o: 55585.39/0.00/7944.34) lat (ms,95%): 27.17 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 4175.91 qps: 66879.59 (r/w/o: 58526.76/0.00/8352.82) lat (ms,95%): 26.20 err/s: 0.00 reconn/s: 0.00[ 76s ] thds: 80 tps: 4714.21 qps: 75534.39 (r/w/o: 66105.97/0.00/9428.42) lat (ms,95%): 22.69 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 4679.42 qps: 74748.76 (r/w/o: 65388.92/0.00/9359.85) lat (ms,95%): 23.10 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 4737.18 qps: 75766.94 (r/w/o: 66295.57/0.00/9471.37) lat (ms,95%): 22.28 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 4650.49 qps: 74527.85 (r/w/o: 65222.87/0.00/9304.98) lat (ms,95%): 23.10 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 4664.70 qps: 74592.18 (r/w/o: 65266.78/0.00/9325.40) lat (ms,95%): 22.69 err/s: 0.00 reconn/s: 0.00OB集群 1zone6主机OLTP读写混合场景[ 10s ] thds: 80 tps: 194.03 qps: 3980.77 (r/w/o: 2799.12/785.60/396.05) lat (ms,95%): 960.30 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 585.61 qps: 11728.84 (r/w/o: 8211.80/2345.83/1171.21) lat (ms,95%): 267.41 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 1159.31 qps: 23173.24 (r/w/o: 16218.30/4636.33/2318.61) lat (ms,95%): 104.84 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 1573.49 qps: 31474.50 (r/w/o: 22032.76/6294.86/3146.88) lat (ms,95%): 70.55 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 1568.68 qps: 31364.68 (r/w/o: 21954.30/6272.92/3137.46) lat (ms,95%): 89.16 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 1876.77 qps: 37543.14 (r/w/o: 26280.21/7509.89/3753.04) lat (ms,95%): 55.82 err/s: 0.00 reconn/s: 0.00OB集群 1zone6主机OLTP只读场景压测[ 1s ] thds: 80 tps: 258.36 qps: 4791.07 (r/w/o: 4194.56/0.00/596.51) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 523.06 qps: 8405.99 (r/w/o: 7359.87/0.00/1046.12) lat (ms,95%): 601.29 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 678.97 qps: 10798.50 (r/w/o: 9440.56/0.00/1357.94) lat (ms,95%): 376.49 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 974.06 qps: 15628.02 (r/w/o: 13679.90/0.00/1948.13) lat (ms,95%): 277.21 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 1244.00 qps: 19876.04 (r/w/o: 17388.04/0.00/2488.01) lat (ms,95%): 207.82 err/s: 0.00 [ 76s ] thds: 80 tps: 5320.92 qps: 85129.68 (r/w/o: 74486.85/0.00/10642.83) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 5331.83 qps: 85282.34 (r/w/o: 74620.67/0.00/10661.67) lat (ms,95%): 18.95 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 5279.20 qps: 84432.24 (r/w/o: 73874.84/0.00/10557.41) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 5431.77 qps: 86835.31 (r/w/o: 75971.77/0.00/10863.54) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 5411.58 qps: 86724.27 (r/w/o: 75901.11/0.00/10823.16) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00PG单机OLTP读写混合场景[ 10s ] thds: 80 tps: 150.17 qps: 3145.15 (r/w/o: 2213.04/623.77/308.34) lat (ms,95%): 1050.76 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 189.60 qps: 3731.26 (r/w/o: 2612.54/739.51/379.21) lat (ms,95%): 1327.91 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 299.30 qps: 5992.23 (r/w/o: 4196.32/1197.31/598.60) lat (ms,95%): 530.08 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 340.40 qps: 6804.74 (r/w/o: 4763.56/1360.39/680.79) lat (ms,95%): 484.44 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 425.30 qps: 8512.85 (r/w/o: 5959.04/1703.21/850.61) lat (ms,95%): 376.49 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 592.39 qps: 11850.79 (r/w/o: 8294.72/2371.28/1184.79) lat (ms,95%): 257.95 err/s: 0.00 reconn/s: 0.00PG单机OLTP只读场景压测[ 1s ] thds: 80 tps: 358.25 qps: 6397.54 (r/w/o: 5602.21/0.00/795.33) lat (ms,95%): 467.30 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 675.16 qps: 10843.59 (r/w/o: 9492.27/0.00/1351.32) lat (ms,95%): 282.25 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 773.98 qps: 12380.60 (r/w/o: 10833.65/0.00/1546.95) lat (ms,95%): 235.74 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 583.02 qps: 9271.26 (r/w/o: 8104.23/0.00/1167.03) lat (ms,95%): 419.45 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 900.02 qps: 14466.28 (r/w/o: 12666.24/0.00/1800.03) lat (ms,95%): 272.27 err/s: 0.00 reconn/s: 0.00[ 75s ] thds: 80 tps: 7219.92 qps: 115510.73 (r/w/o: 101073.88/0.00/14436.84) lat (ms,95%): 16.12 err/s: 0.00 reconn/s: 0.00[ 76s ] thds: 80 tps: 7312.11 qps: 117077.83 (r/w/o: 102446.60/0.00/14631.23) lat (ms,95%): 15.55 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 7336.09 qps: 117346.48 (r/w/o: 102677.30/0.00/14669.19) lat (ms,95%): 15.27 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 6918.94 qps: 110807.00 (r/w/o: 96968.13/0.00/13838.88) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 6900.01 qps: 110262.12 (r/w/o: 96464.11/0.00/13798.02) lat (ms,95%): 20.00 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 7222.03 qps: 115629.55 (r/w/o: 101186.49/0.00/14443.07) lat (ms,95%): 15.00 err/s: 0.00 reconn/s: 0.00PG单机6容器集群OLTP读写混合场景[ 10s ] thds: 80 tps: 68.18 qps: 1453.28 (r/w/o: 1031.17/277.74/144.37) lat (ms,95%): 2362.72 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 111.10 qps: 2229.06 (r/w/o: 1564.75/442.21/222.11) lat (ms,95%): 893.56 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 128.00 qps: 2567.82 (r/w/o: 1796.71/515.00/256.10) lat (ms,95%): 773.68 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 136.10 qps: 2713.78 (r/w/o: 1898.08/543.60/272.10) lat (ms,95%): 719.92 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 138.90 qps: 2773.51 (r/w/o: 1940.90/554.70/277.90) lat (ms,95%): 707.07 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 137.50 qps: 2750.50 (r/w/o: 1927.00/548.50/275.00) lat (ms,95%): 719.92 err/s: 0.00 reconn/s: 0.00PG单机6容器集群OLTP只读场景压测[ 1s ] thds: 80 tps: 0.00 qps: 820.05 (r/w/o: 740.24/0.00/79.81) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 11.00 qps: 256.10 (r/w/o: 234.09/0.00/22.01) lat (ms,95%): 1973.38 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 71.01 qps: 1037.15 (r/w/o: 895.13/0.00/142.02) lat (ms,95%): 2778.39 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 67.00 qps: 1121.96 (r/w/o: 987.97/0.00/134.00) lat (ms,95%): 1678.14 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 84.00 qps: 1388.04 (r/w/o: 1220.03/0.00/168.00) lat (ms,95%): 2009.23 err/s: 0.00 reconn/s: 0.00[ 75s ] thds: 80 tps: 221.98 qps: 3532.71 (r/w/o: 3088.75/0.00/443.96) lat (ms,95%): 467.30 err/s: 0.00 reconn/s: 0.00[ 76s ] thds: 80 tps: 224.99 qps: 3537.87 (r/w/o: 3087.89/0.00/449.98) lat (ms,95%): 493.24 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 223.02 qps: 3609.26 (r/w/o: 3163.23/0.00/446.03) lat (ms,95%): 502.20 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 222.00 qps: 3577.02 (r/w/o: 3133.02/0.00/444.00) lat (ms,95%): 502.20 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 232.99 qps: 3643.80 (r/w/o: 3177.82/0.00/465.97) lat (ms,95%): 502.20 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 215.02 qps: 3571.29 (r/w/o: 3141.26/0.00/430.03) lat (ms,95%): 458.96 err/s: 0.00 reconn/s: 0.00PG6主机集群 2副本5工作节点32分片哈希分布OLTP读写混合场景[ 10s ] thds: 80 tps: 6.20 qps: 217.91 (r/w/o: 172.23/25.29/20.39) lat (ms,95%): 9624.59 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 17.80 qps: 351.61 (r/w/o: 244.91/71.10/35.60) lat (ms,95%): 11523.48 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 18.90 qps: 374.59 (r/w/o: 261.60/75.20/37.80) lat (ms,95%): 6476.48 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 14.60 qps: 294.10 (r/w/o: 206.50/58.40/29.20) lat (ms,95%): 7895.16 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 17.60 qps: 351.69 (r/w/o: 246.09/70.40/35.20) lat (ms,95%): 7615.89 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 20.70 qps: 414.81 (r/w/o: 290.50/82.90/41.40) lat (ms,95%): 6026.41 err/s: 0.00 reconn/s: 0.00PG6主机集群 2副本5工作节点32分片哈希分布OLTP只读场景压测[ 1s ] thds: 80 tps: 0.00 qps: 253.20 (r/w/o: 173.45/0.00/79.75) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 0.00 qps: 315.14 (r/w/o: 315.14/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 0.00 qps: 310.98 (r/w/o: 310.98/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00[ 75s ] thds: 80 tps: 17.00 qps: 272.01 (r/w/o: 238.01/0.00/34.00) lat (ms,95%): 4280.32 err/s: 0.00 reconn/s: 0.00[ 76s ] thds: 80 tps: 22.00 qps: 351.98 (r/w/o: 307.98/0.00/44.00) lat (ms,95%): 4203.93 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 27.00 qps: 432.02 (r/w/o: 378.02/0.00/54.00) lat (ms,95%): 4855.31 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 20.00 qps: 320.00 (r/w/o: 280.00/0.00/40.00) lat (ms,95%): 4358.09 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 21.00 qps: 318.97 (r/w/o: 276.97/0.00/42.00) lat (ms,95%): 4280.32 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 26.00 qps: 435.97 (r/w/o: 383.98/0.00/52.00) lat (ms,95%): 4280.32 err/s: 0.00 reconn/s: 0.00PG6主机集群 2副本5工作节点5分片哈希分布OLTP读写混合场景[ 10s ] thds: 80 tps: 18.70 qps: 480.68 (r/w/o: 354.91/80.38/45.39) lat (ms,95%): 6247.39 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 49.90 qps: 992.92 (r/w/o: 693.82/199.30/99.80) lat (ms,95%): 2828.87 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 68.90 qps: 1369.50 (r/w/o: 958.00/273.70/137.80) lat (ms,95%): 2082.91 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 51.40 qps: 1051.00 (r/w/o: 736.00/212.20/102.80) lat (ms,95%): 2880.27 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 58.80 qps: 1164.10 (r/w/o: 815.90/230.60/117.60) lat (ms,95%): 2198.52 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 62.90 qps: 1242.19 (r/w/o: 867.69/248.70/125.80) lat (ms,95%): 1973.38 err/s: 0.00 reconn/s: 0.00PG6主机集群 2副本5工作节点5分片哈希分布OLTP读写混合场景[ 1s ] thds: 80 tps: 0.00 qps: 195.52 (r/w/o: 115.72/0.00/79.80) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 1.00 qps: 578.18 (r/w/o: 576.18/0.00/2.00) lat (ms,95%): 1973.38 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 67.00 qps: 989.03 (r/w/o: 855.03/0.00/134.00) lat (ms,95%): 2985.89 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 136.99 qps: 2305.88 (r/w/o: 2031.89/0.00/273.99) lat (ms,95%): 3095.38 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 200.98 qps: 3237.63 (r/w/o: 2835.67/0.00/401.95) lat (ms,95%): 787.74 err/s: 0.00 reconn/s: 0.00[ 75s ] thds: 80 tps: 795.93 qps: 12744.86 (r/w/o: 11154.01/0.00/1590.86) lat (ms,95%): 458.96 err/s: 0.00 reconn/s: 0.00[ 76s ] thds: 80 tps: 749.04 qps: 11941.61 (r/w/o: 10442.53/0.00/1499.08) lat (ms,95%): 475.79 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 729.03 qps: 11708.42 (r/w/o: 10250.37/0.00/1458.05) lat (ms,95%): 484.44 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 744.98 qps: 11892.74 (r/w/o: 10402.77/0.00/1489.97) lat (ms,95%): 442.73 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 739.02 qps: 11824.28 (r/w/o: 10346.25/0.00/1478.04) lat (ms,95%): 434.83 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 761.99 qps: 12226.87 (r/w/o: 10702.88/0.00/1523.98) lat (ms,95%): 419.45 err/s: 0.00 reconn/s: 0.00mariaDB单机OLTP读写混合场景[ 10s ] thds: 80 tps: 100.18 qps: 2130.57 (r/w/o: 1507.19/415.02/208.36) lat (ms,95%): 1280.93 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 125.20 qps: 2464.65 (r/w/o: 1721.73/492.51/250.40) lat (ms,95%): 909.80 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 135.70 qps: 2726.24 (r/w/o: 1908.86/545.99/271.39) lat (ms,95%): 816.63 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 156.80 qps: 3113.73 (r/w/o: 2178.95/621.19/313.59) lat (ms,95%): 719.92 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 133.71 qps: 2690.01 (r/w/o: 1886.48/536.12/267.41) lat (ms,95%): 802.05 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 132.90 qps: 2663.70 (r/w/o: 1862.30/535.60/265.80) lat (ms,95%): 1032.01 err/s: 0.00 reconn/s: 0.00mariaDB单机OLTP只读场景压测[ 1s ] thds: 80 tps: 1053.26 qps: 17530.32 (r/w/o: 15344.01/0.00/2186.30) lat (ms,95%): 458.96 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 3058.47 qps: 48963.52 (r/w/o: 42846.58/0.00/6116.94) lat (ms,95%): 39.65 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 3993.09 qps: 63878.37 (r/w/o: 55892.20/0.00/7986.17) lat (ms,95%): 29.19 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 3401.95 qps: 54410.25 (r/w/o: 47606.34/0.00/6803.91) lat (ms,95%): 38.25 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 3410.99 qps: 54540.82 (r/w/o: 47718.84/0.00/6821.98) lat (ms,95%): 38.25 err/s: 0.00 reconn/s: 0.00[ 75s ] thds: 80 tps: 3695.36 qps: 59142.79 (r/w/o: 51753.07/0.00/7389.72) lat (ms,95%): 34.33 err/s: 0.00 reconn/s: 0.00[ 76s ] thds: 80 tps: 3858.59 qps: 61812.42 (r/w/o: 54095.24/0.00/7717.18) lat (ms,95%): 31.94 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 3674.11 qps: 58735.75 (r/w/o: 51387.54/0.00/7348.22) lat (ms,95%): 36.24 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 3974.16 qps: 63621.59 (r/w/o: 55672.26/0.00/7949.32) lat (ms,95%): 33.12 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 5416.04 qps: 86639.63 (r/w/o: 75808.55/0.00/10831.08) lat (ms,95%): 21.11 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 5403.05 qps: 86473.78 (r/w/o: 75667.68/0.00/10806.10) lat (ms,95%): 21.50 err/s: 0.00 reconn/s: 0.00六、小结 table_size=1000000 tables=350 threads=80 mysql单机数据量大约140GMYSQL8.4.3单机 32C64G默认设置PGSQL17单机 32C64G默认设置OB集群 1zone6主机 租户48C96G默认设置PG单机6容器集群 2副本5工作节点哈希分布PG6主机集群 2副本5工作节点32分片哈希分布 48C96GPG6主机集群 2副本5工作节点5分片哈希分布 48C96GmariaDB11.5.2 32C64G默认设置读写混合场景下OB集群遥遥领先>PG单机>MYSQL单机>Maria DB单机>PG单机容器集群>PG6主机集群几乎无法使用 只读场景下PG单机>OB集群>MYSQL单机≈mariaDB单机>PG单机容器集群>PG6主机集群几乎无法使用
2024年11月22日
169 阅读
0 评论
0 点赞
2024-11-19
采用开源Zabbix+500块硬件平替5万块动环检测系统,实现UPS、温湿度、烟雾等数据采集、存储、告警、大屏展示、RS485 Modbus采集、RS232采集
架构展示: 大屏展示: 所需软件: ZabbixGrafana安装Zabbix-agent2的采集服务器MThings串口调试软件厂家自带UPS监控软件USR-VCOM有人虚拟串口软件所需硬件: 有人串口服务器(USR-N510)有人串口服务器 USR-TCP232-306自制RS485连接线万图思睿 SD123-ST01 RS485温湿度变送器万图思睿 SD123-SA01-R4 RS485烟感报警器所需资料: 科士达YDC3330 modbus开发文档YDC3330说明书一、安装、配置串口服务器 1、硬件安装制作UPS所需要的RS485通讯线,我使用了1、2、8,分别是485+、485-、GND地线,而12V是不需要连接的,因为我们连接的对象是UPS,它并不需要我们通过12V为其供电。如果我们连接的是温湿度计,则需要通过12V为其供电。YDC3330自带两个RS485接口,其支持菊花链连接,所以我使用RS485线一根接一根串起来,这样外观美观。注意,UPS接线非常危险,注意安全!串口服务器只需要将串口模式拨到RS485,并且连接电源、网线、串口线即可2、网络更改按串口服务器背面IP地址,登录,修改IP地址和串口参数、协议参数。右上角更改语言,左侧更改IP地址、按UPS说明书要求调整串口内容,我这里使用的9600:8n1,下方我这里需要使用厂家的UPS软件测试,所以使用的TcpServer None,后面使用Zabbix modbus-get的时候,就需要改成ModbusTCP了二、解析文档 1、使用厂家软件测试安装USR-VCOM有人虚拟串口软件,这个软件的作用可以理解为通过网络将串口无限延长。串口 - 有人串口服务器 - 虚拟串口此时我们使用厂家的UPS软件,软件正常运行通过菊花链串联的方式,4台UPS都上线了,可以搜索到站号分别为1、5、6、7,这个后面要用到2、解析参数如何获取我们需要的参数呢假设,我们要获取A相输入电压,查看说明书采用的modbus-RTU报文格式如图功能码对照表A相输入电压地址,大小2Byte按modbus-RTU组合参数,此时的报文为 01 04 75 30 00 01 XX XX01为站号1 04为功能码,我们要取的30001在功能码中为04H读 75 30为30000的十六进制 00 01为读取一个寄存器地址,即30001的数据,同理我们要读取ABC三相输入,此处就为00 03三个寄存器地址 XX XX为校验码,modbus调试软件可以自动生成使用MThings调试,确认我们要获取的数据没问题此处发现厂家说明书印刷错误,印刷运行状态为30070,实际测试为30080三、配置Zabbix 1、修改串口服务器为modbus-tcp模式2、通过zabbix-agent2获取数据安装一台主机,并安装zabbix-agent2,接入zabbix在zabbix服务器上通过命令请求数据,可以看到数据返回正常zabbix_get -s 172.16.21.5 -k modbus.get[tcp://172.16.10.201:9000,1,4,30000,81] zabbix_get -s 172.16.21.5 指定请求的客户端 -k modbus.get 以modbus.get方式请求 tcp://172.16.10.201:9000,1,4,30000,81 串口服务器IP端口,站号1,功能码4,从30000开始请求,请求81个寄存器数据3、制作zabbix监控项我们采用的方式是一次请求,分段解析添加监控项制作modbus-get监控项,按图片填写即可键值:modbus.get[tcp://172.16.10.201:9000,1,4,30000,81] 信息类型:文本添加监控项制作数据分类监控项,从modbus-get监控项获取数据注意类型为:相关项目 主要项是modbus-get监控项还没完,点击到进程中,此处是配置获取第几位的数值,有没有倍率关系,倍率关系看说明书JSONPath = $[17] 自定义倍数 = 0.14、制作zabbix报警项添加触发器last(/donghuan/ups1yunxingzhuangtai)=5当ups1yunxingzhuangtai值为5时报警,5的值在说明书中为市电中断拉闸测试,5s内收到微信告警添加监控数据获取失败报警表达式: nodata(/donghuan/modbus.get[tcp://172.16.10.201:9000,7,4,30000,81],30)=1 30秒后无数据进行报警四、配置大屏 Grafana正常接入Zabbix添加一项,一看就懂按自己的喜好风格制作大屏即可五、温湿度、烟雾传感器协议解析 新增内容:温湿度采集修改设备地址烟雾采集手动触发烟雾告警读取烟雾信号万图思睿的产品修改设备地址方式相同六、施耐德APC Smart-UPS RS232采集 1、连接信息默认波特率为24002、查询字符Y 让设备进入查询模式 j 续航时间 L 输入电压 O 输出电压 C 当前温度 Q 电池状态 f 电容容量 \ 当前负载3、发送数据编写python程序形成UPSdata数据,格式建议为[x,y,z],便于zabbix解析服务器安装有人vcom软件,将串口连接到服务器zabbix_sender.exe -c zabbix_agent2.conf -k 键值 -o "发送的数据"4、zabbix接收创建 zabbix采集器 键值与zabbix_sender发送的键值对应5、查看接收的数据6、python采集程序示例import serial,time,os def main(): # 配置串口参数 ser = serial.Serial( port='COM11', # 根据实际情况修改串口号,例如 Windows 上可能是 'COM3' baudrate=2400, # 设置波特率,根据实际情况修改 timeout=1 # 设置读取超时时间 ) if ser.is_open: print(f"串口 {ser.port} 已打开,查询 施耐德UPS 信息") else: print(f"无法打开串口 {ser.port}") return try: # 发送字符 'Y' ser.write(b'Y') # 等待一段时间让设备响应 time.sleep(0.1) # 读取返回的数据 response = ser.read(ser.in_waiting ) # 读取所有等待数据或至少1字节 if response: UPS1_list = response.decode('utf-8', errors='ignore').splitlines() if UPS1_list[0] == "SM": try: ser.write(b'jLOCQf\\Y') # 等待一段时间让设备响应 time.sleep(0.1) # 读取返回的数据 response = ser.read(ser.in_waiting or 100) # 读取所有等待数据或至少1字节 if response: UPS2_list = response.decode('utf-8', errors='ignore').splitlines() if UPS2_list[7] == "SM": print("续航时间"+UPS2_list[0].lstrip('0').replace(':','')+"分钟 输入电压"+UPS2_list[1]+"V 输出电压"+UPS2_list[2]+"V 当前温度"+UPS2_list[3].lstrip('0')+"摄氏度 电池容量"+UPS2_list[5]+"% 当前负载"+UPS2_list[6].lstrip('0')+"%") UPS3_list = str("["+UPS2_list[0].lstrip('0').replace(':','')+","+UPS2_list[1]+","+UPS2_list[2]+","+UPS2_list[3].lstrip('0')+","+UPS2_list[5]+","+UPS2_list[6].lstrip('0')+"]") command_array = ['zabbix_sender.exe','-c','zabbix_agent2.conf','-k','upsrs232','-o',UPSdata] command_str = ' '.join(command_array) print(command_array) print(command_str) result = os.popen(command_str) print(result.read()) else: print("没有接收到返回数据,连接错误") except Exception as e: print(f"通信过程中发生错误: {e}") else: print("UPS连接错误") else: print("没有接收到返回数据,连接错误") except Exception as e: print(f"通信过程中发生错误: {e}") finally: # 关闭串口 ser.close() print(f"串口 {ser.port} 已关闭") if __name__ == "__main__": main() 七、小结 文章很流畅,但现实并不会如此顺利。第一次,使用的串口线有问题,导致无法连接UPS第二次,厂家给我发错了文档,连续一星期无法测试成功第三次,厂家发对了文档,但是文档的内容错误,导致获取的数据不正确半个月时间分析协议,最后接入Zabbix制作大屏仅用了半天而已最后,Zabbix无比强大,值得深入学习!时隔两年,增加了RS232采集Zabbix真的太强大了
2024年11月19日
991 阅读
0 评论
15 点赞
2024-11-08
快速部署OceanBase 集群 1ZONE 6节点,使用SysBench对比测试mysql8.4单节点
一、环境准备 1、安装规划使用anolis8.9系统,1个zone,6台主机,1为rootserver,2 3安装obproxy 4安装ocp exp关闭防火墙,避免影响实验 systemctl stop firewalld && systemctl disable firewalld2、使用obd在线部署当您选择在线部署时,可以参考本节命令在中控机上安装 obd。sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo sudo yum install -y ob-deploy source /etc/profile.d/obd.sh3、安装java环境,OCP Express要求java1.8https://www.java.com/en/download/manual.jsp下载 Linux x64 RPM filesize: 104.47 安装[root@ob2 ~]# rpm -ivh jre-8u431-linux-x64.rpm 警告:jre-8u431-linux-x64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID ad986da3: NOKEY Verifying... ################################# [100%] 准备中... ################################# [100%] 正在升级/安装... 1:jre-1.8-1.8.0_431-10 ################################# [100%] [root@ob2 ~]# java -version java version "1.8.0_431" Java(TM) SE Runtime Environment (build 1.8.0_431-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.431-b10, mixed mode) 4、配置优化每台主机执行echo -e "* soft nofile 655350\n* hard nofile 655350" >> /etc/security/limits.d/nofile.conf echo "vm.max_map_count=655360" >> /etc/sysctl.conf; sysctl -p echo "fs.file-max=6573688" >> /etc/sysctl.conf; sysctl -p5、启动白屏安装 注意,命令需要在本地终端执行,不可以远程ssh执行 obd web如果ssh远程执行obd web,会报ceanbase-ce:ssh 原因:OBD-1013 : root@x.x.x.x connect failed: could not get keys from ssh-agent 建议:手动修复 Please check user config and network二、安装环境 我这里安装OCP Express我这里rootserver、ocpEXP、obproxy分散在各个主机上等待部署完成安装完成,记好密码三、配置使用 登录ocp exphttp://IP:8180/配置租户等待租户创建完成后,创建数据库和用户连接测试可通过rootserver2881端口连接也可通过obproxy 2883端口连接四、性能测试 均在同一个超融合集群中 MYSQL8.4.3单机 32C64GOB集群 1zone6主机 8Cx6 16Gx6table_size=1000000 tables=350 threads=80 数据量大约140G安装SysBench配置epel源yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel* sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*安装SysBenchyum install sysbenchOB集群OLTP读写混合场景 清除数据sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform --time=60 cleanup初始化测试数据sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform --time=60 prepare执行测试sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --time=60 --rand-type=uniform --db-ps-mode=disable runOB集群OLTP只读场景压测 准备数据sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 oltp_read_only prepare运行压测sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 --report-interval=1 oltp_read_only run清理数据sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 oltp_read_only cleanupMYSQL单机OLTP读写混合场景 清除数据sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform --time=60 cleanup初始化测试数据sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --rand-type=uniform --time=60 prepare执行测试sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=IP地址 --mysql-port=端口 --mysql-db=数据库名 --mysql-user=用户名 --mysql-password=密码 --table_size=1000000 --tables=350 --threads=80 --report-interval=10 --time=60 --rand-type=uniform --db-ps-mode=disable runMYSQL单机OLTP只读场景压测 准备数据sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 oltp_read_only prepare运行压测sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 --report-interval=1 oltp_read_only run清理数据sysbench --db-driver=mysql --mysql-host=IP地址 --mysql-port=端口 --mysql-user=用户名 --mysql-password=密码 --mysql-db=数据库名 --table_size=1000000 --tables=350 --events=0 --time=300 --threads=80 --percentile=95 oltp_read_only cleanup测试结果 MYSQL单机OLTP读写混合场景[ 10s ] thds: 80 tps: 279.82 qps: 5649.14 (r/w/o: 3961.11/1120.39/567.64) lat (ms,95%): 467.30 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 336.51 qps: 6786.91 (r/w/o: 4759.38/1354.52/673.01) lat (ms,95%): 390.30 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 246.00 qps: 4918.91 (r/w/o: 3441.11/985.80/492.00) lat (ms,95%): 520.62 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 306.70 qps: 6129.61 (r/w/o: 4290.91/1225.30/613.40) lat (ms,95%): 434.83 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 354.50 qps: 7104.99 (r/w/o: 4974.69/1421.30/709.00) lat (ms,95%): 369.77 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 339.50 qps: 6785.12 (r/w/o: 4741.72/1364.40/679.00) lat (ms,95%): 376.49 err/s: 0.00 reconn/s: 0.00MYSQL单机OLTP只读场景压测[ 1s ] thds: 80 tps: 2322.83 qps: 37870.75 (r/w/o: 33145.27/0.00/4725.49) lat (ms,95%): 51.02 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 2927.99 qps: 46815.91 (r/w/o: 40960.92/0.00/5854.99) lat (ms,95%): 35.59 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 3440.21 qps: 55064.31 (r/w/o: 48183.89/0.00/6880.41) lat (ms,95%): 31.94 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 3973.17 qps: 63529.73 (r/w/o: 55585.39/0.00/7944.34) lat (ms,95%): 27.17 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 4175.91 qps: 66879.59 (r/w/o: 58526.76/0.00/8352.82) lat (ms,95%): 26.20 err/s: 0.00 reconn/s: 0.00[ 76s ] thds: 80 tps: 4714.21 qps: 75534.39 (r/w/o: 66105.97/0.00/9428.42) lat (ms,95%): 22.69 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 4679.42 qps: 74748.76 (r/w/o: 65388.92/0.00/9359.85) lat (ms,95%): 23.10 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 4737.18 qps: 75766.94 (r/w/o: 66295.57/0.00/9471.37) lat (ms,95%): 22.28 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 4650.49 qps: 74527.85 (r/w/o: 65222.87/0.00/9304.98) lat (ms,95%): 23.10 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 4664.70 qps: 74592.18 (r/w/o: 65266.78/0.00/9325.40) lat (ms,95%): 22.69 err/s: 0.00 reconn/s: 0.00OB集群 1zone6主机OLTP读写混合场景[ 10s ] thds: 80 tps: 194.03 qps: 3980.77 (r/w/o: 2799.12/785.60/396.05) lat (ms,95%): 960.30 err/s: 0.00 reconn/s: 0.00[ 20s ] thds: 80 tps: 585.61 qps: 11728.84 (r/w/o: 8211.80/2345.83/1171.21) lat (ms,95%): 267.41 err/s: 0.00 reconn/s: 0.00[ 30s ] thds: 80 tps: 1159.31 qps: 23173.24 (r/w/o: 16218.30/4636.33/2318.61) lat (ms,95%): 104.84 err/s: 0.00 reconn/s: 0.00[ 40s ] thds: 80 tps: 1573.49 qps: 31474.50 (r/w/o: 22032.76/6294.86/3146.88) lat (ms,95%): 70.55 err/s: 0.00 reconn/s: 0.00[ 50s ] thds: 80 tps: 1568.68 qps: 31364.68 (r/w/o: 21954.30/6272.92/3137.46) lat (ms,95%): 89.16 err/s: 0.00 reconn/s: 0.00[ 60s ] thds: 80 tps: 1876.77 qps: 37543.14 (r/w/o: 26280.21/7509.89/3753.04) lat (ms,95%): 55.82 err/s: 0.00 reconn/s: 0.00OB集群 1zone6主机OLTP只读场景压测[ 1s ] thds: 80 tps: 258.36 qps: 4791.07 (r/w/o: 4194.56/0.00/596.51) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00[ 2s ] thds: 80 tps: 523.06 qps: 8405.99 (r/w/o: 7359.87/0.00/1046.12) lat (ms,95%): 601.29 err/s: 0.00 reconn/s: 0.00[ 3s ] thds: 80 tps: 678.97 qps: 10798.50 (r/w/o: 9440.56/0.00/1357.94) lat (ms,95%): 376.49 err/s: 0.00 reconn/s: 0.00[ 4s ] thds: 80 tps: 974.06 qps: 15628.02 (r/w/o: 13679.90/0.00/1948.13) lat (ms,95%): 277.21 err/s: 0.00 reconn/s: 0.00[ 5s ] thds: 80 tps: 1244.00 qps: 19876.04 (r/w/o: 17388.04/0.00/2488.01) lat (ms,95%): 207.82 err/s: 0.00 [ 76s ] thds: 80 tps: 5320.92 qps: 85129.68 (r/w/o: 74486.85/0.00/10642.83) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00[ 77s ] thds: 80 tps: 5331.83 qps: 85282.34 (r/w/o: 74620.67/0.00/10661.67) lat (ms,95%): 18.95 err/s: 0.00 reconn/s: 0.00[ 78s ] thds: 80 tps: 5279.20 qps: 84432.24 (r/w/o: 73874.84/0.00/10557.41) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00[ 79s ] thds: 80 tps: 5431.77 qps: 86835.31 (r/w/o: 75971.77/0.00/10863.54) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00[ 80s ] thds: 80 tps: 5411.58 qps: 86724.27 (r/w/o: 75901.11/0.00/10823.16) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00总结在只读场景下,OB集群性能领先约15%左右在读写混合场景下,OB集群性能领先约6倍左右
2024年11月08日
121 阅读
0 评论
0 点赞
2024-09-19
群晖ABB(Active Backup for Business) vSphere、物理机备份恢复实验
群晖ABB是由群晖提供的企业级数据备份工具,无授权数量限制,具有去重、差异备份等功能,几乎可以满足中小企业和家庭用户的所有备份需求,本文重点介绍vSphere虚拟机备份恢复功能。群晖ABB官方介绍页面https://www.synology.cn/zh-cn/dsm/feature/active_backup_business一、安装ABB套件 二、虚拟机vSphere备份还原 1、配置备份计划进入ABB,虚拟机页面接入vCenter配置备份任务为减轻设备压力和对网络的影响,可以开启数据压缩并限制并发任务数配置任务执行时间配置任务保留计划配置管理2、监控备份任务3、基于ABB进行即时还原选择要恢复的虚拟机、时间点可以跨平台还原可以先即时还原,然后再同步数据还原位置,我这里实验选择还原到其他位置选择文件夹选择虚拟化主机选择网络确认还原参数,建议不要勾选开机即时还原完成vSphere中可以看到虚拟机准备就绪,我们可以将这个虚拟机的网络关闭再开机,防止IP冲突系统启动成功4、虚拟机数据同步迁移 将即时还原迁移为永久数据迁移中,不影响虚拟机运行迁移完成三、物理机备份还原 1、准备一台windows服务器2、配置备份任务备份模板,可选备份所有硬盘、所有硬盘+外接硬盘、系统盘三种方式下载备份代理3、目标主机运行代理程序在代理程序中登录群晖登陆成功4、进行备份操作登录群晖ABB,已经发现了物理机执行备份任务5、制作还原映像恢复介质创建https://kb.synology.cn/zh-cn/DSM/help/ActiveBackupRecoveryMediaCreator/activebackuprecoverymediacreator?version=7#ISO可创建ISO文件或直接写入到U盘中制作启动盘6、执行还原操作通过ISO或U盘启动进入群晖恢复模式配置IP地址选择备份的主机选择分区还原等待还原结束即可 四、小结 666
2024年09月19日
435 阅读
0 评论
2 点赞
2024-08-24
实战H3C交换机升级固件
一、前言 通常情况下,交换机是非常稳定的,但只要是软件就会有bug,所以设备厂家都会提供固件的更新,比如我使用的华三交换机,就出现了一些奇奇怪怪的问题,随即想到升级固件试一下。二、固件下载 华三交换机固件下载地址在华三官网 首页-支持-文档与软件-软件下载-交换机https://www.h3c.com/cn/Service/Document_Software/Software_Download/Switches/当前H3C官方关闭了公共下载账号,请自行注册账号,绑定SN码下载固件https://www.h3c.com/cn/BizPortal/OnlineSurvey/UserSNBind.aspx注意:华三交换机的系统固件和BootRom已经放在一块了,一次升级即可全部升级。注意:不同固件的华三命令稍有不同,若命令无法执行,用问号?可查看详细提示。我的交换机型号为H3C S5120-28P-SI,能够选择的最新的固件为H3C S5120SI_E-CMW520-R1519P06,下载该型号并解压出S5120SI_E-CMW520-R1519P06.bin三、通过USB升级固件copy usba0:/S6520X-CMW710-R6628P40.ipe S6520X-CMW710-R6628P40.ipe boot-loader file flash:/S6520X-CMW710-R6628P40.ipe all main reboot dis version四、通过网络升级固件 下载3CDaemon汉化版,并配置TFTP服务配置服务目录注意:关闭系统防火墙或添加端口 交换机清空配置并直连电脑清空的目的是为了防止有配置兼容问题<H3C>reset saved-configuration The saved configuration file will be erased. Are you sure? [Y/N]:y Configuration file in flash is being cleared. Please wait ... Configuration file is cleared. <H3C>reboot Start to check configuration with next startup configuration file, please wait.........DONE! This command will reboot the device. Current configuration may be lost in next startup if you continue. Continue? [Y/N]:y System is rebooting now.为交换机配置vlanip与电脑互联,电脑IP为192.168.18.2<H3C>sys System View: return to User View with Ctrl+Z. [H3C]int vlan 1 [H3C-Vlan-interface1]ip add 192.168.18.1 24 [H3C-Vlan-interface1]ping 192.168.18.2 PING 192.168.18.2: 56 data bytes, press CTRL_C to break Reply from 192.168.18.2: bytes=56 Sequence=1 ttl=64 time=7 ms Reply from 192.168.18.2: bytes=56 Sequence=2 ttl=64 time=3 ms Reply from 192.168.18.2: bytes=56 Sequence=3 ttl=64 time=3 ms Reply from 192.168.18.2: bytes=56 Sequence=4 ttl=64 time=3 ms --- 192.168.18.2 ping statistics --- 4 packet(s) transmitted 4 packet(s) received 0.00% packet loss round-trip min/avg/max = 3/4/7 ms 上传固件空间充裕[H3C-Vlan-interface1]quit [H3C]quit <H3C>dir Directory of flash:/ 0 -rw- 341 Apr 26 2000 12:10:45 system.xml 1 -rw- 10184320 Jun 29 2010 14:14:25 s5120si-cmw520-r1101p10.bin 2 drw- - Apr 26 2000 12:00:02 logfile 97920 KB total (81690 KB free)上传固件<H3C>tftp 192.168.18.2 get S5120SI_E-CMW520-R1519P06.bin File will be transferred in binary mode Downloading file from remote TFTP server, please wait.../ TFTP: 14877696 bytes received in 118 second(s) File downloaded successfully. <H3C>dir Directory of flash:/ 0 -rw- 14877696 Apr 26 2000 12:19:55 s5120si_e-cmw520-r1519p06.bin 1 -rw- 341 Apr 26 2000 12:10:45 system.xml 2 -rw- 10184320 Jun 29 2010 14:14:25 s5120si-cmw520-r1101p10.bin 3 drw- - Apr 26 2000 12:00:02 logfile 97920 KB total (67158 KB free)安装固件配置新固件为第一启动项新版固件<H3C>boot-loader file flash:/S6805-CMW710-R6715P01.ipe all main 旧版固件<H3C>boot-loader file flash:/s5120si_e-cmw520-r1519p06.bin main This command will set the boot file. Continue? [Y/N]:y The specified file will be used as the main boot file at the next reboot on slot 1! <H3C>reboot Start to check configuration with next startup configuration file, please wait.........DONE! This command will reboot the device. Current configuration may be lost in next startup if you continue. Continue? [Y/N]:y Reboot device by command. System is rebooting now.自动安装固件,全程等待,直至自动进入系统Starting...... ************************************************************************ * * * H3C S5120-28P-SI BOOTROM, Version 119 * * * ************************************************************************ Creation Date : Feb 3 2010 CPU L1 Cache : 32KB CPU Clock Speed : 333MHz Memory Size : 128MB Flash Size : 128MB CPLD Version : 002 PCB Version : Ver.B Mac Address : C4CAD99DD5A6 Press Ctrl-B to enter Extended Boot menu...0 Starting to get the main application file--flash:/s5120si_e-cmw520-r1519p06.bin!.................................... .............................................................................. The main application file is self-decompressing................................ ............................................................................... ............................................................................... ............Done! Extend BootWare Version is not equal,updating? (Y/N): Updating extended BootRom...Done! Basic BootWare Version is not equal,updating? (Y/N): Updating Basic BootRom...Done! BootWare updated,System is rebooting now. Starting...... Press Ctrl+D to access BASIC BOOT MENU Press Ctrl+T to start memory test ******************************************************************************** * * * H3C S5120-28P-SI BOOTROM, Version 180 * * * ******************************************************************************** Copyright (c) 2004-2017 New H3C Technologies Co., Ltd. Creation Date : Aug 9 2017 CPU L1 Cache : 32KB CPU Clock Speed : 333MHz Memory Size : 128MB Flash Size : 128MB CPLD Version : 002 PCB Version : Ver.B Mac Address : C4CAD99DD5A6 the normal and back basic is not equal, update back basic.... the normal and back extend is not equal, update back extend.... Press Ctrl-B to enter Extended Boot menu...0 Starting to get the main application file--flash:/s5120si_e-cmw520-r1519p06.bin! ................................................................................ .................................. The main application file is self-decompressing................................. ................................................................................ ................................................................................ .........Done! System is starting... Startup configuration file does not exist. It will take a long time to get configuration file, please wait... Press CTRL_C to break Retrieving configuration file failed! User interface aux0 is available. Press ENTER to get started. <H3C> 删除多余固件<H3C>del s5120si-cmw520-r1101p10.bin Delete flash:/s5120si-cmw520-r1101p10.bin?[Y/N]:y %Delete file flash:/s5120si-cmw520-r1101p10.bin...Done. <H3C>dir Directory of flash:/ 0 -rw- 1617 Apr 26 2000 12:01:22 startup.cfg 1 -rw- 341 Apr 26 2000 12:10:45 systembak.xml 2 -rw- 7655 Apr 26 2000 12:01:20 config.cwmp 3 -rw- 14877696 Apr 26 2000 12:19:55 s5120si_e-cmw520-r1519p06.bin 4 drw- - Apr 26 2000 12:00:02 logfile 97920 KB total (67142 KB free)清空回收站reset recycle-bin五、升级完成 如果升级完成后交换机仍有问题,那就扔了吧
2024年08月24日
401 阅读
0 评论
0 点赞
2024-08-21
H3C华三交换机学习笔记
软件名称:HCL_Setup_V5.9.0发布日期:2023/7/13 9:29:22{anote icon="" href="https://www.h3c.com/cn/Service/Document_Software/Software_Download/Other_Product/H3C_Cloud_Lab/Catalog/HCL/" type="secondary" content="下载地址"/} 模拟器bug注意!注意!不要调整模拟器内设备的内存,极易造成设备出bug,比如路由器内存调小后,自己ping自己都不通!https://zhiliao.h3c.com/questions/dispcont/8085“配置没问题,端口也up了,也ping不通自己,是因为hcl路由器或交换机的内存不能人为的调小于520M,调成350M就容易出问题”{dotted startColor="#ff6c6c" endColor="#1989fa"/}基础命令:进入系统视图<H3C>system-view 路由追踪[H3C]tracert 更改主机名[H3C]hostname Switch1 显示详细路由追踪信息 [H3C]ip ttl-expires enable [H3C]ip unreachables enable 保存[H3C]save 重启<H3C>reboot 查看接口信息[H3C]display interface brief 查看详细配置文件[H3c]display current-cohnfiguration 查看OSPF信息[SwitchA]display ospf peer verbose 查看SN序列号display device manuinfo display counters inbound interface display counters outbound interface 查询所有接口包速率 开启NTP时间同步,同步需要几分钟 [H3C]dis clock 04:06:38.180 UTC Sat 01/05/2013 [H3C]sntp enable [H3C]sntp unicast-server 172.16.21.246 [H3C]display sntp sessions SNTP server Stratum Version Last receive time 11.22.33.44 4 4 Sat, Jan 5 2013 4:07:40.856 查看交换机时间 [H3C]dis clock 08:11:36.223 UTC Mon 04/25/2022 关闭LLDP PVID检查 lldp ignore-pvid-inconsistency 打开LLDP PVID检查 undo lldp ignore-pvid-inconsistency 通过IP和MAC地址查找所在交换机1、查看本机IP和MAC地址以太网适配器 以太网: 描述. . . . . . . . . . . . . . . : Realtek PCIe GbE Family Controller 物理地址. . . . . . . . . . . . . : XX-XX-XX-XX-XX-XX IPv4 地址 . . . . . . . . . . . . : 172.XX.X.XXX(首选)2、登录VLAN网关,查看IP和MAC地址查看IP MAC对应关系dis arp | include 172.XX.X.XXX 172.XX.X.XXX xxxx-xxxx-xxxx 18 BAGG1 852 D查看MAC所在接口dis mac-addr | include xxxx-xxxx-xxxx xxxx-xxxx-xxxx 18 Learned BAGG1 Y3、查看接口下联交换机IP查看接口与端口绑定关系dis cu查看接口下lldp信息dis lldp n v4、依次登录下层交换机,最终确定接口所在交换机dis mac-addr | include xxxx-xxxx-xxxx xxxx-xxxx-xxxx 18 Learned GE1/0/43 Y 查看接口STP报文数量,其中G1/0/5口异常 <H3C>display stp tc -------------- STP slot 1 TC or TCN count ------------- MST ID Port Receive Send 0 Bridge-Aggregation1 1 34537 0 Bridge-Aggregation2 109 9708 0 GigabitEthernet1/0/1 10 458 0 GigabitEthernet1/0/2 29 1580 0 GigabitEthernet1/0/3 0 18213 0 GigabitEthernet1/0/4 0 18243 0 GigabitEthernet1/0/5 1496 8417 0 GigabitEthernet1/0/6 0 18225 0 GigabitEthernet1/0/7 423 17148 0 GigabitEthernet1/0/8 3 3856 0 GigabitEthernet1/0/9 36 18298 0 GigabitEthernet1/0/10 0 18277 0 GigabitEthernet1/0/17 185 34206 0 GigabitEthernet1/0/18 0 34535 0 GigabitEthernet1/0/20 0 206 0 GigabitEthernet1/0/21 0 34535 0 GigabitEthernet1/0/23 0 34536 0 GigabitEthernet1/0/24 0 3306 查看交换机日志 <H3C>dis logbuffer 查看邻居信息 <H3C>dis lldp neighbor-information list Chassis ID : * -- -- Nearest nontpmr bridge neighbor # -- -- Nearest customer bridge neighbor Default -- -- Nearest bridge neighbor System Name Local Interface Chassis ID Port ID XX GE1/0/1 70c6-ddb5-905e 70c6-ddb5-9087 XX GE1/0/2 6ce5-f71b-0754 GigabitEthernet1/0/28 XX GE1/0/3 9ce8-955a-b540 GigabitEthernet1/0/28 XX GE1/0/4 1cab-3479-2220 1cab-3479-2220 XX GE1/0/5 6ce5-f71b-904c GigabitEthernet1/0/28 H3C GE1/0/6 3c8c-4010-1f3e GigabitEthernet1/0/26 查看邻居详细信息 <S-151-04>dis lldp neighbor-information verbose LLDP neighbor-information of port 1[GigabitEthernet1/0/1]: LLDP agent nearest-bridge: LLDP neighbor index : 1 Update time : 46 days, 6 hours, 59 minutes, 31 seconds Chassis type : MAC address Chassis ID : 70c6-ddb5-905e Port ID type : MAC address Port ID : 70c6-ddb5-9087 Time to live : 121 Port description : GigabitEthernet1/0/28 Interface System name : S-178-01 System description : H3C Comware Platform Software, Software Version 7.1.070, Release 6328P03 H3C S5130S-28P-HPWR-EI Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. Al l rights reserved. System capabilities supported : Bridge, Router, Customer Bridge, Service Bridge System capabilities enabled : Bridge, Router, Customer Bridge Management address type : IPv4 Management address : 169.254.144.94 Management address interface type : IfIndex Management address interface ID : 635 Management address OID : 0 dis process cpu 查看进程对于CPU的使用率。 dis process memory 查看进程对于内存使用率 dis cpu-usage 查看CPU使用率。 dis memory 查询内存使用率。 display fan 查看风扇 display power 查看电源 dis device 查看板卡状态 display logbuffer 查看设备日志 display environment 查看温度 dis counter rate inbound interface 查看接口进方向的使用率 dis counter rate outbound interface 查看接口出方向的使用率 dis int | inc rate 查看接口历史使用率 dis int | inc sec 查看接口历史使用率及出入方向的字节 dis int gi 1/0/1 查看接口最近300秒使用率 子接口配置,一个VLAN配置多个IP interface Vlan-interface X ip address 172.16.1.1 255.255.252.0 ip address 172.16.2.1 255.255.252.0 sub ip address 172.16.3.1 255.255.252.0 sub 包转发利用率 1.查看接口进方向的使用率:dis counter rate inbound interface 2.查看接口出方向的使用率:dis counter rate outbound interface 3.查看接口历史使用率:dis int | inc rate 4.查看接口历史使用率及出入方向的字节:dis int | inc sec 5、查看接口最近300秒使用率:dis int gi 1/0/1 修改风扇旋转反向 fan prefer-direction slot 1 port-to-power 查看风扇状态 dis fan 查看MAC地址震荡、环路排查 dis mac-address mac-move 典型环路状态 dis mac-address mac-move MAC address VLAN Current port Source port Last time Times f6f6-0002-17d7 19 GE1/0/5 GE1/0/2 2024-01-02 17:00:33 922161 f6f6-0004-1d53 19 GE1/0/7 GE1/0/3 2024-01-02 17:00:39 941803 f6f6-0002-17d7 19 GE1/0/2 GE1/0/5 2024-01-02 17:00:34 922342 f6f6-0004-1d53 19 GE1/0/3 GE1/0/7 2024-01-02 17:00:38 941803 查看STP接口状态 dis stp brief 配置STP边缘节点,只适用于三层接口,稳定STP网络 interface GigabitEthernet1/0/5 port access vlan 19 stp edged-port 配置STP主根桥,减少网STP收敛络震荡 stp instance 0 root primary 配置端口速率 interface GigabitEthernet1/0/13 port access vlan 21 speed 100 清除配置,恢复出厂 <H3C>reset saved-configuration The saved configuration file will be erased. Are you sure? [Y/N]:y #选择Y确认 <H3C>reboot Start to check configuration with next startup configuration file, please wait.........DONE! Current configuration may be lost after the reboot, save current configuration? [Y/N]:n #N选择不保存 This command will reboot the device. Continue? [Y/N]:y #Y确认重启 关闭日志 关闭终端上下线日志分为以下几种情况 (1)通过console的方式登录时 info-center source STAMGR console deny info-center source WLANAUD console deny (2)通过telnet的方式登录时 info-center source STAMGR monitor deny info-center source WLANAUD monitor deny 以上两种情况互不影响。这两种方式只是在总控制台不显示用户上下线的日志信息,但设备的logbuffer里还是记录的,如果想要在logbuffer也不记录日志,需采取以下两种命令关闭: info-center source STAMGR logbuffer deny info-center source WLANAUD logbuffer deny 如关闭DHCP日志 info-center source DHCPS logbuffer deny 配置日志服务器 info-center loghost 172.16.21.111 POE功率、功耗查询 <SW>dis poe pse PSE ID : 4 Slot No. : 1 SSlot No. : 0 PSE Model : LSPPSE24B PSE Status : Enabled PSE Fast Power Supply : Disabled Power Priority : Low Current Power : 36.2 W Average Power : 35.9 W Peak Power : 44.5 W Max Power : 370.0 W Max Allocable Power : 370.0 W Remaining Guaranteed Power : 370.0 W PSE CPLD Version : - PSE Software Version : 510 PSE Hardware Version : 57855 PSE Legacy PD Detection : Disabled Power Utilization Threshold : 80 PD Power Policy : Disabled PD Disconnect-Detection Mode : AC PD High Inrush : Disabled <SW>dis poe interface Interface PoE Priority CurPower Oper IEEE Detection (W) Class Status GE1/0/1 Enabled Low 2.2 On 0 Delivering Power GE1/0/2 Enabled Low 0.0 Off 0 Searching GE1/0/3 Enabled Low 2.9 On 0 Delivering Power GE1/0/4 Enabled Low 0.0 Off 0 Searching GE1/0/5 Enabled Low 2.6 On 0 Delivering Power GE1/0/6 Enabled Low 2.5 On 0 Delivering Power GE1/0/7 Enabled Low 2.3 On 0 Delivering Power GE1/0/8 Enabled Low 2.7 On 0 Delivering Power GE1/0/9 Enabled Low 2.5 On 0 Delivering Power GE1/0/10 Enabled Low 2.6 On 0 Delivering Power GE1/0/11 Enabled Low 2.6 On 0 Delivering Power GE1/0/12 Enabled Low 2.4 On 0 Delivering Power GE1/0/13 Enabled Low 2.5 On 0 Delivering Power GE1/0/14 Enabled Low 2.6 On 0 Delivering Power GE1/0/15 Enabled Low 2.8 On 0 Delivering Power GE1/0/16 Enabled Low 0.0 Off 0 Searching GE1/0/17 Enabled Low 2.4 On 0 Delivering Power GE1/0/18 Enabled Low 0.0 Off 0 Searching GE1/0/19 Enabled Low 0.0 Off 0 Searching GE1/0/20 Enabled Low 0.0 Off 0 Searching GE1/0/21 Enabled Low 0.0 Off 0 Searching GE1/0/22 Enabled Low 0.0 Off 0 Searching GE1/0/23 Enabled Low 0.0 Off 0 Searching GE1/0/24 Enabled Low 0.0 Off 0 Searching --- On State Ports: 14; Used: 35.6(W); Remaining: 334.4(W) --- {dotted startColor="#ff6c6c" endColor="#1989fa"/}环路检测排查 查看CPU使用率dis cpu查看MAC漂移dis mac-address mac-move查看STP接口状态dis stp brief查看lldp状态dis lldp neighbor-information list dis lldp neighbor-information verbose环路检测配置 https://www.h3c.com/cn/d_202308/1905729_30005_0.htm#_Ref470192304loopback-detection global enable vlan { vlan-id-list | all } 全局开启环路检测 interface interface-type interface-number 进入二层以太网接口/二层聚合接口视图 loopback-detection enable vlan { vlan-id-list | all } 在端口上开启环路检测功能 loopback-detection global action shutdown 全局配置环路检测的处理模式 interface interface-type interface-number 进入接口视图 loopback-detection action { block | no-learning | shutdown } 在端口上配置环路检测的处理模式 loopback-detection interval-time interval 配置检测间隔时间 display loopback-detection 显示环路检测的配置和运行情况查询AP上线离线掉线时间 网络-操作-无线配置-AP管理-详情基础配置-上线/离线/版本下载时间2023-07-15 13:23:29二层端口模式 参考链接:https://blog.51cto.com/shyln/2087240 a)access端口 发送(从交换机内部往外发送): 带有vlan tag:删除tag后,发送 不带vlan tag:不可能出现 接收: 带有vlan tag:若该tag等于该access端口的pvid,则可以接收,进入交换机内部 不带vlan tag:添加该access端口的pvid,进入交换机内部 b)trunk端口(允许发送native VLAN数据的时候,可以不加tag) 发送(从交换机内部往外发送): 带有vlan tag:若tag等于该trunk端口的pvid,则删除tag后发送;否则保留tag直接发送 不带vlan tag:不可能出现 接收: 带有vlan tag:保留该tag,进入交换机内部 不带vlan tag:添加该trunk端口的pvid,进入交换机内部 c)hybrid端口(允许发送多个VLAN数据的时候,可以不加tag) 发送(从交换机内部往外发送): 带有vlan tag: 是否带tag进行发送,取决于用户配置(用户可以配置tagged list,untagged list) 不带vlan tag:不可能出现 接收: 带有vlan tag:保留该tag,进入交换机内部 不带vlan tag:添加该hybrid端口的pvid,进入交换机内部{dotted startColor="#ff6c6c" endColor="#1989fa"/}模拟傻瓜交换机 思路,创建全部vlan,端口启用untag。vlan 2 to 4000 #批量创建vlan interface GigabitEthernet1/0/1 #进入接口 port link-type hybrid #接口类型hybrid port hybrid vlan 1 to 4000 untagged #撕掉vlan标签{dotted startColor="#ff6c6c" endColor="#1989fa"/}配置telnet参考链接https://jingyan.baidu.com/article/1876c852517425890b1376d2.html给VLAN1配置IP[H3C-Vlan-interface1]ip address 192.168.56.254 255.255.255.0 [H3C-Vlan-interface1]quit配置VTY(Virtual Teletype Terminal)虚拟终端接口的认证方式 [H3C]user-interface vty 0 4 [H3C-line-vty0-4]authentication-mode scheme //进行本地或远端用户名和口令认证。即AAA认证 //关于认证,一共有三种认证方式 //password 本地口令认证; //scheme 本地或远端用户名和口令认证; //none 不认证; [H3C-line-vty0-4]quit 本地用户的创建与配置 [H3C]local-user admin //设置创建本地认证的用户名 [H3C-luser-manage-admin]password simple 123456 //设置明文密码,使用命令查看当前配置时 //密码会以哈希加密后显示 图3 [H3C-luser-manage-admin]authorization-attribute user-role level-15 #开启最高权限或authorization-attribute user-role network-admin [H3C-luser-manage-admin]service-type telnet //用户作用于telnet服务 [H3C-luser-manage-admin]quit [H3C]telnet server enable //开启telnet 服务 [H3C]save //保存配置 {dotted startColor="#ff6c6c" endColor="#1989fa"/}静态路由[R1]int g0/0 #进入接口或者vlan [R1-GigabitEthernet0/0]ip add 192.168.1.1 24 #设置接口IP [R1]ip route-static 192.168.2.0 24 192.168.1.2 #为目标网段设置网关{dotted startColor="#ff6c6c" endColor="#1989fa"/}普通DHCP配置路由1<H3C>sys #系统视图 [H3C]int g0/0 #进入接口 [H3C-GigabitEthernet0/0]ip add 192.168.1.1 24 #配置IP [H3C-GigabitEthernet0/1]int g0/1 [H3C-GigabitEthernet0/1]ip add 192.168.2.1 24路由2<H3C>sys [H3C]int g0/0 [H3C-GigabitEthernet0/0]ip add 192.168.2.2 24路由1[route1]dhcp server ip-pool 1 #设置DHCP地址池 [route1-dhcp-pool-1]network 192.168.0.1 mask 255.255.255.0 #地址范围为192.168.0.0/24网段的ip地址 [route1-dhcp-pool-1]gateway-list 192.168.0.1 #网关地址为192.168.0.1 [route1-dhcp-pool-1]dns-list 192.168.0.1 #DNS服务器地址也为192.168.0.1 注意:这里设置的是一个网段的范围,在这个地址范围里可能这里面的某些地址不能够被分配出去。比如说网关的地址和一些指定的设备的ip地址。 [route1]dhcp server forbidden-ip 192.168.0.1 192.168.0.2 #不允许网关地址和DNS地址192.168.0.1分配被出去 [route1]dhcp enable #启动DHCP服务{dotted startColor="#ff6c6c" endColor="#1989fa"/}ospf配置:参考:https://blog.51cto.com/14219797/2402420配置接口IP:SwitchB<H3C>sys #进入系统视图 [H3C]hostname SwitchB #主机名重命名 [SwitchB]vlan 200 进入vlan200 [SwitchB-vlan100]port g 1/0/1 #指定vlan200端口 [SwitchB-vlan100]quit [SwitchB]vlan 300 进入vlan300 [SwitchB-vlan200]port g 1/0/2 #指定vlan300端口 [SwitchB-vlan200]quit [SwitchB]inter vlan 200 #进入vlan200 [SwitchB-Vlan-interface100]ip add 10.1.1.2 24 #设定IP [SwitchB-Vlan-interface100]quit [SwitchB]inter vlan 300 #进入vlan300 [SwitchB-Vlan-interface200]ip add 10.2.1.1 24 #设定IP [SwitchB-Vlan-interface200]quit配置OSPF协议:<SwitchB> system-view #进入系统视图 [SwitchB] router id 10.2.1.1 #设定唯一标识 [SwitchB] ospf #进入ospf设置 [SwitchB-ospf-1] area 0 #配置区域0 [SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 #通告网络,子网掩码为反码 [SwitchB-ospf-1-area-0.0.0.0] quit [SwitchB-ospf-1] area 2 #配置区域 [SwitchB-ospf-1-area-0.0.0.2] network 10.2.1.0 0.0.0.255 #通告网络 [SwitchB-ospf-1-area-0.0.0.2] quit [SwitchB-ospf-1] quitSwitchA 的 OSPF 邻居:[SwitchA]display ospf peer verbose OSPF Process 1 with Router ID 10.1.1.1 Neighbors Area 0.0.0.0 interface 10.1.1.1(Vlan-interface200)'s neighbors Router ID: 10.2.1.1 Address: 10.1.1.2 GR state: Normal State: Full Mode: Nbr is master Priority: 1 DR: 10.1.1.2 BDR: 10.1.1.1 MTU: 0 Options is 0x42 (-|O|-|-|-|-|E|-) Dead timer due in 31 sec Neighbor is up for 00:37:39 Authentication sequence: [ 0 ] Neighbor state change count: 6 BFD status: Disabled Area 0.0.0.1 interface 10.3.1.1(Vlan-interface100)'s neighbors Router ID: 10.3.1.2 Address: 10.3.1.2 GR state: Normal State: Full Mode: Nbr is master Priority: 1 DR: 10.3.1.1 BDR: 10.3.1.2 MTU: 0 Options is 0x42 (-|O|-|-|-|-|E|-) Dead timer due in 39 sec Neighbor is up for 00:36:50 Authentication sequence: [ 0 ] Neighbor state change count: 5 BFD status: DisabledSwitchA 的 OSPF 路由信息:[SwitchA]display ospf routing OSPF Process 1 with Router ID 10.1.1.1 Routing Table Topology base (MTID 0) Routing for network Destination Cost Type NextHop AdvRouter Area 10.2.1.0/24 2 Inter 10.1.1.2 10.2.1.1 0.0.0.0 10.3.1.0/24 1 Transit 0.0.0.0 10.1.1.1 0.0.0.1 10.1.1.0/24 1 Transit 0.0.0.0 10.2.1.1 0.0.0.0 Total nets: 3 Intra area: 2 Inter area: 1 ASE: 0 NSSA: 0SwitchC到SwitchD进行测试连通性:[SwitchC]ping 10.2.1.2 Ping 10.2.1.2 (10.2.1.2): 56 data bytes, press CTRL_C to break 56 bytes from 10.2.1.2: icmp_seq=0 ttl=253 time=1.651 ms 56 bytes from 10.2.1.2: icmp_seq=1 ttl=253 time=1.567 ms 56 bytes from 10.2.1.2: icmp_seq=2 ttl=253 time=1.465 ms 56 bytes from 10.2.1.2: icmp_seq=3 ttl=253 time=1.431 ms 56 bytes from 10.2.1.2: icmp_seq=4 ttl=253 time=2.635 msSwitchC到SwitchD进行路由追踪:[SwitchC]tracert 10.2.1.2 traceroute to 10.2.1.2 (10.2.1.2), 30 hops at most, 40 bytes each packet, press CTRL_C to break 1 10.3.1.1 (10.3.1.1) 1.438 ms 0.424 ms 0.418 ms 2 10.1.1.2 (10.1.1.2) 1.481 ms 1.221 ms 0.695 ms 3 10.2.1.2 (10.2.1.2) 1.073 ms 1.087 ms 0.923 ms{dotted startColor="#ff6c6c" endColor="#1989fa"/}VLAN隔离:参考链接:https://blog.51cto.com/14220513/2367688http://www.023wg.com/vlan/132.htmlhttp://www.h3c.com/cn/d_200809/615974_30005_0.htm配置SwitchA:<SwitchA> system-view #系统视图 [SwitchA] vlan 100 [SwitchA-vlan100] port ge1/0/2 #添加端口 [SwitchA-vlan100] quit [SwitchA] vlan 200 [SwitchA-vlan100] port ge1/0/3 #添加端口 [SwitchA-vlan100] quit [SwitchA] interface ge1/0/1 #进入端口 [SwitchA-GigabitEthernet1/0/1] port link-type trunk #设置trunk模式 [SwitchA-GigabitEthernet1/0/1] port trunk permit vlan 100 200 #允许VLAN100 200通过输入display vlan 100 和display vlan200 查看配置:[SwtichA]display vlan 100 VLAN ID: 100 VLAN type: Static Route interface: Not configured Description: VLAN 0100 Name: VLAN 0100 Tagged ports: GigabitEthernet1/0/1 Untagged ports: GigabitEthernet1/0/2 [SwtichA]display vlan 200 VLAN ID: 200 VLAN type: Static Route interface: Not configured Description: VLAN 0200 Name: VLAN 0200 Tagged ports: GigabitEthernet1/0/1 Untagged ports: GigabitEthernet1/0/3{dotted startColor="#ff6c6c" endColor="#1989fa"/}MSTP多生成树MSTP默认开启,可手动配置最佳路径参考链接:https://www.cnblogs.com/aqicheng/p/13824682.html每个交换机创建vlan10 vlan20[H3C]vlan 10 [H3C-vlan10]vlan 20 [H3C-vlan20]int g1/0/1 [H3C-GigabitEthernet1/0/1]port link-type trunk #所有接口设置trunk模式 [H3C-GigabitEthernet1/0/1]port trunk permit vlan all #允许所有vlan通过 [H3C-GigabitEthernet1/0/1]int g 1/0/2 [H3C-GigabitEthernet1/0/2]port link-type trunk [H3C-GigabitEthernet1/0/2]port trunk permit vlan all [H3C-GigabitEthernet1/0/2]quit [H3C]hostname sw3设置区域[sw3]stp region-configuration [sw3-mst-region]region-name h3c #区域命名 [sw3-mst-region]instance 1 vlan 10 #vlan10划入1组 [sw3-mst-region]instance 2 vlan 20 #vlan20划入2组 [sw3-mst-region]active region-configuration #激活配置 [sw3-mst-region]display this #查看以上配置 # stp region-configuration region-name h3c instance 1 vlan 10 instance 2 vlan 20 active region-configuration # return调整根桥[sw1]stp instance 1 root primary #sw1设置为组1的根桥 [sw2]stp instance 2 root primary #sw2设置为组2的根桥查看结果<sw1>display stp brief MST ID Port Role STP State Protection 0 GigabitEthernet1/0/1 DESI FORWARDING NONE 0 GigabitEthernet1/0/2 DESI FORWARDING NONE 0 GigabitEthernet1/0/3 DESI FORWARDING NONE 1 GigabitEthernet1/0/1 DESI FORWARDING NONE 1 GigabitEthernet1/0/2 DESI FORWARDING NONE 1 GigabitEthernet1/0/3 DESI FORWARDING NONE 2 GigabitEthernet1/0/1 ROOT FORWARDING NONE 2 GigabitEthernet1/0/2 DESI FORWARDING NONE 2 GigabitEthernet1/0/3 DESI FORWARDING NONE [sw2]display stp brief MST ID Port Role STP State Protection 0 GigabitEthernet1/0/1 ROOT FORWARDING NONE 0 GigabitEthernet1/0/2 DESI FORWARDING NONE 1 GigabitEthernet1/0/1 ROOT FORWARDING NONE 1 GigabitEthernet1/0/2 DESI FORWARDING NONE 2 GigabitEthernet1/0/1 DESI FORWARDING NONE 2 GigabitEthernet1/0/2 DESI FORWARDING NONE{dotted startColor="#ff6c6c" endColor="#1989fa"/}VRRP虚拟路由冗余协议参考链接:https://www.cnblogs.com/hukey/p/13071447.html配置心跳线双线冗余[SW1]int Bridge-Aggregation 1 #创建接口聚合 [SW1]int g1/0/2 [SW1-GigabitEthernet1/0/2]port link-aggregation group 1 #端口加入链路聚合 [SW1-GigabitEthernet1/0/2]int g1/0/3 [SW1-GigabitEthernet1/0/3]port link-aggregation group 1 [SW1]int Bridge-Aggregation 1 [SW1-Bridge-Aggregation1]port link-type trunk #端口允许所有vlan通过 [SW1-Bridge-Aggregation1]port trunk permit vlan all [SW2]int Bridge-Aggregation 1 #创建链路聚合 [SW2]int g1/0/2 [SW2-GigabitEthernet1/0/2]port link-aggregation group 1 #端口加入链路聚合 [SW2-GigabitEthernet1/0/2]int g1/0/3 [SW2-GigabitEthernet1/0/3]port link-aggregation group 1 [SW2]int Bridge-Aggregation 1 [SW2-Bridge-Aggregation1]port link-type trunk #端口允许所有vlan通过 [SW2-Bridge-Aggregation1]port trunk permit vlan all查看绑定状态[sw1]dis int Bridge-Aggregation bri Brief information on interfaces in bridge mode: Link: ADM - administratively down; Stby - standby Speed: (a) - auto Duplex: (a)/A - auto; H - half; F - full Type: A - access; T - trunk; H - hybrid Interface Link Speed Duplex Type PVID Description BAGG1 UP 2G(a) F(a) T 1配置vlanSW3对应SW2和SW1的两个端口配置trunk,对应客户机的端口配置vlan [SW3]vlan 10 [SW3-vlan10]port g1/0/1 [SW3]int range g1/0/2 to g1/0/3 [SW3-if-range]port link-type trunk [SW3-if-range]port trunk permit vlan 10 20 [SW1]vlan 10 #创建vlan [SW1-vlan10]vlan 20 #创建vlan [SW1-vlan0]int g1/0/1 [SW1-GigabitEthernet1/0/1]port link-type trunk [SW1-GigabitEthernet1/0/1]port trunk permit vlan 10 20 [SW1-GigabitEthernet1/0/1]int vlan 10 #进入vlan10 [SW1-Vlan-interface10]ip add 10.0.10.253 24 #设置IP [SW1-Vlan-interface10]int v20 #进入vlan20 [SW1-Vlan-interface20]ip add 10.0.20.253 24 #设置IP [SW1]dis ip int bri [sw1]dis ip int bri *down: administratively down (s): spoofing (l): loopback Interface Physical Protocol IP Address Description MGE0/0/0 down down -- -- Vlan10 up up 10.0.10.253 -- Vlan20 up up 10.0.20.253 -- [SW2]vlan 10 [SW2-vlan10]vlan 20 [SW2-vlan20]int g1/0/1 [SW2-GigabitEthernet1/0/1]port link-type trunk [SW2-GigabitEthernet1/0/1]port trunk permit vlan 10 20 [SW2-GigabitEthernet1/0/1]int v10 [SW2-Vlan-interface10]ip add 10.0.10.252 24 [SW2-Vlan-interface10]int v20 [SW2-Vlan-interface20]ip add 10.0.20.252 24 [SW2]dis ip int bri *down: administratively down (s): spoofing (l): loopback Interface Physical Protocol IP Address Description MGE0/0/0 down down -- -- Vlan10 up up 10.0.10.252 -- Vlan20 up up 10.0.20.252 --配置VRRP配置vlan10的vrrp [SW1]int v10 #进入vlan10 [SW1-Vlan-interface10]vrrp vrid 10 virtual-ip 10.0.10.254 #配置虚拟地址 [SW1-Vlan-interface10]vrrp vrid 10 priority 105 # 配置vrrp权重,默认为100 如果要设置master则大于100即 [SW1]track 10 int Bridge-Aggregation 1 # 配置心跳线为聚合链路 [SW2]int v10 [SW2-Vlan-interface10]vrrp vrid 10 virtual-ip 10.0.10.254 [SW2]track 10 int Bridge-Aggregation 1 配置vlan20的vrrp [SW1]int v20 [SW1-Vlan-interface20]vrrp vrid 20 virtual-ip 10.0.20.254 [SW1]track 20 int Bridge-Aggregation 1 #配置心跳线为聚合链路 [SW2]int v20 [SW2-Vlan-interface20]vrrp vrid 20 virtual-ip 10.0.20.254 [SW2-Vlan-interface20]vrrp vrid 20 priority 105 #设置为vlan20的master [SW2]track 20 int Bridge-Aggregation 1 #配置心跳线为聚合链路 [sw1]dis vrrp IPv4 virtual router information: Running mode : Standard Total number of virtual routers : 2 Interface VRID State Running Adver Auth Virtual pri timer(cs) type IP --------------------------------------------------------------------- Vlan10 10 Master 105 100 None 10.0.10.254 Vlan20 20 Backup 100 100 None 10.0.20.254 [sw2]dis vrrp IPv4 virtual router information: Running mode : Standard Total number of virtual routers : 2 Interface VRID State Running Adver Auth Virtual pri timer(cs) type IP --------------------------------------------------------------------- Vlan10 10 Backup 100 100 None 10.0.10.254 Vlan20 20 Master 105 100 None 10.0.20.254{dotted startColor="#ff6c6c" endColor="#1989fa"/}堆叠参考链接:CSDN博主「猫先生的早茶」的原创文章https://blog.csdn.net/qq_43017750/article/details/89323450注意!1、配置前必须移除两路由间连接线2、全部配置完成后,连线,次路由会自动重启master交换机#sys #interface range Ten-GigabitEthernet 1/0/49 to Ten-GigabitEthernet 1/0/52 #批量管理端口 #shutdown #关闭端口 #quit #irf member 1 priority 32 #配置irf成员优先级,32为最高,默认是1 #irf-port 1/1 #进入irf端口1/1 #port group interface Ten-GigabitEthernet 1/0/49 #加入当前irf端口 #port group interface Ten-GigabitEthernet 1/0/50 #port group interface Ten-GigabitEthernet 1/0/51 #port group interface Ten-GigabitEthernet 1/0/52 #quit #irf-port-configuration active #激活irf配置 #interface range Ten-GigabitEthernet 1/0/49 to Ten-GigabitEthernet 1/0/52 #批量管理端口 #undo shutdown #启动端口 #save #保存standby交换机的命令#sys #irf member 1 renumber 2 #当前irf成员id重命名为2 #quit #reboot #sys #interface range Ten-GigabitEthernet 2/0/49 to Ten-GigabitEthernet 2/0/52 #批量管理端口 #shutdown #关闭端口 #quit #irf member 2 priority 1 #配置当前irf成员id2的优先级为1 #irf-port 2/2 #进入irf端口2/2 #port group interface Ten-GigabitEthernet 2/0/49 #加入当前irf #port group interface Ten-GigabitEthernet 2/0/50 #port group interface Ten-GigabitEthernet 2/0/51 #port group interface Ten-GigabitEthernet 2/0/52 #quit #irf-port-configuration active #激活irf #interface range Ten-GigabitEthernet 2/0/49 to Ten-GigabitEthernet 2/0/52 #批量管理端口 #undo shutdown #启动端口 #quit #save验证:[sw1]dis irf MemberID Role Priority CPU-Mac Description *+1 Master 32 30e7-b21f-0104 --- 2 Standby 1 30e7-bae6-0204 ---{dotted startColor="#ff6c6c" endColor="#1989fa"/}两台三层交换机快速IRF配置 member 1编号renumber 2重写编号domain 0主机名priority 18优先级,大的为主irf-port2 irf组,主为1则从为2,1接2 easy-irf member 1 domain 0 priority 24 irf-port1 FortyGigE 1/0/53 FortyGigE 1/0/54 ***************************************************************************** Configuration summary for member 1 IRF new member ID: 1 IRF domain ID : 0 IRF priority : 24 IRF-port 1 : FortyGigE1/0/53, FortyGigE1/0/54 IRF-port 2 : Disabled ***************************************************************************** easy-irf member 1 renumber 2 domain 0 priority 18 irf-port2 FortyGigE 1/0/53 FortyGigE 1/0/54 ***************************************************************************** Configuration summary for member 1 IRF new member ID: 2 IRF domain ID : 0 IRF priority : 18 IRF-port 1 : Disabled IRF-port 2 : FortyGigE1/0/53, FortyGigE1/0/54 ***************************************************************************** IRF保留接口(上行三层互联口) IRF分裂后,保持三层接口通讯mad exclude interface Ten-GigabitEthernet 2/0/50删除IRF 删除irf-port接口un irf-port xx重置编号irf member 2 renumber 1OSPF配置 在接口使能ospfint xx ospf 1 area 0接口配置为p2p模式ospf network-type p2p在vlan使能ospfint vlan xx ospf 1 area 1在loopback 0使能ospfint loopback 0 ospf 1 area 0堆叠心跳检测BFD MAD 新建用于irf检测的vlanvlan 4094 description irf-mad qu创建VPN实例,用于隔离路由路由表ip vpn-instance mgmt route-distinguisher 1:1 qu配置虚接口,配置心跳检测IP,绑定VPN实例int vlan4094 description irf-mad ip binding vpn-instance mgmt mad bfd enable mad ip address 1.0.0.1 255.255.255.252 member 1 mad ip address 1.0.0.2 255.255.255.252 member 2 qu心跳接口配置interface GigabitEthernet 1/0/48 description irf-mad port access vlan 4094 undo stp enable interface GigabitEthernet 2/0/48 description irf-mad port access vlan 4094 undo stp enableOSPF优化 配置OSPF IDint LoopBack 0 ip add 10.100.0.1 32 qu配置指定接口收发OSPF报文ospf 1 silent-interface all #关闭全部接口的OSPF报文收发 undo silent-interface Ten-GigabitEthernet 1/0/49{lamp/}链路聚合原文链接:https://blog.csdn.net/VictoryKingLIU/article/details/79560157二层端口静态聚合模式<H3C>system-view [H3C]int Bridge-Aggregation 1 [H3C-Bridge-Aggregation1]quit [H3C]int GigabitEthernet 1/0/1 [H3C-GigabitEthernet1/0/1]port link-aggregation group 1 [H3C-GigabitEthernet1/0/1]int GigabitEthernet 1/0/2 [H3C-GigabitEthernet1/0/2]port link-aggregation group 1 [H3C-GigabitEthernet1/0/2]int GigabitEthernet 1/0/3 [H3C-GigabitEthernet1/0/3]port link-aggregation group 1 [H3C]dis link-aggregation verbose二层端口动态聚合模式<H3C>system-view [H3C]int Bridge-Aggregation 1 [H3C-Bridge-Aggregation1]link-aggregation mode dynamic [H3C-Bridge-Aggregation1]quit [H3C]int GigabitEthernet 1/0/1 [H3C-GigabitEthernet1/0/1]port link-aggregation group 1 [H3C-GigabitEthernet1/0/1]int GigabitEthernet 1/0/2 [H3C-GigabitEthernet1/0/2]port link-aggregation group 1 [H3C-GigabitEthernet1/0/2]int GigabitEthernet 1/0/3 [H3C-GigabitEthernet1/0/3]port link-aggregation group 1 [H3C]dis link-aggregation verbose三层端口静态聚合创建端口三层聚合口 [SW1]interface Route-Aggregation 1 分别把GE1/0/11,GE1/0/12加入到聚合组1 [SW1]interface GigabitEthernet 1/0/11 [SW1-GigabitEthernet1/0/11]port link-mode route [SW1-GigabitEthernet1/0/11]port link-aggregation group 1 [SW1]interface GigabitEthernet 1/0/12 [SW1-GigabitEthernet1/0/12]port link-mode route [SW1-GigabitEthernet1/0/12]port link-aggregation group 1{dotted startColor="#ff6c6c" endColor="#1989fa"/}pvid 不同VLAN间通讯SW1: interface GigabitEthernet1/0/1 port link-mode bridge port access vlan 100 combo enable fiber # interface GigabitEthernet1/0/2 port link-mode bridge port link-type trunk port trunk permit vlan 1 100 port trunk pvid vlan 100 combo enable fiber # SW2: interface GigabitEthernet1/0/1 port link-mode bridge port access vlan 200 combo enable fiber # interface GigabitEthernet1/0/2 port link-mode bridge port link-type trunk port trunk permit vlan 1 200 port trunk pvid vlan 200 combo enable fiber # {dotted startColor="#ff6c6c" endColor="#1989fa"/}ACL控制规则[H3C]acl basic 2000 #创建基础规则 [H3C-acl-ipv4-basic-2000]rule deny source 192.168.1.2 0 #编写规则内容,阻止来自192.168.1.2的包 [H3C-acl-ipv4-basic-2000]int g1/0/1 #进入接口 [H3C-GigabitEthernet1/0/1]packet-filter 2000 inbound #应用规则 inbound入站 outbound出站在本案例中,若要禁止192.168.1.1访问2,需要在G1/0/1应用 outbound出站规则,这样数据包在抵达2并返回到接口时会被阻止;要禁止全体访问2,则需要在G1/0/2应用inbound入站规则,这样数据包从2出发并经过接口时会被阻止。端口控制若要阻止vlan1所有telnet访问,则可以在vlan1中设置出站规则[H3C]acl advanced 3001 [H3C-acl-ipv4-adv-3001]rule 1 deny tcp source-port eq 23 [H3C-acl-ipv4-adv-3001]int vlan1 [H3C-Vlan-interface1]packet-filter 3001 outbound若仅要阻止1.5或网段的telnet访问,则可以设置入站规则[H3C-acl-ipv4-adv-3002]rule 1 deny tcp source 192.168.1.5 0 destination-port eq 23 [H3C-Vlan-interface1]packet-filter 3002 inbound{dotted startColor="#ff6c6c" endColor="#1989fa"/}端口隔离参考连接:https://blog.csdn.net/weixin_34110749/article/details/92738677(特别注明:模拟器中端口隔离功能不起作用)[H3C]port-isolate group 2 [H3C]int g1/0/1 [H3C-GigabitEthernet1/0/1]port-isolate enable group 2 [H3C-GigabitEthernet1/0/1]int g1/0/2 [H3C-GigabitEthernet1/0/2]port-isolate enable group 2 [H3C-GigabitEthernet1/0/2]quit [H3C]dis port-isolate group 2 Port isolation group information: Group ID: 2 Group members: GigabitEthernet1/0/1 GigabitEthernet1/0/2{dotted startColor="#ff6c6c" endColor="#1989fa"/}IRF堆叠LACP-MAD检测参考链接:https://blog.csdn.net/qq_45662411/article/details/105983636开启前,堆叠线断开后两设备都成为master在线,影响网络运行;开启后,LACP-MAD协议会控制在线的成员关闭端口,只保留一个master,防止网络冲突。IRF设备配置: [master]int Bridge-Aggregation 2 #创建一个名为2的聚合端口组 [master-Bridge-Aggregation2]link-aggregation mode dynamic #将此端口组的模式改为动态 [master-Bridge-Aggregation2]mad enable #开启mad检测 [master-Bridge-Aggregation2]quit #退出接口视图 [master]int range g1/0/1 g2/0/1 #同时进入这两个接口 [master-if-range]port link-aggregation group 2 #将他们加入到这个接口组2中 下层配置: [H3C]int Bridge-Aggregation 2 #创建一个名为2的聚合端口组 [H3C-Bridge-Aggregation2]link-aggregation mode dynamic #将此端口组的模式改为动态 [H3C-Bridge-Aggregation2]quit #退出接口视图 [H3C]int range g1/0/1 g1/0/2 #进入到这两个接口 [H3C-if-range]port link-aggregation group 2 #将这两个端口组加入到接口组2中{dotted startColor="#ff6c6c" endColor="#1989fa"/}AP三层上线所属VLAN配置DHCP Option43option43格式简要说明: 80 07 00 00 01 02 02 02 02 80:固定值,不用改变; 07:长度字段,其后面所跟数据的字节长度; 00 00:固定值,不用改变; 01:表示后面的IP地址的个数,此处为一个IP地址; 02 02 02 02:IP地址转换工具https://tool.520101.com/wangluo/jinzhizhuanhuan/dhcp server ip-pool vlan5 gateway-list 192.168.1.1 network 192.168.1.0 mask 255.255.255.0 dns-list 114.114.114.114 option 43 hex 800700000103030302本地转发性能更高更灵活,通过AC管理。AP接口如果是access,则ap和客户端在同一个VLAN。AP接口如果是trunk,则可以分别配置VLAN。{dotted startColor="#ff6c6c" endColor="#1989fa"/}UEFI PXE网络启动dhcp server ip-pool test gateway-list 192.168.1.254 network 192.168.1.0 mask 255.255.255.0 bootfile-name \\Boot\\x64\\wdsmgfw.efi #传统引导为\\Boot\\x64\\wdsnbp.com dns-list 114.114.114.114 next-server 192.168.100.100 #WDS服务器学习实验 acl策略PVID路由口端口汇聚堆叠、汇聚、ospf静态路五机堆叠三机堆叠
2024年08月21日
1,836 阅读
0 评论
5 点赞
2024-08-16
中型企业网络思路规划配置分享,H3C HCL模拟器,easy-irf堆叠 OSPF优化
整体规划 本架构是在小型企业网络思路上进行增强https://90apt.com/2449功能实现 1、easy-irf快速堆叠,配置心跳检测2、OSPF分区域、双线配置双路由、配置p2p模式、限制收发OSPF报文端口模拟器实验 线缆全部链接完成IP规划网段划分 loopback 0 网络核心 10.100.0.1 监控核心 10.100.0.2 网络汇聚 10.100.0.3 监控汇聚 10.100.0.4 网络核心1/0/49to监控核心1/0/49 10.100.1.1/30 10.100.1.2/30 网络核心2/0/49to监控核心1/0/50 10.100.1.5/30 10.100.1.6/30 网络核心1/0/50to网络汇聚1/0/50 10.100.1.9/30 10.100.1.10/30 网络核心2/0/50to网络汇聚1/0/49 10.100.1.13/30 10.100.1.14/30 监控核心1/0/51to监控汇聚1/0/49 10.100.1.17/30 10.100.1.18/30 网络配置 网络核心 堆叠 1/0/53 to 2/0/53 1/0/54 to 2/0/54 心跳 1/0/48 to 2/0/48 模拟器限制,连接会死机,不进行连接 IP地址 网络汇聚 vlan102 10.100.102.1/24 监控汇聚 vlan103 10.100.103.1/24 网络主机 10.100.102.2/24 监控主机 10.100.103.2/24 ospf区域 网络核心 area0 10.100.1.0 0.0.0.3 10.100.1.4 0.0.0.3 10.100.1.8 0.0.0.3 10.100.1.12 0.0.0.3 监控核心 area0 10.100.1.0 0.0.0.3 10.100.1.4 0.0.0.3 10.100.1.16 0.0.0.3 网络汇聚 area0 10.100.1.8 0.0.0.3 10.100.1.12 0.0.0.3 area1 10.100.102.0 0.0.0.255 监控汇聚 area0 10.100.1.16 0.0.0.3 area1 10.100.103.0 0.0.0.255 一、进行核心堆叠 1、配置交换机名hostname wangluo hexin2、核心1配置easy-irf member 1 domain 0 priority 24 irf-port1 FortyGigE 1/0/53 FortyGigE 1/0/54a 保存配置 save3、核心2配置第二台核心编号重命名为2,优先级18,低于第一台24easy-irf member 1 renumber 2 domain 0 priority 18 irf-port2 FortyGigE 1/0/5 3 FortyGigE 1/0/54按提示,输入Y重启4、配置堆叠心跳检测BFD MAD由于模拟器限制,配置完后心跳线连接会死机,因此心跳线不连接堆叠心跳检测BFD MAD新建用于irf检测的vlan,注意,后续trunk接口要阻止此VLAN通过vlan 4094 description irf-mad qu创建VPN实例,用于隔离路由路由表ip vpn-instance mgmt route-distinguisher 1:1 qu配置虚接口,配置心跳检测IP,绑定VPN实例int vlan4094 description irf-mad ip binding vpn-instance mgmt mad bfd enable mad ip address 1.0.0.1 255.255.255.252 member 1 mad ip address 1.0.0.2 255.255.255.252 member 2 qu心跳接口配置interface GigabitEthernet 1/0/48 description irf-mad port access vlan 4094 undo stp enable interface GigabitEthernet 2/0/48 description irf-mad port access vlan 4094 undo stp enable5、IRF保留接口,一般用于上行三层接口,设备分裂后保持通讯mad exclude interface Ten-GigabitEthernet 2/0/50二、配置所有IP地址 三层交换机改名、配置loopback地址、配置IP地址、PC配置IP地址interface Ten-GigabitEthernet1/0/49 port link-mode route combo enable fiber ip address 10.100.1.1 255.255.255.252 interface LoopBack0 ip address 10.100.0.3 255.255.255.255 [wangluo huiju-GigabitEthernet1/0/1]ping 10.100.102.2 Ping 10.100.102.2 (10.100.102.2): 56 data bytes, press CTRL_C to break 56 bytes from 10.100.102.2: icmp_seq=0 ttl=255 time=6.212 ms 56 bytes from 10.100.102.2: icmp_seq=1 ttl=255 time=3.258 ms 56 bytes from 10.100.102.2: icmp_seq=2 ttl=255 time=3.670 ms 56 bytes from 10.100.102.2: icmp_seq=3 ttl=255 time=2.772 ms 56 bytes from 10.100.102.2: icmp_seq=4 ttl=255 time=4.012 ms三、配置OSPF 配置OSPF之前先配置loopback地址三层接口使能OSPF,配置为P2P模式,放在区域0[wangluo hexin-Ten-GigabitEthernet1/0/49]dis th # interface Ten-GigabitEthernet1/0/49 port link-mode route combo enable fiber ip address 10.100.1.1 255.255.255.252 ospf network-type p2p ospf 1 area 0.0.0.0loopback使能OSPF,放在区域0interface LoopBack0 ip address 10.100.0.3 255.255.255.255 ospf 1 area 0.0.0.0VLAN使能OSPF,业务网段放在区域1[wangluo huiju-Vlan-interface102]dis th # interface Vlan-interface102 ip address 10.100.102.1 255.255.255.0 ospf 1 area 0.0.0.1 #全部配置完成后,网络主机可ping通监控主机<H3C>ping 10.100.103.2 Ping 10.100.103.2 (10.100.103.2): 56 data bytes, press CTRL_C to break 56 bytes from 10.100.103.2: icmp_seq=0 ttl=251 time=18.180 ms 56 bytes from 10.100.103.2: icmp_seq=1 ttl=251 time=9.608 ms 56 bytes from 10.100.103.2: icmp_seq=2 ttl=251 time=14.053 ms 56 bytes from 10.100.103.2: icmp_seq=3 ttl=251 time=13.112 ms 56 bytes from 10.100.103.2: icmp_seq=4 ttl=251 time=12.268 ms四、OSPF优化 限制OSPF收发报文的端口[wangluo hexin-ospf-1]dis th # ospf 1 silent-interface all undo silent-interface Ten-GigabitEthernet1/0/49 undo silent-interface Ten-GigabitEthernet1/0/50 undo silent-interface Ten-GigabitEthernet2/0/49 undo silent-interface Ten-GigabitEthernet2/0/50 area 0.0.0.0五、测试 网络主机ping监控主机,在ping过程中断掉双线中的一条,会丢包一个,删除多个双线中的一条,最多会丢包4个56 bytes from 10.100.103.2: icmp_seq=519 ttl=251 time=16.112 ms 56 bytes from 10.100.103.2: icmp_seq=520 ttl=251 time=20.881 ms 56 bytes from 10.100.103.2: icmp_seq=521 ttl=251 time=15.032 ms Request time out 56 bytes from 10.100.103.2: icmp_seq=523 ttl=251 time=36.649 ms 56 bytes from 10.100.103.2: icmp_seq=524 ttl=251 time=16.727 ms 56 bytes from 10.100.103.2: icmp_seq=525 ttl=251 time=15.137 ms 56 bytes from 10.100.103.2: icmp_seq=526 ttl=251 time=17.651 ms Request time out Request time out Request time out Request time out Request time out 56 bytes from 10.100.103.2: icmp_seq=532 ttl=251 time=13.904 ms 56 bytes from 10.100.103.2: icmp_seq=533 ttl=251 time=42.994 ms 56 bytes from 10.100.103.2: icmp_seq=534 ttl=251 time=27.916 ms 56 bytes from 10.100.103.2: icmp_seq=535 ttl=251 time=14.782 ms六、实机测试 1、实际测试BFD防分裂能力 物理机配置BFD不存在死机问题,模拟器有BUG当前1为主,2为从,共连接了1/0/18 2/0/18 2/0/23,其中2/0/23配置了IRF保留接口直接拔掉两条堆叠线结果,终端BFD告警,交换机接口2/0/18停止工作,仅保留接口2/0/23保持工作%Jan 7 12:29:20:050 2021 S5560X-30F-EI_09 BFD/5/BFD_CHANGE_FSM: Sess[1.0.0.1/1.0.0.2, LD/RD:32897/32897, Interface:Vlan4094, SessType:Ctrl, LinkType:INET], Ver:1, Sta: DOWN->INIT, Diag: 0 (No Diagnostic) %Jan 7 12:29:20:055 2021 S5560X-30F-EI_09 BFD/5/BFD_CHANGE_FSM: Sess[1.0.0.1/1.0.0.2, LD/RD:32897/32897, Interface:Vlan4094, SessType:Ctrl, LinkType:INET], Ver:1, Sta: INIT->UP, Diag: 0 (No Diagnostic) %Jan 7 12:29:22:747 2021 S5560X-30F-EI_09 DEV/3/BOARD_REMOVED: Board was removed from slot 2, type is unknown.插回堆叠线,交换机2自动重启2、测试堆叠切换直接拔掉交换机1的电源线交换机2成为主交换机继续工作交换机1插电交换机1成为从交换机,交换机2保持主交换机,通讯恢复总结 爽
2024年08月16日
181 阅读
0 评论
0 点赞
2024-08-16
小型企业网络思路规划配置分享,H3C HCL模拟器
整体规划 采用三层网络结构,核心、汇聚三层互联,堆叠采用40G网络,汇聚10G,接入1G,网关下放到汇聚,交换机采用独立管理VLAN。功能实现 1、核心堆叠,汇聚堆叠,动态端口聚合2、配置DHCP服务器,配置DHCP中继,为多个VLAN提供服务3、静态路由与OSPF,配合ACL实现不同网络的访问控制4、外网NAT,专线静态路由5、接入交换机Telnet、管理IP实现6、SNMP网管服务部署7、DHCP仿冒防御8、端口隔离,防范网络风暴和ARP攻击项目文件分享 模拟器为H3C官方HCL模拟器,安装并导入即可{anote icon="" href="https://90apt.com/usr/uploads/2021/06/H3C%E7%BD%91%E7%BB%9C%E6%A8%A1%E6%8B%9F.zip" type="secondary" content="下载"/} 配置详情 1、设置固定IP,配置主机名如图片所示2、核心堆叠,采用40G口堆叠核心1<hexin1>sys System View: return to User View with Ctrl+Z. [hexin1]int range FortyGigE 1/0/53 to FortyGigE 1/0/54 [hexin1-if-range]shu [hexin1-if-range]quit [hexin1]irf member 1 priority 32 [hexin1]irf-port 1/1 [hexin1-irf-port1/1]port group interface FortyGigE 1/0/53 [hexin1-irf-port1/1]port group interface FortyGigE 1/0/54 [hexin1-irf-port1/1]quit [hexin1]irf-port-configuration active [hexin1]int range FortyGigE 1/0/53 to FortyGigE 1/0/54 [hexin1-if-range]un sh [hexin1-if-range]save核心2[hexin2]sys [hexin2]irf member 1 renumber 2 Renumbering the member ID may result in configuration change or loss. Continue?[Y/N]:y [hexin2]quit <hexin2>reboot <hexin2>sys System View: return to User View with Ctrl+Z. [hexin2]interface range FortyGigE 2/0/53 to FortyGigE 2/0/54 [hexin2-if-range]shu [hexin2-if-range]quit [hexin2]irf member 2 priority 1 [hexin2]irf-port 2/2 [hexin2-irf-port2/2]port group interface FortyGigE 2/0/53 [hexin2-irf-port2/2]port group interface FortyGigE 2/0/54 [hexin2-irf-port2/2]qui [hexin2]irf-port-configuration active [hexin2]interface range FortyGigE 2/0/53 to FortyGigE 2/0/54 [hexin2-if-range]un sh [hexin2-if-range]quit [hexin2]save连接堆叠线后,机器自动重启,此时两台交换机终端都会显示为 hexin1 3、车间汇聚堆叠,采用40G口步骤与核心相同,堆叠后两台终端都会显示为 chejianhuiju1 4、按图片为交换机配置IP和VLAN,三层采用路由模式,汇聚下联trunk,接入上联trunk,下联对应vlan车间汇聚做端口聚合[chejianhuiju1]vlan 1004 [chejianhuiju1-vlan1004]int vlan 1004 [chejianhuiju1-Vlan-interface1004]ip add 10.0.4.254 24 [chejianhuiju1-Vlan-interface1004]quit [chejianhuiju1]int Bridge-Aggregation 1 [chejianhuiju1-Bridge-Aggregation1]link-aggregation mode dynamic [chejianhuiju1-Bridge-Aggregation1]quit [chejianhuiju1]int g1/0/1 [chejianhuiju1-GigabitEthernet1/0/1]port link-aggregation group 1 [chejianhuiju1-GigabitEthernet1/0/1]int g2/0/1 [chejianhuiju1-GigabitEthernet2/0/1]port link-aggregation group 1 [chejianhuiju1-GigabitEthernet2/0/1]dis link-aggregation verbose GE1/0/1 0 32768 0 0x8000, 0000-0000-0000 {EF} GE2/0/1 0 32768 0 0x8000, 0000-0000-0000 {EF} [chejianhuiju1-GigabitEthernet2/0/1]vlan 1004 [chejianhuiju1-vlan1004]port Bridge-Aggregation 1 [chejianhuiju1]int Bridge-Aggregation 1 [chejianhuiju1-Bridge-Aggregation1]port link-type trunk [chejianhuiju1-Bridge-Aggregation1]port trunk permit vlan all [chejianhuiju1-Bridge-Aggregation1]save验证生产设备,ping 10.0.20.4 10.0.50.5 10.0.4.254 都通5、配置OSPF,实现车间、办公、生产服务器、基础服务器互通配置核心<hexin1>sys System View: return to User View with Ctrl+Z. [hexin1]ospf [hexin1-ospf-1]area 0 [hexin1-ospf-1-area-0.0.0.0]netwo [hexin1-ospf-1-area-0.0.0.0]network 10.0.70.0 0.0.0.255 [hexin1-ospf-1-area-0.0.0.0]network 10.0.40.0 0.0.0.255 [hexin1-ospf-1-area-0.0.0.0]network 10.0.60.0 0.0.0.255 [hexin1-ospf-1-area-0.0.0.0]network 10.0.30.0 0.0.0.255 [hexin1-ospf-1-area-0.0.0.0]network 10.0.50.0 0.0.0.255 [hexin1-ospf-1-area-0.0.0.0]quit配置车间汇聚<chejianhuiju1>sys System View: return to User View with Ctrl+Z. [chejianhuiju1]ospf [chejianhuiju1-ospf-1]area 0 [chejianhuiju1-ospf-1-area-0.0.0.0]network 10.0.4.0 0.0.0.255 [chejianhuiju1-ospf-1-area-0.0.0.0]network 10.0.20.0 0.0.0.255 [chejianhuiju1-ospf-1-area-0.0.0.0]network 10.0.50.0 0.0.0.255 [chejianhuiju1-ospf-1-area-0.0.0.0]quit生产设备ping核心通,其他配置类似。6、配置DHCP服务器使用三层交换机搭建DHCP服务器,ping测试[H3C]hostname dhcp [dhcp]int g1/0/1 [dhcp-GigabitEthernet1/0/1]port link-mode route [dhcp-GigabitEthernet1/0/1]ip add 10.0.0.1 24 [dhcp-GigabitEthernet1/0/1]save [dhcp-GigabitEthernet1/0/1]quit [dhcp]ip route-static 0.0.0.0 0 10.0.0.254 [dhcp]ping 10.0.0.254 Ping 10.0.0.254 (10.0.0.254): 56 data bytes, press CTRL_C to break 56 bytes from 10.0.0.254: icmp_seq=0 ttl=255 time=0.000 ms创建DHCP池[dhcp]dhcp enable dhcp server ip-pool bangong gateway-list 10.0.3.254 network 10.0.3.0 mask 255.255.255.0 address range 10.0.3.100 10.0.3.200 dns-list 8.8.8.8 expired day 3 # dhcp server ip-pool wuxian gateway-list 10.0.2.254 network 10.0.2.0 mask 255.255.255.0 address range 10.0.2.150 10.0.2.200 dns-list 114.114.114.114 expired day 3 #沿途汇聚、核心都要开启DHCP中继,二层只要有对应VLAN并trunk即可。[jichuhuiju]dhcp enable # interface Vlan-interface1002 dhcp select relay dhcp relay server-address 10.0.0.1 # interface Vlan-interface1003 dhcp select relay dhcp relay server-address 10.0.0.1 # 查看客户端IP,成功获取IP[dhcp]display dhcp server ip-in-use IP address Client identifier/ Lease expiration Type Hardware address 10.0.2.150 0038-6163-312e-3334- Jun 26 20:35:43 2021 Auto(C) 3266-2e31-3730-362d- 4745-302f-302f-31 10.0.3.100 0038-6137-362e-3466- Jun 28 20:35:31 2021 Auto(C) 3864-2e31-3230-362d- 4745-302f-302f-31 7、配置专线,仅办公和无线可以访问办公汇聚、无线汇聚、核心、专线静态路由[wuxianhuiju] ip route-static 10.1.0.0 24 10.0.60.10 [hexin1]ip route-static 10.1.0.0 24 10.0.90.18 [zhuanxianwangguan]ip route-static 10.0.2.0 24 10.0.90.15测试办公和无线都可以访问专线IP10.1.0.28、配置办公和无线能访问外网,但外网无法直接访问内网办公汇聚、无线汇聚、核心默认路由,外网网关静态路由[bangonghuiju]ip route-static 0.0.0.0 0 10.0.30.6 [wuxianhuiju]ip route-static 0.0.0.0 0 10.0.60.10 [hexin1]ip route-static 0.0.0.0 0 10.0.10.1 [waibuwangguan]ip route-static 10.0.3.0 24 10.0.10.2 [waibuwangguan]ip route-static 10.0.2.0 24 10.0.10.2配置最简单NAT访问方式Easy IP[waibuwangguan]acl basic 200 [waibuwangguan-acl-ipv4-basic-2000]rule 0 permit source 10.0.2.0 0.0.0.255 [waibuwangguan-acl-ipv4-basic-2000]acl basic 2001 [waibuwangguan-acl-ipv4-basic-2001]rule 0 permit source 10.0.3.0 0.0.0.255 [waibuwangguan-acl-ipv4-basic-2001]quit [waibuwangguan]int g0/0 [waibuwangguan-GigabitEthernet0/0]nat outbound 2001 [waibuwangguan-GigabitEthernet0/0]nat outbound 2000办公和无线ping外网1.1.1.2通,外网ping内网不通9、POE供电受模拟器限制无法实现,实际在无线接入执行 poe enable 即可10、办公人员通过telnet远程管理车间接入交换机车间汇聚创建管理vlan2000[chejianhuiju1]vlan 2000 [chejianhuiju1-vlan2000]int vlan 2000 [chejianhuiju1-Vlan-interface2000]ip add 192.168.1.254 24车间接入创建管理vlan,开启telnet服务,设置默认路由<chejianjieru>sys System View: return to User View with Ctrl+Z. [chejianjieru]vlan 2000 [chejianjieru-vlan2000]int vlan 2000 [chejianjieru-Vlan-interface2000]ip add 192.168.1.2 24 [chejianjieru-Vlan-interface2000]quit [chejianjieru]user-interface vty 0 4 [chejianjieru-line-vty0-4]authentication-mode scheme [chejianjieru-line-vty0-4]quit [chejianjieru]local-user admin New local user added. [chejianjieru-luser-manage-admin]password simple 123456 [chejianjieru-luser-manage-admin]authorization-attribute user-role level-15 [chejianjieru-luser-manage-admin]service-type telnet [chejianjieru-luser-manage-admin]quit [chejianjieru]telnet server enable [chejianjieru]save [chejianjieru]ip route-static 0.0.0.0 0 192.168.1.254核心添加静态路由[hexin1]ip route-static 192.168.1.0 24 10.0.20.4办公人员远程telnet<bangonghuiju>telnet 192.168.1.2 Trying 192.168.1.2 ... Press CTRL+K to abort Connected to 192.168.1.2 ... ****************************************************************************** * Copyright (c) 2004-2017 New H3C Technologies Co., Ltd. All rights reserved.* * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ****************************************************************************** login: admin Password: <chejianjieru>11、配置snmp网络管理协议配置向10.0.0.1发送设备信息snmp-agent snmp-agent community write private snmp-agent community read public snmp-agent sys-info version all snmp-agent target-host trap address udp-domain 10.0.0.1 params securityname public v2c12、配置监控网络,办公和无线可以访问监控服务器,不可访问摄像头,摄像头仅与监控服务器互相访问核心设置静态路由,监控汇聚设置默认路由[hexin1]ip route-static 10.0.5.0 24 10.0.80.17 [jiankonghuiju]ip route-static 0.0.0.0 0 10.0.80.16在监控汇聚上联接口配置ACL规则,只允许访问10.0.5.1发出,其他禁止,从而达到只允许监控服务器被访问的目的[jiankonghuiju]acl basic 2000 [jiankonghuiju-acl-ipv4-basic-2000]rule 0 permit source 10.0.5.1 0 [jiankonghuiju-acl-ipv4-basic-2000]rule 1 deny [jiankonghuiju-acl-ipv4-basic-2000]quit [jiankonghuiju]int Ten-GigabitEthernet1/0/49 [jiankonghuiju-Ten-GigabitEthernet1/0/49]packet-filter 2000 outbound测试办公可以ping通10.0.5.1,不能ping通10.0.5.213、配置DHCP snooping,防止仿冒攻击全局开启dhcp snooping,上联端口启用dhcp信任[bangongjieru]dhcp snooping enable [bangongjieru]interface GigabitEthernet1/0/2 [bangongjieru]dhcp snooping trust14、配置端口隔离,减少接入傻瓜交换机造成的网络风暴,防御ARP攻击[H3C]port-isolate group 2 [H3C]int g1/0/1 [H3C-GigabitEthernet1/0/1]port-isolate enable group 2 [H3C-GigabitEthernet1/0/1]int g1/0/2 [H3C-GigabitEthernet1/0/2]port-isolate enable group 2 [H3C-GigabitEthernet1/0/2]quit [H3C]dis port-isolate group 2 Port isolation group information: Group ID: 2 Group members: GigabitEthernet1/0/1 GigabitEthernet1/0/2总结 爽
2024年08月16日
573 阅读
0 评论
6 点赞
1
2
...
23