分页: 3/196 第一页 上页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]
Aug 2
ESXI虚拟机磁盘扩容总体上比较简单,为了数据的安全,动手前做好数据备份,或者克隆虚拟机备份,通过VMware vSphere Client客户端连接ESXI,编辑要扩容磁盘的虚拟机设置,选择磁盘可以直接修改为想要扩容的大小,注意该大小确定之后不能往小的修改,重启虚拟机之后你会发现磁盘的容量并没有发生改变,用fdisk -l查看硬盘的容量确实是已修改后的容量了,要想正常使用新增的容量我们还要做以下几步:

一、关闭要扩容的虚拟机,然后把磁盘添加到其他的虚拟机,或者使用LiveCD引导,我们这里直接把磁盘添加到另一台虚拟机,使用VMware vSphere Client客户端连接ESXI,选择要添加磁盘的那台虚拟机,编辑虚拟机设置-添加-硬盘-使用现有虚拟磁盘-浏览选择我们要扩容的那块磁盘之后确定保存,然后重启这台虚拟机。

二、登录虚拟机操作系统,执行以下操作:

[root@localhost ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd0b1bc7f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1033     8297541   82  Linux swap / Solaris
/dev/sdb2            1034       20887   159477255   83  Linux

这是我们内部的测试机,磁盘空间有限,为了充分的利用磁盘空间,分区比较简单,就一个交换分区和根分区,下面我们使用fdisk删除根分区,并重新建根分区:

[root@localhost ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): d
Partition number (1-4): 2

Command (m for help): p

Disk /dev/sdb: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd0b1bc7f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1033     8297541   82  Linux swap / Solaris

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1034-32635, default 1034):
Using default value 1034
Last cylinder, +cylinders or +size{K,M,G} (1034-32635, default 32635):
Using default value 32635

Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

三、格式化磁盘
使用 resize2fs 扩大文件系统大小,磁盘原有的数据不会丢失。
e2fsck -f /dev/sdb2
resize2fs /dev/sdb2

