My Knowledge Base
2013-03-18 12:55 陈尚华 阅读(539) 评论(0) 编辑 收藏 举报2013-01-21
OS:Ubuntu 11.04
App:opennebula3.0,libvirt,kvm,qemu-img;
Bug:
clusteradmin@cloudnode9:~/var/706/images$virsh start one-706
error: Failed to start domain one-706
error: internal error process exited while connecting to monitor: libvir: Security Labeling error : internal error error calling aa_change_profile()
Reason:
升级libvirt重新启用了安全性设置。
Solution:
sudo aa-complain /usr/sbin/libvirtd
sudo aa-enforce /usr/sbin/libvirtd
url:http://ubuntuforums.org/showthread.php?t=1570687
**********************************************************************************
2013-03-18
问题现象:
两台Linux主机配置了SSH双向验证,当一台ssh另一台的时候出现如下情况:
bin chensh etc images include lib share var win2k3template.tmpl
[oneadmin@opennebula01 ~]$ ssh opennebula02
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for opennebula01 has changed,
and the key for the corresponding IP address 192.168.100.107
is unchanged. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
Offending key for IP in /srv/cloud/one/.ssh/known_hosts:1
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
10:1e:67:78:26:50:3c:15:d1:9f:e3:4e:93:96:fb:ba.
Please contact your system administrator.
Add correct host key in /srv/cloud/one/.ssh/known_hosts to get rid of this message.
Offending key in /srv/cloud/one/.ssh/known_hosts:3
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
Last login: Mon Mar 18 15:23:47 2013 from opennebula01
[oneadmin@opennebula02 ~]$ exit
logout
Connection to opennebula02 closed.
问题原因:
其实这是客户机问题,与SSH服务器无关,只需把.ssh目录下生成的known_hosts文件删除即可。下次使用ssh时文件会重建的。
出现这问题的原因一般是同一主机使用了不同的用户名登陆。(如果多个域名和多个IP同时指向同一主机,ssh仍然视为不同主机。)
解决办法:
[oneadmin@opennebula01 ~]$ cd ~/.ssh/
[oneadmin@opennebula01 .ssh]$ ls
authorized_keys config id_rsa id_rsa.pub known_hosts
[oneadmin@opennebula01 .ssh]$ rm -rf known_hosts
[oneadmin@opennebula01 .ssh]$ ls
authorized_keys config id_rsa id_rsa.pub
[oneadmin@opennebula .ssh]$ cd
结果验证:
[oneadmin@opennebula01 ~]$ ssh opennebula02
Warning: Permanently added 'opennebula02,192.168.100.107' (RSA) to the list of known hosts.
Last login: Tue Mar 19 09:03:15 2013 from opennebula01
[oneadmin@opennebula02 ~]$ exit
logout
Connection to opennebula02 closed.
**********************************************************************************
2013-04-10
CentOS/RedHat下webbench的安装
webbench网站压力测试工具,最多可以模拟3万个并发连接去测试网站的负载能力:
安装:
# yum -y install wget ctags make
# mkdir -p /usr/local/man/man1
# wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
# tar -zxvf webbench-1.5.tar.gz
# cd webbench-1.5
# make && make install
测试:
# webbench -c 5000 -t 60 http://192.168.100.234/index.php
参数说明:-c表示并发数,-t表示时间(秒)
**********************************************************************************
2013-05-10
Linux(Redhat/CentOS)安装dig命令
dig是一个用于询问 DNS 域名服务器的灵活的工具,比nslookup好用的多
安装:
# yum install bind-utils
测试:
# dig www.baidu.com
************************************************************************************
2013-07-05
LinuxU盘系统启动报错解决办法:
故障现象:
Starting udev:end_request:I/O error,dev sdb,sector 1484988
udevd-network[693]:exec of program '/lib/udev/write_net_rules' failed
Aborting jouranal on device sdb2-8.
……………………
原因:
系统启动时,缺少USB驱动程序,导致启动失败。
解决办法:
在initrd.img中加载ehci-pci.ko驱动,重新打包initrd.img,reboot。
************************************************************************************
2013-07-16
Linux系统加密分区开机解密问题处理:
故障现象:
cryptsetupluksOpen /dev/sda2 gen......
Fatal errorduring RNG initialisation.
Cannot initialize crypto RNG backend.
……………………
原因:
加载initrd执行init时缺少random和urandom。
解决办法:
在initrd.img的init中写入创建random,urandom的命令,重新打包initrd.img,reboot。
mknod /dev/random c 1 8
mknod /dev/urandom c 1 9
************************************************************************************
2013-07-29
Opennebula 4.X安装问题:
故障现象:
Mon Jul 29 17:13:46 2013 [DiM][I]: New VM state is ACTIVE.
Mon Jul 29 17:13:46 2013 [LCM][I]: New VM state is PROLOG.
Mon Jul 29 17:13:48 2013 [TM][I]: Command execution fail: /srv/cloud/one/var/remotes/tm/shared/context /srv/cloud/one/var/vms/0/context.sh node01:/srv/cloud/one/var//datastores/0/0/disk.1 0 0
Mon Jul 29 17:13:48 2013 [TM][I]: context: Generating context block device at node01:/srv/cloud/one/var//datastores/0/0/disk.1
Mon Jul 29 17:13:48 2013 [TM][E]: context: Command "genisoimage -o /srv/cloud/one/var/datastores/.isofiles/0/0.iso -V CONTEXT -J -R /srv/cloud/one/var/datastores/.isofiles/0" failed: bash: genisoimage: command not found
Mon Jul 29 17:13:48 2013 [TM][E]: Error creating iso fs
Mon Jul 29 17:13:48 2013 [TM][I]: ExitCode: 255
Mon Jul 29 17:13:48 2013 [TM][E]: Error executing image transfer script: Error creating iso fs
Mon Jul 29 17:13:48 2013 [DiM][I]: New VM state is FAILED
解决办法:
yum install genisoimage
************************************************************************************
2013-08-01
内核编译后无scsi_mod.ko解决办法:
编辑.config文件,将下面两个选项的值改为“m”,重新编译。
CONFIG_SCSI_MOD=m
CONFIG_SCSI=m
************************************************************************************
2013-08-12
Sunstone 服务启动报错解决办法:
报错信息:
Mon Aug 12 18:49:25 2013 [E]: Error initializing authentication system
Mon Aug 12 18:49:25 2013 [E]: [UserPoolInfo] User couldn't be authenticated, aborting call.
错误分析和解决:
1.验证问题,先查看.one下的one_auth是否有用户信息,也可以通过oneuser show “用户名”来现在用户信息。
2.服务状态不正常,可重启one服务,one服务启动正常,再启动sunstone服务,查看是否还有报错。
************************************************************************************
2013-08-13
Linux获取网卡驱动名称的办法
获取网卡驱动名称的前提是网卡驱动已经存在并且已经加载,可用下列命令获得:
主机一:
[root@localhost ~]# cat /var/log/dmesg |grep eth0
tg3 0000:03:00.0 eth0: Tigon3 [partno(BCM95755) rev a002] (PCI Express) MAC address 00:1b:fc:80:75:b1
tg3 0000:03:00.0 eth0: attached PHY is 5755 (10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[0])
tg3 0000:03:00.0 eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
tg3 0000:03:00.0 eth0: dma_rwctrl[76180000] dma_mask[64-bit]
主机二:
[root@udisk00 src]# cat /var/log/dmesg |grep eth0
e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) 00:1e:37:3d:6d:60
e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection
e1000e 0000:00:19.0 eth0: MAC: 7, PHY: 6, PBA No: FFFFFF-0FF
由上例子可知,tg3和e1000e为主机1和主机2网卡驱动的名称。
也可用下面的命令直接打印网卡驱动名称:
#cat /var/log/dmesg |grep eth0 |head -n 1 | awk '{print $1}'
************************************************************************************
2013-08-27
Linux NFS服务启动问题
现象:
[root@node01 ~]# service nfs restart
关闭 NFS 守护进程:[失败]
关闭 NFS mountd:[失败]
关闭 NFS 服务: [确定]
启动 NFS 服务: [确定]
启动 NFS mountd:[失败]
启动 NFS 守护进程:rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
rpc.nfsd: unable to set any sockets for nfsd
[失败]
[root@node01 ~]#
解决办法:
[root@node01 ~]# service rpcbind restart
停止 rpcbind:[失败]
正在启动 rpcbind:[确定]
[root@node01 ~]# chkconfig rpcbind on
[root@node01 ~]# service nfs restart
关闭 NFS 守护进程:[失败]
关闭 NFS mountd:[失败]
关闭 NFS 服务: [确定]
启动 NFS 服务: [确定]
启动 NFS mountd:[确定]
启动 NFS 守护进程:[确定]
[root@node01 ~]#
************************************************************************************
2013-08-27
Linux mount EXT4 NFS问题
现象:
# mount node01:/data /srv
# cd /srv
# touch text
# chown user:group text
Cannot change ownership to uid x, gid y : Invalid argument
解决办法:
1.mount成ext3格式:
# mount -t nfs -o vers=3 node01:/data /srv
2.加上UID和GID参数,如:
# tar -zxvf file.tar.gz --pax-option uid=100,gid=1000
************************************************************************************