安装openstack
) T2 z% `8 b$ G7 O/ A# Kyum install -y centos-release-openstack-newton
% z' s6 S5 w5 g; H& P3 ?yum update -y3 J5 x9 e) c5 d# C6 O5 u
yum install -y openstack-packstack
( `& D! |& `* r1 ?8 w+ `* O4 Wpackstack --gen-answer-file=answer.txt) s: ]8 ]/ b( Y& l7 q3 a$ W
#vim answer.txt 可以编辑配置文件(对云计算构架的项目选择修改密码) 也可以不修改* h4 U% s3 \3 u* q J
CONFIG_NTP_SERVERS=192.168.0.254
/ f' [% L# Y$ I CONFIG_KEYSTONE_ADMIN_PW=xxbandy
1 a0 A' F" E z7 \( k3 t% W
* [, k& G# h, I9 xpackstack --answer-file=answer.txt: Q) S: u8 L$ _9 i- t# y. B
安装过程,有可能因为源的原因中断,你可以重复运行上一句。
, F( A1 s: t, {! f- F
6 [( h! Q) \! N/ C' P9 {1 s& P- f[root@localhost runcore]# packstack --gen-answer-file=answer.txt & v* m9 a% k* Q; O, T- |
[root@localhost runcore]# packstack --answer-file=answer.txt9 G3 f+ v1 S2 Z) N
Welcome to the Packstack setup utility
' B$ f+ ? q4 u5 S- t. W/ ]1 A
. v$ k# Q! b nThe installation log file is available at: /var/tmp/packstack/20161230-102423-2sGXEN/openstack-setup.log7 z9 \1 m$ F% Z4 s$ Z+ O
, v/ y3 ?" _: ~+ O( K8 q& eInstalling:* Q0 S, e$ l! A5 x0 ^1 D
Clean Up [ DONE ]* U2 o/ X0 v& z7 G- w' L. X% b- ?
Discovering ip protocol version [ DONE ]$ Z* G( p7 P2 y; [
Setting up ssh keys [ DONE ]& q, f; }; s& B+ p
Preparing servers [ DONE ]
2 F1 r. O& e, b: |! UPre installing Puppet and discovering hosts' details[ ERROR ]
" j2 [0 A3 l% B% v# K V, x- @- D { A' G# n# h4 V( K x% C6 n9 ?
ERROR : Failed to run remote script, stdout: Loaded plugins: fastestmirror, langpacks
- N0 b. r. p3 s& C" P8 w6 E7 hCould not retrieve mirrorlist http://mirrorlist.centos.org/?re ... =os&infra=stock error was
( L4 ^! m9 [, B l2 r+ z' {9 s4 Y12: Timeout on http://mirrorlist.centos.org/?re ... os&infra=stock: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')' n6 [& l+ j3 t6 U- \2 c! n" W
+ O F0 y# n. }; K ]1 h% Rstderr: Warning: Permanently added '192.168.0.163' (ECDSA) to the list of known hosts.
' y! L6 X+ y4 w3 D+ trap t ERR8 w1 y7 M- d8 K% _3 \
+ yum install -y puppet hiera openssh-clients tar nc rubygem-json( q8 M; F2 _! }5 S; A" O# B0 n
% {0 L3 j: v! w: m) L/ v0 N) C9 s) m! k
One of the configured repositories failed (Unknown),
9 _/ V/ C3 i9 ]6 w; G& |* J and yum doesn't have enough cached data to continue. At this point the only8 x5 D. [' e* w0 M8 q% y# t
safe thing yum can do is fail. There are a few ways to work "fix" this:
8 f7 v2 P+ Q0 @0 ]% [4 K1 t$ K: O7 i. q8 Q/ Y) O
1. Contact the upstream for the repository and get them to fix the problem.
" H7 Z- U8 j# n* p; M, }: m, _9 T4 y- z5 D" j+ [
2. Reconfigure the baseurl/etc. for the repository, to point to a working
W# W# O7 q% z" ` upstream. This is most often useful if you are using a newer9 R }9 f7 }3 ?/ I. Y' M
distribution release than is supported by the repository (and the
# h' e. g! D* ^8 Y4 V# k packages for the previous distribution release still work). i7 p, d( M9 h# k' C% k
+ G- H j& u3 Y' U; l# g+ i 3. Run the command with the repository temporarily disabled
! E( U* H! D, v- Y0 H yum --disablerepo=<repoid> ...) ?" ?; ^$ [- q, a
' Q2 M3 L# [9 b! n: Q& J
4. Disable the repository permanently, so yum won't use it by default. Yum
% D# Z& h4 C% V5 Z8 H) C will then just ignore the repository until you permanently enable it
6 j0 u4 M# b5 c( f# v again or use --enablerepo for temporary usage:4 M) V6 A. G8 m; \2 g
2 z2 x; H+ T- _ o+ z0 f1 _2 o
yum-config-manager --disable <repoid>( t& V. m1 Y% _+ ?3 s- y' }
or( @* b: y/ ?4 M
subscription-manager repos --disable=<repoid>
" K9 u, \4 X7 E. {1 a/ q' D6 d6 D9 K; S% H, O. _ y
5. Configure the failing repository to be skipped, if it is unavailable." V( r4 L; [- q- X0 m) o
Note that yum will try to contact the repo. when it runs most commands,
% m) {. Q3 a: R" \; q" ^% V: G# z so will have to try and fail each time (and thus. yum will be be much2 ]9 P, W8 `3 j) u0 a
slower). If it is a very temporary problem though, this is often a nice
8 e) E4 X& U7 J' n8 f$ Z& Z compromise:
9 a* L' C& A. Q' q# ]: U! ?
- z( N0 |0 m5 e2 _( \4 F+ T2 a yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
/ M9 J! D% q& S* Y: B7 G9 s z" x R+ x# n$ l5 j
Cannot find a valid baseurl for repo: base/7/x86_643 ~$ f+ ?% w5 y1 c6 Q% e
++ t1 _) |/ s. ?, q' x4 m0 r7 ^7 \
++ exit 1" g7 D" T& _( x A
. z) ^+ F5 d( _+ q* w. z: B6 G8 ~Please check log file /var/tmp/packstack/20161230-102423-2sGXEN/openstack-setup.log for more information9 R$ Y, i+ \1 V: x5 O* s
Additional information:
: _3 O2 Z% ]( ` * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
& J- G- ]# [ ^# Y, ?) v######------------------------------------------------############----------------------------------------------; s6 P% Y+ |4 e% m/ Q5 e
##注释:使用应答文件安装,出现上述错误。先是修改了hostname和hosts文件,然后运行,还是错误。第二步按照错误的提示内容执行yum install -y puppet hiera openssh-clients tar nc rubygem-json。再运行应答文件即通过了!) F8 z' }6 O9 z8 q5 m
* ~4 ]* {4 S* r6 |& @5 r3 c[root@localhost runcore]# vi /etc/hostname # {. T/ F- y% l/ c/ H
[root@localhost runcore]# vi /etc/hosts
6 t4 R1 Y* E/ W* k3 f, p[root@localhost runcore]# packstack --answer-file=answer.txt# |; W. D/ a) U( J! Z3 v' ~) ]
[root@localhost runcore]# yum install -y puppet hiera openssh-clients tar nc rubygem-json$ O5 V6 }7 J+ ` b, Y' Y7 P
已加载插件:fastestmirror, langpacks& q/ [+ d1 Q* `
base | 3.6 kB 00:00:00
+ q. @9 v4 o7 ~: m0 icentos-ceph-jewel | 2.9 kB 00:00:00
5 D2 W- Q7 {& o+ V$ s6 N! Bcentos-openstack-newton | 2.9 kB 00:00:00
# f3 [1 _* u+ k3 r7 B7 ?centos-qemu-ev | 2.9 kB 00:00:00 / @' f" s$ P. M }& m
extras | 3.4 kB 00:00:00
- z) H! y. |, L9 O2 d0 `updates | 3.4 kB 00:00:00
7 z2 E0 ^ l7 H$ \4 m& X(1/7): centos-qemu-ev/7/x86_64/primary_db | 47 kB 00:00:01
! P7 w( @; z& m* `9 W- @(2/7): base/7/x86_64/group_gz | 155 kB 00:00:01
- u/ Y8 r% k7 g4 ]2 Y9 p) V) O(3/7): centos-ceph-jewel/7/x86_64/primary_db | 41 kB 00:00:02 / R( V" ~$ o( a- z* U5 I
(4/7): extras/7/x86_64/primary_db | 183 kB 00:00:00 4 ?: y- y- @ N
(5/7): updates/7/x86_64/primary_db | 1.2 MB 00:00:06 3 ` Z% g0 j) |! m7 p
(6/7): centos-openstack-newton/x86_64/primary_db | 671 kB 00:00:27
) ~( _5 \( Z% Q4 O(7/7): base/7/x86_64/primary_db | 5.6 MB 00:00:39 3 U* f/ P4 h! |7 w& q
Loading mirror speeds from cached hostfile
o+ ^2 d* J$ Y, _/ W7 H * base: mirrors.yun-idc.com4 w) p# r( g4 ~. w3 Q
* extras: mirrors.yun-idc.com
0 r% y# c8 ~8 _0 i * updates: mirrors.163.com# f- q- B x* R3 B
软件包 puppet-3.8.7-2.el7.noarch 已安装并且是最新版本+ w% b! Z; K& V' i
软件包 1:hiera-1.3.4-5.el7.noarch 已安装并且是最新版本9 q# i3 K- q! F" }6 {, c p
软件包 openssh-clients-6.6.1p1-31.el7.x86_64 已安装并且是最新版本% n, n9 a4 f6 R/ Q9 ~5 j z
软件包 2:tar-1.26-31.el7.x86_64 已安装并且是最新版本
' @: {4 D; i& q% c+ p; g; U软件包 2:nmap-ncat-6.40-7.el7.x86_64 已安装并且是最新版本7 ~& i0 K/ Q0 m, r
软件包 rubygem-json-1.7.7-29.el7.x86_64 已安装并且是最新版本
6 C, R. g: E! d1 Q2 m+ }无须任何处理
$ r* J, i2 m3 t7 E/ q! F6 f[root@localhost runcore]# packstack --answer-file=answer.txt9 ^* Q/ ^( c: B9 d8 C4 a3 @0 y
o: b: r. ]0 Q5 _. V#查看账户密码$ }" m6 U3 }. W# J9 m
cat /etc/nagios/keystonerc_admin
# M" g6 L9 }! H# J$ K8 x! n( g9 ]6 Z' m( U' U
安装KVM g$ w0 |9 W" _1 A( Y
#1安装kvm
( ^- ~4 [( e8 B0 J- a" qyum -y install qemu-kvm libvirt virt-install bridge-utils
+ r& {7 h. S! Q8 O4 }; C; A#2查看是否安装4 |9 e- C X' X1 ?4 H2 f
lsmod | grep kvm
8 \, i" F2 w* x+ y" p#3
/ B0 R n& G5 Asystemctl start libvirtd
4 o3 X2 X3 M0 g, I' [systemctl enable libvirtd, g* o7 d$ ]. ~5 @- z$ m- h
#0 W- J" h1 b8 @( ?, J6 s+ @
安装virt-manager
) o- V" B) f4 e) Nyum install virt-manager
1 y& C) }* c. p/ `! r; |+ r+ u |