Chinaunix首页 | 论坛 | 博客
  • 博客访问: 268839
  • 博文数量: 78
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 852
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-06 11:01
个人简介

不做第二个别人,永远做第一个自己。

文章分类

全部博文(78)

文章存档

2014年(60)

2013年(18)

分类: 云计算

2014-04-10 11:02:32

环境介绍:
服务器1:allinone(198)
服务器2:compute(197)
问题描述:
在allinone服务器上创建的instance resize都能成功;
但是在compute上的instance resize的时候报错!
Command:ssh 192.168.1.197mkdir -p /var/lib/nova/instances/eac03362-352f-45ad-b803-d28e988691be
Exit code: 255
Stdout: ”
Stderr: ‘Host key verification failed.\r\n’. Setting instance vm_state to ERROR

在所有计算节点上让nova用户有bash环境:
#usermod -s /bin/bash nova
在compute(197)上操作,切换到nova用户下;
#su nova
#cd —切换用户后默认是在/root目录,需要回到nova自己的根目录下;
然后利用ssh-keygen来创建公钥和私钥;
#ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/var/lib/nova/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/lib/nova/.ssh/id_rsa.
Your public key has been saved in /var/lib/nova/.ssh/id_rsa.pub.
The key fingerprint is:
d7:eb:e1:c1:10:23:ab:9b:cd:0a:fc:5a:ea:00:50:1d nova@NOVA1
The key’s randomart image is:
+–[ RSA 2048]—-+
| ..E. |
| . . |
|. . o |
|. o + |
|. S o . |
| . . . . o . |
| . o o = |
| . = = o o |
| .+.=.o o |
+—————–+
$ ls /var/lib/nova/.ssh/
id_rsa id_rsa.pub 一个私钥;一个公钥
$ cp id_rsa.pub authorized_keys
然后把id_rsa和authorized_keys拷贝到其它计算节点上(198)!
$ scp /var/lib/nova/.ssh/id_rsa root@192.168.1.198:/var/lib/nova/.ssh/id_rsa
$ scp /var/lib/nova/.ssh/authorized_keys root@192.168.1.198:/var/lib/nova/.ssh/authorized_keys
在198上验证是否能登陆:
# chown nova:nova /var/lib/nova/.ssh/id_rsa /var/lib/nova/.
ssh/authorized_keys
切换nova用户!
# su nova
$ ssh 192.168.1.197
The authenticity of host ’192.168.1.197 (192.168.1.197)’ can’t be established.
RSA key fingerprint is da:ba:23:dd:8a:a1:de:f3:0c:66:ce:fd:48:2b:2c:e3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ’192.168.1.197′ (RSA) to the list of known hosts.
Last login: Fri Dec 20 16:56:01 2013 from 192.168.1.198
-bash-4.1$ exit
logout
Connection to 192.168.1.197 closed.
再回到控制台,更改compute上的instance,就不会报错了!

阅读(617) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~