首页 文章 精选 留言 我的

精选列表

搜索[Python环境],共10000篇文章
优秀的个人博客,低调大师

S5700三层交换机 复杂网络环境设置默认路优先级实战

一、拓扑图 新加核心交换机在分中心,分别连区域中心上传路段视频,和路由器去映射内网手机发布服务器,远程手机查看视频,内网服务器必须上网。 二、问题描述 现在分中心上传区域中心视频正常,手机发布服务器不能上网,手机无法远程观看视频。 三、解决方案 查看核心交换机的静态路由器,发现默认路由指向区域分中心。核心交换机与路由器之间互联可以相互ping通,就是无法上网。 发现所有上网请求都被发往区域中心(默认路由的作用),增加一条指向路由器的默认路由,修改优先级为50,(默认60) 配置代码如下: [GLZX_hexin_s5700]ip route-static 0.0.0.0 0.0.0.0 172.16.10.1 preference 50 [GLZX_hexin_s5700]ping 218.30.67.83 (上网正常) PING 218.30.67.83: 56 data bytes, press CTRL_C to break Reply from 218.30.67.83: bytes=56 Sequence=1 ttl=120 time=49 ms Reply from 218.30.67.83: bytes=56 Sequence=2 ttl=120 time=49 ms Reply from 218.30.67.83: bytes=56 Sequence=3 ttl=120 time=49 ms Reply from 218.30.67.83: bytes=56 Sequence=4 ttl=120 time=49 ms Reply from 218.30.67.83: bytes=56 Sequence=5 ttl=120 time=48 ms --- 218.30.67.83 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 48/48/49 ms [GLZX_hexin_s5700]quit <GLZX_hexin_s5700>sa <GLZX_hexin_s5700>save (保存) The current configuration will be written to the device. Are you sure to continue?[Y/N]y Now saving the current configuration to the slot 0. Save the configuration successfully. <GLZX_hexin_s5700>ping www.baidu.com(域名ping不通) Error: Unknown host www.baidu.com. <GLZX_hexin_s5700>sys <GLZX_hexin_s5700>system-view Enter system view, return user view with Ctrl+Z. [GLZX_hexin_s5700]dns server 118.118.118.9 (设置DNS) [GLZX_hexin_s5700] [GLZX_hexin_s5700]dns resolve (启用解析) [GLZX_hexin_s5700]ping www.baidu.com (百度正常) PING www.a.shifen.com (14.215.177.38): 56 data bytes, press CTRL_C to break Reply from 14.215.177.38: bytes=56 Sequence=1 ttl=55 time=33 ms Reply from 14.215.177.38: bytes=56 Sequence=2 ttl=55 time=33 ms Reply from 14.215.177.38: bytes=56 Sequence=3 ttl=55 time=33 ms Reply from 14.215.177.38: bytes=56 Sequence=4 ttl=55 time=33 ms Reply from 14.215.177.38: bytes=56 Sequence=5 ttl=55 time=33 ms --- www.a.shifen.com ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 33/33/33 ms [GLZX_hexin_s5700]clock timezone BJ add 8 (设置时区) [GLZX_hexin_s5700]dis ntp-service status (查看NTP状态) clock status: unsynchronized clock stratum: 16 reference clock ID: none nominal frequency: 60.0002 Hz actual frequency: 60.0002 Hz clock precision: 2^17 clock offset: 0.0000 ms root delay: 0.00 ms root dispersion: 0.00 ms peer dispersion: 0.00 ms reference time: 00:00:00.000 UTC Jan 1 1900(00000000.00000000) [GLZX_hexin_s5700]ntp-service unicast-server 202.120.2.101 [GLZX_hexin_s5700] Oct 1 2008 16:37:58+08:00 GLZX_hexin_s5700 %%01NTP/4/PEER_SELE(l)[2]:The peer selected by the system is 202.120.2.101. [GLZX_hexin_s5700]dis clock (显示时间,发现时间已经校准) 2016-12-21 12:48:13+08:00 Wednesday Time Zone(BJ) : UTC+08:00 [GLZX_hexin_s5700]quit <GLZX_hexin_s5700>save The current configuration will be written to the device. Are you sure to continue?[Y/N]y Dec 21 2016 12:48:34+08:00 GLZX_hexin_s5700 %%01CFM/4/SAVE(l)[5]:The user chose Y when deciding whether to save the configuration to the device. Now saving the current configuration to the slot 0.. Save the configuration successfully. <GLZX_hexin_s5700> 至此,问题解决。

优秀的个人博客,低调大师

Python asyncio 中 run_in_executor 的线程池泄漏与优雅关闭

在异步服务里调用阻塞库(比如 requests、psycopg2、Pillow 处理图片)时,loop.run_in_executor() 几乎是标准做法。它把阻塞调用丢到线程池里,避免卡住事件循环。但很多人在服务退出或热重载时发现进程挂住不退出,或者看到日志里 Task was destroyed but it is pending,甚至线程数随请求量缓慢上涨。原因通常不在 asyncio 本身,而是 executor 的生命周期没被正确管理:默认 executor 不会随事件循环关闭而自动 join,直接 loop.close() 会留下未完成的线程任务。这篇文章从实际场景出发,讲清楚 run_in_executor 内部怎么工作、默认 executor 和自定义 ThreadPoolExecutor 的差异,以及如何在 FastAPI、aiohttp 或纯 asyncio 脚本里做到请求结束线程也干净退出,并给出一套可复用的关闭钩子写法。

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

用户登录
用户注册
修改密码
忘记密码