1.NMONä¸å å¤CPUå©ç¨ç为ä»ä¹ä¸ä¸è´
2.linuxå®å
¨å åºlinuxç³»ç»å®å
¨å åº
NMONä¸å å¤CPUå©ç¨ç为ä»ä¹ä¸ä¸è´
综åçä¸ä¸ªè¿ç¨å ç¨ç³»ç»èµæºä¸»è¦ä½ç°å¨ï¼CPU使ç¨çãå åå ç¨çãç£çå ç¨çãç½ç»IOçã
å¯ä»¥éè¿linuxèªå¸¦å·¥å ·ï¼topãfreeãduãnmon çå½ä»¤é åæ¥çã
1ãCPUå ç¨ç
å½ä»¤ï¼top
è¯æ³ï¼ top -hv | -abcHimMsS -d delay -n iterations [-u user | -U user] -p pid [,源码Y支付通道源码pid â¦]
ä¼å¿ï¼ç³»ç»èªå¸¦ï¼å¯ä»¥è§å¯å°è¿ç¨çPIDãå½åç»å½ç¨æ·ãè¿ç¨å ç¨cpuçæè¡çï¼
缺ç¹ï¼çé¢ç®åï¼
2ãå åå ç¨ç
å½ä»¤ï¼free
è¯æ³ï¼
usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]
-b,-k,-m,-g show output in bytes, KB, MB, or GB
-l show detailed low and high memory statistics
-o use old format ï¼no -/+buffers/cache lineï¼
-t display total for RAM + swap
-s update every [delay] seconds
-c update [count] times
-V display version information and exit
ä¾åï¼
free -m -t -s 3 -c 5 > test.log
è¿æ ·å¯ä»¥è®°å½5次æ¯é3ç§çå å使ç¨æ åµã
3ãç£çå ç¨ç
ç£çå ç¨æ¯é常éè¦çä¸ä¸ªææ ï¼ç±»ä¼¼mongodbè¿æ ·çåºç¨æ¥å¿ä¿¡æ¯å¦æä¸è¿è¡åçè§åä¼é æç£ççè¿å¿«å¢é¿ï¼ä¸æ¦è¢«ç£çåçï¼ä¼é æåºç¨å®æºã
å½ä»¤ï¼du -sh /log æ¥è¯¢/logç®å½çç£çå ç¨
4ãç½ç»å ç¨ç
主è¦æ¯æ£æ¥è¿ç¨çNICç读åæ åµ
å·¥å ·ï¼nmon
nmonæ¯ IBM æä¾çå è´¹çå¨AIXä¸åç§Linuxæä½ç³»ç»ä¸å¹¿æ³ä½¿ç¨ççæ§ä¸åæå·¥å ·ãnmonè¿è¡CPUå©ç¨çä¸ä¼è¶ è¿2%ãé对ä¸åçæä½ç³»ç»çæ¬ï¼nmonæç¸åºçæ¬çç¨åºãnmonå¯ä»¥çæ§ç½ç»IOç读åéçãCPU使ç¨ãç£çIOçä¿¡æ¯ã
ä¼å¿ï¼å è´¹ï¼å ¼å®¹æ§å¥½ï¼å¯è¾åºåæï¼ææºä»£ç 便äºäºæ¬¡å¼å
åºç¨ï¼æå¾å¤ç½ç»IOè¦æ±å¾é«çåå¸å¼æ°æ®åºç³»ç»ï¼å¦MySQLãPostgresqlãGreenPlumçé½éè¦è¾é«çç½ç»å¸¦å®½ï¼ä½¿ç¨å 纤ç½ä¹å¾å¸¸è§ã
5ãå½ç¶é对大è§æ¨¡ç½ç»ç³»ç»ææ´å¾ä¸ä¸ççæ§å·¥å ·ï¼ä¾å¦ï¼cactiãzabbixãmuninççãå ¶ä¸ï¼muninè¿å¯ä»¥èªå·±ç¼åæ件èªå®ä¹çæ§éè¦çæ°å¼ã
linuxå®å ¨å åºlinuxç³»ç»å®å ¨å åº
æå¡å¨è¿ç»´å·¥ç¨å¸åºè¯¥ææ¡åªäºç¥è¯ï¼é¦å ï¼ã
è¿ç»´å·¥ç¨å¸ç°å¨ä¹è¶æ¥è¶å¤å åï¼å¹¶ä¸æ¯æ¯ä¸ä¸ªé¶æ®µææ¡çæè½é½æ¯ä¸æ ·çï¼åå±æ¹åä¸ä¸æ ·åææ¡çæè½ä¹ä¼ä¸ä¸æ ·ã以ä¸æé¤æç½ç»è¿ç»´ãITè¿ç»´ãåå¨ç½ç»/å®å ¨çç¹ç§è®¾å¤è¿ç»´çæ¹åï¼å举äºå 个è¿ç»´æ¯è¾å¸¸è§çåå±æ¹åï¼ä»åºç¡ãè¿é¶å°é«çº§ä¸ä¸ªçº§å«æ¥è¯´æ大ä½éè¦ææ¡çæè½ï¼æå¯è½ä¸å ¨é¢ã
åºç¨è¿ç»´æ¹é¢
ï¼åºç¡ï¼Linuxåºç¡/对åºçè¯è¨ç¯å¢ï¼å¦tomcat/LAMP/LNMPè¿äºè¦è½ææ¡å®è£ ãé ç½®ãæ¥å¸¸ç»´æ¤æä½
è¿é¶ï¼Linuxåå¨ç®¡ç/å®å ¨å åº/è¿ç¨èµæºç®¡ç/ç½ç»ç®¡çï¼å ¶ä»åºç¨ä¸é´ä»¶å¦ç¼åï¼redis/memcachedï¼ãMQï¼ActiveMQ/RabbitMQçï¼ãæå¡åç°åæ²»çä¸é´ä»¶ï¼å¦zookeeperï¼ãé 置管çå·¥å ·ï¼å¦Puppet/Saltstack/CFengineçï¼
é«çº§ï¼Shellèæ¬å¯ä»¥ä¿¡æææ¥ï¼Linuxå æ ¸/ç½ç»ç常ç¨åæ°çé ç½®åçåä¼ååºæ¯ï¼èµæºæ¶èçææ¥åä¼åï¼çç»ææ¡iptablesï¼pamï¼selinuxçå®å ¨æºå¶ãJAVAè¿è¡ç¯å¢è¿éçæJVMä¼åãGCæ¥å¿åæãJava线ç¨å æ åæçã
é¢å¤ï¼éè¦äºè§£ä¸äºï¼
èæåææ¯ï¼å¦VMware/VirtualBox/KVM
èæå管çææ¯ï¼å¦vSphere/convirt/oVirt/OpenNebulaç
Dockeråºæ¬ä½¿ç¨å管ç
ç§æäºå¹³å°ï¼å¦Openstack/CloudStackç
å ¬æäºå¹³å°ï¼å¦é¿éäº/AWS
åºç¡ç½ç»ææ¯ï¼å¦IPç½ç»åºç¡ãOSIä¸å±ãHTTP/HTTPS/RPCåè®®ãVLANãè·¯ç±ãNATãACLçæ¦å¿µåç¸å ³é ç½®ææ¯
èæååäºè¿ç»´æ¹å
ï¼å¦ä»¥åä¸åçVMware为ä¾ï¼åºç¡ï¼ESXiå®è£ ãé ç½®ãå主æºç®¡çï¼åç§æ¦å¿µï¼å¦VM/datastore/vSwitchçï¼vCenterçåºæ¬ç®¡çï¼å¦æ¨¡æ¿ãç½ç»é ç½®ãå éãè¿ç§»ç
è¿é¶ï¼vCenteré«å¯ç¨æ§ãvSphereHAé«å¯ç¨æ§ãvSphereFaultTolerantãVMotionï¼å¦ä½¿ç¨å ±äº«åå¨è¿éè¦äºè§£FCSAN/iSCSIåå¨ç½ç»ç¥è¯
é«çº§ï¼vSphereSiteRecovery/vSphereDataProtection/vSAN管çç
é¢å¤ï¼å¦æ使ç¨VMwareçå ¶ä»äº§åï¼å¦NSX/vRealizeçï¼åè¦å¦çä¸è¥¿æ´å¤ã
综ååå±
ï¼åè¿æå¦ä¸ä¸äºéè¦ææ¡ï¼åºç¡ï¼çæ§ï¼å¦Nagios/Zabbixçåºç¡é ç½®ï¼DNS/NFS/FTPçæå¡é ç½®ï¼Dockeråºæ¬ä½¿ç¨å管ç
è¿é¶ï¼ç½ç»åæï¼å¦æå tcpdump/wiresharkï¼æ§è½åæå·¥å ·ï¼å¦nmon/iftop/iotopï¼è´è½½åè¡¡ï¼å¦nginx/LVS/haproxyãå¦ä¹ ä¸é¨èæ¬è¯è¨ï¼å¦python/perl/goçã
é«çº§ï¼è¿ç¨è·è¸ªåæ éåæï¼å¦strace/kdump/gdbãDockerç¼æä½ç³»ï¼å¦kubernetes/swarmçãè¿ææ¥å¿åæELKï¼ææ æ°æ®åºinfluxdb/promethusç
ä¸é¢çèµ·æ¥ç¼è±ç¼ä¹±ï¼å ¶å®å¹¶ä¸æ¯æ¯é¡¹é½éè¦ææ¡ã以ä¸å 个æ¹é¢é½å¯ä»¥æä¸ä¸ªåç¬çåå±æ¹åï¼å¦æè½ç¬ç«æå®ä¸ä¸ªæ¹åï¼å°±å·²ç»è¿å ¥è¿ç»´æ¶æå¸çå±é¢äºã
èæååç§æäºç®¡çæ¹å
ï¼å¦ç¬ç«æå®OpenStackä¸ç产ï¼é便æ个æµè¯ç¯å¢ç©ç©ä¸ç®ãDockeråç¼æä½ç³»æ¹å
ï¼å¦ç¬ç«æå®Kubernetesä¸ç产ãç²¾ç»åççæ§åè¦è®¾è®¡åå®æ½
ï¼ä¸ä» ä» æ¯åä¸çæ建zabbixè¿ç±»çæ§å·¥å ·é对ç®åçèµæºãç½ç»ãåºç¨å¯ç¨æ§çæ§çãè¿åºå æ¬æ¥å¿åæãç²¾ç»ææ çæ§çãå¦ä¸»å¯¼ç åè§èæ¥å¿ï¼ä½¿ç¨ELKè¿è¡æ¥å¿åæ并é对详ç»ä¸å¡åºæ¯åºå ·ç²¾åçæ§åä¸å¡æ°æ®å¯è§åæ¥è¡¨ã
åå¦ä½¿ç¨influxdb/grafanaæpromethusçç³»ç»ï¼æ¶éç¡¬ä»¶ä¼ æå¨/cpu/mem/io/eth/vm/dockerçä¿¡æ¯ï¼ç¶åæ建精ç»åçèµæºä½¿ç¨æ¥è¡¨çã
ç¶ååæ´åæ¥å¿åæ/ç²¾ç»åèµæºçæ§æéä»ä¸å¡->åºç¨->èµæº->硬件çä¸ä½åçæ§èå¨
èªå¨é 置管çæ¹å
ï¼ç®åç¹ç使ç¨puppet/saltstackçå¹³å°å ä¸äºå®å¶èæ¬æ¥ç®¡çï¼é«çº§ç¹çå¼åä¸ä¸ªç®¡çå¹³å°ï¼å¹¶UIåãéè¦çå®é å·¥ä½ä¸çåºç¨åºæ¯ã管çè§æ¨¡ãèªå¨ç¨åº¦ãçæ§éæ±çæ¥é å使ç¨ãæ¯ä¸ªäººçç²¾åæ¯æéçï¼ä¸ä¸ªä¼ç§çè¿ç»´æéè¦çæ¯ä¸é¢æ¶å»ä¿æå¦ä¹ çå¿å强大çèªå¦è½åã
linuxå®å ¨å åºåºå ³éä»ä¹æå¡ï¼
1ãç¦ç¨æ å ³çç»(ç¼è¾ï¼vi/etc/group)
2ãç¦æ¢rootç¨æ·è¿ç¨ç»å½
3ãå¦æä¸éè¦Windowsç½ç»å ±äº«åè½ï¼åå¯ä»¥æ¾å¿å ³éSambaã
使ç¨ä¸é¢çå½ä»¤è½æ¥çä¼´éç³»ç»å¯å¨èå¯å¨çæå¡ï¼
Linuxå®å ¨è½¯ä»¶æåï¼
æã
æ¤å«ç¥Â·å ¥ä¾µé²æ¤ç³»ç»ï¼é²æå¡å¨è¢«å ¥ä¾µçå®å ¨è½¯ä»¶ï¼ææ¨é©¬æ¥æãè¿ç¨é²æ¤ãå®å ¨æ£æµãç¨æ·é²æ¤ãSQLæ³¨å ¥é²æ¤ãç½ç«å åºç模åã
æ¤å«ç¥Â·ç½ç«å®å ¨ç³»ç»ï¼é²æ¢ç½ç«è¢«å ¥ä¾µçå®å ¨è½¯ä»¶ï¼éè¿å®å ¨çç¥ååå°å¯ç éï¼å¨ä¸ä¿®æ¹æºä»£ç çæ åµä¸è§£å³ç½ç«è¢«å ¥ä¾µãæ马ã篡æ¹ãå«æçè¡ä¸ºï¼å ç«ææç½é¡µæ¨é©¬ã