四、关闭该虚拟机,移除这块磁盘,启动那台要扩容的虚拟机,登录系统之后我们发现磁盘已经是扩容后的大小了,最重要的是数据无损。
[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       239G  101G  126G  45% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
[root@localhost ~]#

如果像阿里云那样,数据盘在单独的一块磁盘,就更好操作了。
Jul 29
错误发生在内部测试使用的ESXI主机上的虚拟机,因为之前的ESXI主机raid卡和温度传感器报错,机器不能正常启动,所以就把磁盘换到另一台配置一样的机器上,启动之后ubuntu、freebsd、debian8、solaris、centos7虚拟机都连接正常,唯独两台CentOS 6.8系统的虚拟机不能连接,于是使用VMware vSphere Client连接ESXI打开控制台登录系统,执行ifconfig发现只剩下:

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:448 (448.0 b)  TX bytes:448 (448.0 b)


执行 /etc/init.d/network restart

Shutting down loopback insterface:                     [  OK  ]
Bringing up loopback insterface:                          [  OK  ]
Bringing up interface eth0:  Device eth0 does not seem to be present,delaying initialization.  
                                                                      [FAILED]

执行 ifconfig -a 发现没有eth0,却有一个eth1,原来是mac地址变化了,知道是什么问题就好办了,不重启机器你可以把eth1的mac地址记下,cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 然后把里面的eth0改为eth1,HWADDR改为eth1的mac地址,然后service network restart或ifup eth1 就可以了。

如果你的机器可以重启,可以使用以下方法:
vi /etc/sysconfig/network-scripts/ifcfg-eth0 把里面的HWADDR改为eth1的mac地址之后保存。
vi /etc/udev/rules.d/70-persistent-net.rules 你会发现有两行配置,把eth0的那一行删除,把eth1改为eth0之后保存,类似于下面这样:

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:ce:cb:ee", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


使用第二种方法的可以把/etc/sysconfig/network-scripts/ifcfg-eth1删了,或者设置为开机不启动,然后执行init 6 或者reboot重新启动虚拟机,虚拟机重新启动之后网络正常了。
Tags: , ,
Jul 27
一、今天编译安装了MySQL5.6.31,安装启动之后错误日志报以下Warning信息:
160727 12:52:32 mysqld_safe Starting mysqld daemon with databases from /home/mysql/3307/data
2016-07-27 12:52:33 0 [Note] /usr/local/webserver/mysql56/bin/mysqld (mysqld 5.6.31-log) starting as process 26248 ...
2016-07-27 12:52:33 26248 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-07-27 12:52:33 26248 [Note] InnoDB: The InnoDB memory heap is disabled
2016-07-27 12:52:33 26248 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-07-27 12:52:33 26248 [Note] InnoDB: Memory barrier is not used
2016-07-27 12:52:33 26248 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-07-27 12:52:33 26248 [Note] InnoDB: Using CPU crc32 instructions
2016-07-27 12:52:33 26248 [Note] InnoDB: Initializing buffer pool, size = 512.0M
2016-07-27 12:52:33 26248 [Note] InnoDB: Completed initialization of buffer pool
2016-07-27 12:52:33 26248 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-27 12:52:33 26248 [Note] InnoDB: 128 rollback segment(s) are active.
2016-07-27 12:52:33 26248 [Note] InnoDB: Waiting for purge to start
2016-07-27 12:52:33 26248 [Note] InnoDB: 5.6.31 started; log sequence number 1601096
2016-07-27 12:52:33 26248 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3307
2016-07-27 12:52:33 26248 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2016-07-27 12:52:33 26248 [Note] Server socket created on IP: '0.0.0.0'.
2016-07-27 12:52:33 26248 [Warning] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
2016-07-27 12:52:33 26248 [Warning] 'user' entry '@localhost.localdomain' ignored in --skip-name-resolve mode.
2016-07-27 12:52:33 26248 [Warning] 'proxies_priv' entry '@ [email protected]' ignored in --skip-name-resolve mode.
2016-07-27 12:52:33 26248 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for th
e table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2016-07-27 12:52:33 26248 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
2016-07-27 12:52:33 26248 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for th
e table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2016-07-27 12:52:33 26248 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for
the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2016-07-27 12:52:33 26248 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.
2016-07-27 12:52:33 26248 [Note] Event Scheduler: Loaded 0 events
2016-07-27 12:52:33 26248 [Note] /usr/local/webserver/mysql56/bin/mysqld: ready for connections.


BUG产生具体原因不详,官方bugs.mysql.com上有提供修复这5张表的SQL文件,下载链接:http://bugs.mysql.com/file.php?id=19725

下面我们就按照文件的说明操作
  1. drop these tables from mysql:
     innodb_index_stats
     innodb_table_stats
     slave_master_info
     slave_relay_log_info
     slave_worker_info
  
  2. delete all .frm & .ibd of the tables above.
  
  3. run this file to recreate the tables above (source five-tables.sql).
  
  4. restart mysqld.

二、具体操作步骤
2.1、删除这5张表
drop table if exists innodb_index_stats;
drop table if exists innodb_table_stats;
drop table if exists slave_master_info;
drop table if exists slave_relay_log_info;
drop table if exists slave_worker_info;
点击在新窗口中浏览此图片

2.2、删除这5张表对应的.frm和.ibd文件
点击在新窗口中浏览此图片
rm -f /home/mysql/3307/data/mysql/*.ibd

2.3、导入下载的five-tables.sql文件
source /home/sql/five-tables.sql

2.4、导入完成之后,重新启动MYSQL服务

三、检验结果:
点击在新窗口中浏览此图片
已经没有报错信息了。
Jul 26
一、第一步获取安装文件,官网目前搜索也找不到了,这里附件提供之前保存的安装文件

二、使用VMware vSphere Client连接ESXI在配置里启用ssh服务,然后通过ssh客户端工具连接ESXI,安装文件通过sftp上传或者在ESXI上下载都可以,本文文件上传至/tmp目录。

三、安装MegaCli
esxcli software vib install -v /tmp/vmware-esx-MegaCli-8.04.07.vib --no-sig-check

四、MegaCli使用
cd /opt/lsi/MegaCLI/

#查看磁盘状态
./MegaCli -PDList -aAll  |  grep  "Firmware state:"
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up


#查看RAID信息
./MegaCli -LDinfo -Lall -aAll    
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :Virtual Disk 0
RAID Level          : Primary-5, Secondary-0, RAID Level Qualifier-3
Size                : 836.625 GB
Parity Size         : 278.875 GB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 4
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Encryption Type     : None
Is VD Cached: No

五、相关命令
./MegaCli -LDInfo -Lall -aALL 查raid级别
./MegaCli -AdpAllInfo -aALL 查raid卡信息
./MegaCli -PDList -aALL 查看硬盘信息
./MegaCli -AdpBbuCmd -aAll 查看电池信息
./MegaCli -FwTermLog -Dsply -aALL 查看raid卡日志
./MegaCli -adpCount 【显示适配器个数】
./MegaCli -AdpGetTime –aALL 【显示适配器时间】
./MegaCli -AdpAllInfo -aAll    【显示所有适配器信息】
./MegaCli -LDInfo -LALL -aAll    【显示所有逻辑磁盘组信息】
./MegaCli -PDList -aAll    【显示所有的物理信息】
./MegaCli -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ 【查看充电状态】
./MegaCli -AdpBbuCmd -GetBbuStatus -aALL【显示BBU状态信息】
./MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aALL【显示BBU容量信息】
./MegaCli -AdpBbuCmd -GetBbuDesignInfo -aALL    【显示BBU设计参数】
./MegaCli -AdpBbuCmd -GetBbuProperties -aALL    【显示当前BBU属性】
./MegaCli -cfgdsply -aALL    【显示Raid卡型号,Raid设置,Disk相关信息】

5.1、磁带状态的变化,从拔盘,到插盘的过程中。
Device        |Normal|Damage|Rebuild|Normal
Virtual Drive    |Optimal|Degraded|Degraded|Optimal
Physical Drive    |Online|Failed –> Unconfigured|Rebuild|Online

5.2、查看磁盘缓存策略
./MegaCli -LDGetProp -Cache -L0 -a0
./MegaCli -LDGetProp -Cache -L1 -a0
./MegaCli -LDGetProp -Cache -LALL -a0
./MegaCli -LDGetProp -Cache -LALL -aALL
./MegaCli -LDGetProp -DskCache -LALL -aALL

5.3、设置磁盘缓存策略
缓存策略解释:
WT    (Write through
WB    (Write back)
NORA  (No read ahead)
RA    (Read ahead)
ADRA  (Adaptive read ahead)
Cached
Direct

例子:
./MegaCli -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0
./MegaCli -LDSetProp -Cached|-Direct -L0 -a0
enable / disable disk cache
./MegaCli -LDSetProp -EnDskCache|-DisDskCache -L0 -a0

5.4、创建一个raid5阵列,由物理盘 1,2,3构成,该阵列的热备盘是物理盘4
./MegaCli -CfgLdAdd -r5 [32:1,32:2,32:3] WB Direct -Hsp[32:4] -a0

5.5、创建阵列,不指定热备
./MegaCli -CfgLdAdd -r5 [32:1,32:2,32:3] WB Direct -a0

5.6、删除阵列
./MegaCli -CfgLdDel -L1 -a0

5.7、在线添加磁盘
./MegaCli -LDRecon -Start -r5 -Add -PhysDrv[32:5] -L1 -a0

5.8、阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。
./MegaCli -LDInit -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
./MegaCli -LDInit -ProgDsply -LALL -aALL

5.9、查看阵列后台初始化进度
./MegaCli -LDBI -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
./MegaCli -LDBI -ProgDsply -LALL -aALL

5.10、指定第5块盘作为全局热备
./MegaCli -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[32:5] -a0

5.11、指定为某个阵列的专用热备
./MegaCli -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[32:5] -a0

5.12、删除全局热备
./MegaCli -PDHSP -Rmv -PhysDrv[32:5] -a0

5.13、将某块物理盘下线/上线
./MegaCli -PDOffline -PhysDrv [32:5] -a0
./MegaCli -PDOnline -PhysDrv [32:5] -a0

5.14、查看物理磁盘重建进度
./MegaCli -PDRbld -ShowProg -PhysDrv [32:5] -a0
或者以动态可视化文字界面显示
./MegaCli -PDRbld -ProgDsply -PhysDrv [32:5] -a0

5.15、查看Foreign状态的磁盘
./MegaCli -CfgForeign -Scan -a0

5.16、清除Foreign状态
./MegaCli -CfgForeign -Clear -a0

5.17、获取某个盘的详细信息
./MegaCli -pdInfo -PhysDrv[32:1] -a0

5.18、创建raid10
./MegaCli -CfgSpanAdd -r10 -Array0[32:1,32:2] -Array1[32:3,32:4] WB Direct -a0

使用MegaCli在线操作raid还是很方便的,在其他操作系统上也有相应的安装包可以使用,感兴趣的可以自己找台机器试试。

参考文档:
http://de.community.dell.com/techcenter/support-services/w/wiki/909.how-to-install-megacli-on-esxi-5-x
Tags: , ,
Jul 11
下载地址:http://www.oracle.com/technetwork/cn/server-storage/solaris11/downloads/install-2245079-zhs.html
演示使用的是当前最新文本安装版本:http://download.oracle.com/otn/solaris/11_3/sol-11_3-text-x86.iso

第1步:打开电源进入到solaris系统安装界面,默认选择美式英语,直接回车进入下一步
点击在新窗口中浏览此图片

第2步:默认为英语,如果你想用简体中文请选择1,这里使用默认的英语,回车进入下一步
点击在新窗口中浏览此图片

第3步:solaris安装菜单栏,有几个选项可以选择,这里是安装系统,所以选择1回车继续下一步
点击在新窗口中浏览此图片

第4步:按F2继续
点击在新窗口中浏览此图片

第5步:使用本地磁盘,按F2继续
点击在新窗口中浏览此图片

第6步:按F2继续下一步
点击在新窗口中浏览此图片

第7步:按F2继续
点击在新窗口中浏览此图片

第8步:设置计算机名,你可以设置任何你想要的名称,输入完之后按F2继续
点击在新窗口中浏览此图片

第9步:网络设置,这里选择第二项,手动设置,按F2继续
点击在新窗口中浏览此图片

第10步:手动设置IP,子网掩码及网关地址,根据自己的实际情况填写,设置完毕按F2继续
点击在新窗口中浏览此图片

第11步:设置DNS,按F2继续
点击在新窗口中浏览此图片

第12步:输入你服务商的DNS地址,或者国内的公用DNS地址,阿里百度都有公用DNS,根据自己的情况填写,按F2继续
点击在新窗口中浏览此图片

第13步:这里不需要,直接按F2进入下一步
点击在新窗口中浏览此图片

第14步:保持默认,按F2继续
点击在新窗口中浏览此图片

第15步:选择时区,根据自己的实际情况选择,这里选择亚洲(Asia),按F2继续
点击在新窗口中浏览此图片

第16步:选择中国(china),按F2继续
点击在新窗口中浏览此图片

第17步:只有一个时区可以选择,按F2继续
点击在新窗口中浏览此图片

第18步:选择语言,这里选择默认英语,如果你想使用中文的话,请选择Chinese,按F2继续
点击在新窗口中浏览此图片

第19步:字符集保持默认,en_US,UTF-8,按F2继续
点击在新窗口中浏览此图片

第20步:日期和时间,根据自己安装的日期和时间设置,设置完之后按F2继续
点击在新窗口中浏览此图片

第21步:保持默认,美式英语,按F2继续
点击在新窗口中浏览此图片

第22步:设置root帐号的密码,如果你想创建一个用户,可以在下面输入相关信息创建一个用户帐号,按F2继续下一步
点击在新窗口中浏览此图片

第23步:有帐号的可以输入帐号和密码登录,这里选择F2继续
点击在新窗口中浏览此图片

第24步:保持默认,不使用代理,按F2继续
点击在新窗口中浏览此图片

第25步:安装信息,确认无误按F2开始安装,如果有要修改的可以按F3返回修改,我们按F2继续
点击在新窗口中浏览此图片

第26步:安装进度条,等待安装...
点击在新窗口中浏览此图片

第27步:按F8重新启动以完成安装
点击在新窗口中浏览此图片

安装完成,启动界面
点击在新窗口中浏览此图片

登录系统
点击在新窗口中浏览此图片
点击在新窗口中浏览此图片

solaris的其他相关信息可以查看以下链接:
http://www.oracle.com/technetwork/cn/articles/servers-storage-dev/solaris-install-borges-1989211-zhs.html#5
分页: 3/196 第一页 上页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]