记录关于Devops运维,虚拟化容器云计算,数据库,网络安全等各方面问题。
Linux iostat监测IO状态 Linux系统出现了性能问题,一般我们可以通过top、iostat、free、vmstat等命令来查看初步定位问题。其中iostat可以给我们提供丰富的IO状态数据。1. 基本使用$iostat -d -k 1 10
参数 -d 表示,显示设备(磁盘)使用状态;-k某些使用block为单位的列强制使用Kilobytes为单位;1 10表示,数据显示每隔1秒刷新一次,共显示10次。$iostat -d -k 1 10
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 39.29 21.14 1.44 441339807 29990031
sda1 0.00 0.00 0.00 1623 523
sda2 1.32 1.43 4.54 29834273 94827104
sda3 6.30 0.85 24.95 17816289 520725244
sda5 0.85 0.46 3.40 9543503 70970116
sda6 0.00 0.00 0.00 550 236
sda7 0.00 0.00 0.00 406 0
sda8 0.00 0.00 0.00 406...
在 CentOS 5.5 安裝 apc!作者: away (19:29:08)apc 是給 php 加速用的模組,聽說效能比用 Zend Optimizer 還要高。參考 http://blog.digitalstruct.com/2007/12 ... ache-with-zend-framework/必須先安裝 httpd-devel 指令:yum -y install httpd-devel安裝 apc 指令:pecl install apc編輯 /etc/php.ini 在最後增加一行:extension=apc.so重新啟動 httpd 指令:service httpd restart
SCP 命令详解 SCP 命令跟 CP 命令类似,只不过CP命令是在同一台机器上用的,SCP是在2台机器上复制的命令。举例说明:复制远程服务器的文件到本地scp -P 999 root@21andy.com:/home/test.zip /home/复制本地的目录到远程服务器scp -P 999 -r /home/andy/ root@21andy.com:/home/ SCP 命令语法scp [-1245BCpqrv] [-c cipher] [F ssh_config] [-I identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:] file1 […] [[suer@]host2:]file2 SCP 命令说明Scp在主机间复制文件。他使用 ssh(1)作为数据传输。而且用同样认证和安全性。 scp将在认证中请求输入密码所有的文件可能需要服务器和用户的特别描述来指明文件将被复制到/从某台服务器。两个远程登录的服务器间的文件复制是允许的。 SCP 命令选项-1 强制scp 用协议1-2 强制scp 用协议2-4 强制scp用IPV4的网址-6 强制scp用IPV6的网址-B 选择批处理模式(防止输入密码)-C 允许压缩。 标注-C到ssh(1)来允许压缩-c cipher选择cipher来加密数据传输。这个选项直接传递到ssh(1)-F ssh_config设定一个可变动的用户配置给ssh.这个选项直接会被传...
XenServer - 新增儲存裝置 - NFSNFS(Network File System) 在 Linux/Unix/BSD 的世界中就如同是 Windows 的網路芳鄰一樣. 系統是透過 Linux/Unix/BSD 去分享資料,而 XenServer 可以去存取遠端的 NFS 當作他的 Storage repositor. 一般的 Linux 套件都將 NFS 當作標準配備.大多都是處於啟動的狀態只需稍加修改設定當分享目錄其可完成. 在啟動 NFS 所需的 2 個services I.Portmap 因為 nfs 用到 RPC 的功能,所以這個 daemon 必須啟動II.nfs 由下面 3 個 daemon組成 1.mountd 2.nfsd 3.rquotadNFS - Linux , Unix , BSD..編輯 "/etc/exports" 並將要分享的目錄(/share)寫入檔案中[root@benjr ~]# vi /etc/exports /share 192.8.1.126(rw,sync,no_root_squash)1. /share : 為欲分享的目錄,這個目錄必須已經存在(# mkdir) 2. 192.8.1.126 : 為可存取此分享目錄的 IP 區段,因為我只設定只有一台 XenServer 可以存取這個 NFS 所分享的目錄所以設定為一個 IP,如果你是要同時分享給多個使用者使用時,可以寫成 192.8.1.0/255.255.255.0 (192.168.0.*) 只要是同網段的 IP 皆可以使用,或者為網域名稱*.example.com,以上的設定都可以配合?,*來使用3. rw :分享...
华为交换机查看IP与对应端口比如交换机配置IP: 10.10.10.20交换机下面接服务器IP为:10.10.10.0/24网段,要查出10.10.10.100服务器所接的交换机端口首先登录到交换机CLI下,交换机必需配置的IP与服务器同一个网络的IP才可以使用<Quitway> system-view[Quidway] sysname S-switch-A[S-switch-A] ping 10.10.10.100[S-switch-A]dis arpIP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE VPN-INSTANCE10.10.100 e000-0af0-cbba 19 DF0 GE0/0/1 可以看到对应的IP与端口
1.1 什么是Smartmontools? Smartmontools是一种硬盘检测工具,通过控制和管理硬盘的SMART(Self Monitoring Analysis and Reporting Technology,自动检测分析及报告技术)技术来实现的,SMART技术可以对硬盘的磁头单元、盘片电机驱动系统、硬盘内部电路以及盘片表面介质材料等进行监测,当SMART监测并分析出硬盘可能出现问题时会及时向用户报警以避免计算机数据受损失。SMART技术必须在主板支持的前提下才能发生作用,而且 SMART技术也不能保证能预报所有可能发生的硬盘故障。SMART(SFF-8035i) 是硬盘生产商们建立的一个工业标准,这个标准就是在硬盘上保存一个跟执行情况,可靠程度,读找错误率等属性的表格。所有属性都有一个1byte(大小范围1-253)的标准化值,还包含另一个1byte的关键阶段值,如果属性表格内某个数据接近小于或达到关键阶段值,表明硬盘工作不正常了。2.1 Smartmontools的使用 1、启动监控进程 # /etc/init.d/smartd start
启动 smartd: [ 确定 ]
2、检查硬盘是否支持SMART 1993年以后出厂的硬盘基本上都支持SMART技术,使用如下命令可以来查看: # smartctl -i /dev/hdb
smartctl version 5.33 [i6...
HDSentinel:你的硬盘健康吗?因为硬盘承载着我们的重要数据,所以时常查看硬盘的健康状况是很有必要的。要达成此目的,你可以使用 HDSentinel 这个命令行程序。HDSentinel 支持 IDE、S-ATA(SATA II)、SCSI、USB 等类型的硬盘,利用它你可以即时查看硬盘的健康信息。HDSentinel 输出的信息十分简明,让人一目了然。身边常备 HDSentinel,可以使你及早防范,以免造成重要数据的丢失。下载及安装首先,你可以从 http://www.hdsentinel.com/hdslin/hdsentinel.gz 下载 hdsentinel。然后使用以下命令解包:gunzip hdsentinel.gz你将得到 hdsentinel 二进制文件。接着,为它赋予可执行权限:chmod a+x hdsentinel并拷贝到 /usr/local/bin 目录:cp hdsentinel /usr/local/bin一般使用在执行 hdsentinel 后(注意需要 root 权限),你可以获得类似下面的输出信息:Hard Disk Sentinel for LINUX console 0.02 (c) 2008 info@hdsentinel.comStart with -r [reportfile] to save data to report, -h for helpExamining hard disk configuration …HDD Device 1: /dev/sdaHDD Model ID : ST380815ASHDD Serial No: 6QZ25EF2HDD Revision : 3.AADHDD Size : 76319 MBInterface : S-AT...
XenServer VM备份之PHD1、VM Metadata(备份方法CLI:xe-backup-metadata或XenServer Console)2、VM&vhd文件(导入、导出、快照)第3种方式备份:PDH Virtaul Backup For XenServer\VMware(第三方工具)http://www.phdvirtual.com/相关功能及特点信息实现备份方法:很简单1、把下载的*.xva导入到你的XenServer 2、在已安装XenCenter工具的主机上,再安装PHD Agent.3、启动XenCenter工具,进入Console。 4、做初始配置 5、执行备份: 6、执行VM恢复 7、VM正常
xenserver 报错No network interface found上个礼拜五xenserver挂了,在上面执行加入pool的命令显示如下错误:The master says the host is not known to it. Perhaps the Host was deleted from the master’s database? Perhaps the slave is pointing to the wrong master?之后xsconsole配置网卡的时候看到No network interface found解决办法如下:Have you re-IPed your XenServer pool? The xenconsole will show no network information if it is not able to communicate to the pool master. If you go to the command line and type “ifconfig” or “ifconfig | more” you will indeed see an IP address configured on the bridge file of the control VM, AKA “dom 0″. More than likely, it is using the old IP address. To work around this, we need to 3 things. First is to bring down the interface with the wrong IP. From the previous “ifconfig” command, you will see the bridge file, such as “xenbr0″. For a bond, it may be “xapi1″.ifdown xenbr0Running “ifconfig” again, will show the interface is not available. Next, w...
centos下查看硬盘使用时间yum install smartmontools -y然后输入这个:smartctl -A /dev/sda如果不行用df看看硬盘名称,把sda换了即可=== START OF READ SMART DATA SECTION ===SMART Attributes Data Structure revision number: 10Vendor Specific SMART Attributes with Thresholds:ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0×000f 083 063 044 Pre-fail Always – 204269687 3 Spin_Up_Time 0×0003 099 099 000 Pre-fail Always – 0 4 Start_Stop_Count 0×0032 100 100 020 Old_age Always – 18 5 Reallocated_Sector_Ct 0×0033 100 100 036 Pre-fail Always – 0 7 Seek_Error_Rate 0×000f 069 060 030 Pre-fail Always – 7825289 9 Power_On_Hours 0×0032 099 099 000 Old_age Always – 162610 Spin_Retry_Count 0×0013 100 100 097 Pre-fail Always – ...
最新评论