首页 文章 精选 留言 我的

精选列表

搜索[代码生成],共10000篇文章
优秀的个人博客,低调大师

oneproxy出现2103错误代码解决方案

中间件oneproxy 错误收集 通过中间件连接数据库,可以进入,但表显示不出 [root@s106 tmp]# mysql -u test -h 10.0.x.x-P3307 -ptest Use test3306(106)>show tables;ERROR 2103 (HY000): Lost connection to MySQL server during query or no managed connection avaiable! 排查:通过oneproxy管理端 mysql -uadmin -pOneProxy -h127.0.0.1 -P4041/4040 list backend; 显示mysql处于down关闭,状态,到数据库的机器,service mysqld restart重启数据库 再list backend mysql显示up,重新连接库表可以正常访问。 二.可能防火墙原因造成 没放通内网或者外网ip跟端口,注意如果是内网访问的话,那中间件连接后端的数据库也要写成内网ip 本文转自去轻狂书生51CTO博客,原文链接: http://blog.51cto.com/8999a/1975975 ,如需转载请自行联系原作者

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

python统计ES存储空间占用的代码

import os from os.path import join, getsize def get_dir_size(dir, suffix_filter=None): size = 0L if not suffix_filter: for root, dirs, files in os.walk(dir): size += sum([getsize(join(root, name)) for name in files]) else: pos = len(suffix_filter) for root, dirs, files in os.walk(dir): size += sum([getsize(join(root, name)) for name in files if name[-pos:] == suffix_filter]) return size if __name__ == "__main__": suffix = [".doc", ".pos", ".tim", ".tip", ".dvd", ".dvm", ".fdt", ".fdx", ".fnm", ".nvd", ".nvm"] sums = [0]*len(suffix) print "total size,", suffix all_size = 0.0 for i in range(0, 20): dir_name = r'D:\exp\elasticsearch-2.4.1\data\elasticsearch\nodes\metadata-dis-2017.05.17-192.168.10.5-93001\%d' % i total_size = get_dir_size(dir_name) all_size += total_size print total_size, ",", for index,f in enumerate(suffix): filesize = get_dir_size(dir_name, f) print filesize, if index != len(suffix)-1: print ",", sums[index] += filesize print "" print "sum:==>" print all_size, ",", sums print suffix, "==>" print "rate:",["{:6.4f}".format(sums[index]/all_size) for index,f in enumerate(suffix)], "other rate:", "{:6.4f}".format((all_size-sum(sums))/all_size) 结果: total size, ['.doc', '.pos', '.tim', '.tip', '.dvd', '.dvm', '.fdt', '.fdx', '.fnm', '.nvd', '.nvm'] 1317898783 , 151402808 , 49137369 , 301883415 , 4172214 , 141468778 , 2638 , 584778163 , 251283 , 14098 , 84785648 , 766 1322178937 , 151260397 , 49087934 , 301549945 , 4152932 , 141485775 , 2614 , 583980598 , 251572 , 14281 , 90390501 , 786 1319649899 , 151221470 , 49071207 , 301534617 , 4170120 , 140942980 , 2638 , 583509290 , 251019 , 14372 , 88929787 , 796 1314658083 , 151146248 , 49063654 , 301531446 , 4160809 , 140569823 , 2638 , 583241932 , 250572 , 14098 , 84674494 , 766 1320535933 , 151531650 , 49176093 , 302016964 , 4169422 , 141155952 , 2574 , 584516976 , 249055 , 14280 , 87700579 , 786 1320124857 , 151273971 , 49132333 , 301772358 , 4170596 , 141370180 , 2646 , 583164239 , 251026 , 14372 , 88970738 , 796 1316604607 , 151108604 , 49028330 , 301445032 , 4157849 , 140884622 , 2646 , 583674391 , 249567 , 14190 , 86036998 , 776 1318000530 , 151303288 , 49096354 , 301799237 , 4165775 , 141048755 , 2622 , 584203445 , 250668 , 14189 , 86113818 , 776 1319766874 , 151220609 , 49114923 , 301645769 , 4164351 , 141300148 , 2614 , 583120289 , 249195 , 14372 , 88932205 , 796 1316689373 , 151233222 , 49121429 , 301457255 , 4162316 , 141250414 , 2614 , 583262641 , 250656 , 14189 , 85932258 , 776 1318198716 , 151174674 , 49109038 , 301525947 , 4166291 , 140899847 , 2670 , 583598013 , 251472 , 14281 , 87454094 , 786 1320522076 , 151321339 , 49123177 , 301757750 , 4169815 , 141420824 , 2638 , 583468296 , 252283 , 14372 , 88989183 , 796 1319417975 , 151437201 , 49178363 , 301895414 , 4172117 , 140741668 , 2598 , 584117457 , 252773 , 14281 , 87603715 , 786 1317865422 , 151324795 , 49079342 , 301808126 , 4162318 , 141039688 , 2590 , 584047373 , 251114 , 14189 , 86133508 , 776 1319633778 , 151143225 , 49103608 , 301496485 , 4162216 , 140890300 , 2630 , 583678114 , 252802 , 14372 , 88887627 , 796 1317628208 , 151325819 , 49158454 , 301771482 , 4164837 , 141049094 , 2622 , 583762862 , 250401 , 14190 , 86126068 , 776 1318628784 , 151251125 , 49101866 , 301657775 , 4163649 , 140656991 , 2622 , 583999255 , 251506 , 14281 , 87527326 , 786 1316949748 , 151240013 , 49118487 , 301544994 , 4157729 , 140576588 , 2606 , 583907402 , 251325 , 14189 , 86134036 , 776 1316521884 , 151169612 , 49090142 , 301601874 , 4157814 , 140947297 , 2670 , 583231827 , 250762 , 14189 , 86053318 , 776 1319378726 , 151381023 , 49179677 , 301868523 , 4171265 , 140769513 , 2614 , 584110351 , 251400 , 14280 , 87627691 , 786 sum:==> 26370853193.0 , [3025471093L, 982271780L, 6033564408L, 83294435L, 2820469237L, 52504L, 11675372914L, 5020451L, 285065L, 1745003592L, 15660L] ['.doc', '.pos', '.tim', '.tip', '.dvd', '.dvm', '.fdt', '.fdx', '.fnm', '.nvd', '.nvm'] ==> rate: ['0.1147', '0.0372', '0.2288', '0.0032', '0.1070', '0.0000', '0.4427', '0.0002', '0.0000', '0.0662', '0.0000'] other rate: 0.0000 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6932271.html,如需转载请自行联系原作者

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

Android EditText聚焦时hint消失的简单代码

mInfo = (EditText)findViewById(R.id.fabu_info); mInfo.setOnFocusChangeListener( new OnFocusChangeListener(){ public void onFocusChange(Viewv, boolean hasFocus){ EditText_v = (EditText)v; if ( ! hasFocus){ // 失去焦点 _v.setHint(_v.getTag().toString()); } else { Stringhint = _v.getHint().toString(); _v.setTag(hint); _v.setHint( "" ); } } }); 本文转自Kai的世界,道法自然博客园博客,原文链接:http://www.cnblogs.com/kaima/archive/2011/08/09/2132059.html,如需转载请自行联系原作者。

资源下载

更多资源
Mario

Mario

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

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

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

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册