一、安装Ubuntu
1、DVD:Ubuntu 12.04 Server版
2、分区:
490G的主分区 + 16G的SWAP(其实还能减少,服务器16G内存) + 490G空闲空间
注:490G的空闲空间用于OpenStack的Swift数据存储。同时一定要给主分区格式化,并且将boot写入。
3、安装语言,选择“English”,因为汉化不太好,尤其是到Openstack后,故直接选择英语,避免各种乱码方块出现
4、不适用代理服务器,因为本身就已经有外网IP,自身就可以连入Internet
5、选择“不使用自动更新 No auto Update”
6、只安装OpenSSH服务。
7、等待安装结束。重启,进入第二阶段。
二、安装OpenStack
1、使用putty,远程连接:
login as: localadmin
localadmin@122.xxx.144.xxx"s password:
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)
* Documentation:
https://help.u****.com/ System information as of Wed Jul 4 15:13:59 CST 2012
System load: 0.0 Processes: 109
Usage of /: 1.7% of 458.53GB Users logged in: 1
Memory usage: 0% IP address for eth0: 122.204.144.220
Swap usage: 0%
Graph this data and manage this system at
https://landscape.c*******.com/58 packages can be updated.
29 updates are security updates.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Last login: Wed Jul 4 15:08:33 2012
localadmin@server1:~$
2、现在更新系统:
localadmin@server1:~$sudo apt-get update
localadmin@server1:~$sudo apt-get upgrade
3、编辑网卡:
localadmin@server1:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 122.204.144.220
netmask 255.255.255.128
broadcast 122.204.144.255
gateway 122.204.144.129
dns-nameservers 218.104.111.114
auto eth1
iface eth1 inet static
address 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
localadmin@server1:~$
4、重启network网络服务:
localadmin@server1:~$ sudo /etc/init.d/networking restart
* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces... ssh stop/waiting
ssh start/running, process 11988
ssh stop/waiting
ssh start/running, process 12029
[ OK ]
localadmin@server1:~$
5、NTP是用来使系统和一个精确的时间源保持时间同步的协议。建议大家在自己管理的网络中建立至少一台时间服务器来同步本地时间,这样可以使得在不同的系统上处理和收集日志和管理更加容易。
建立NTP时间服务器:
localadmin@server1:~$ sudo apt-get install ntp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libcap2 libopts25
Suggested packages:
ntp-doc
The following NEW packages will be installed:
libcap2 libopts25 ntp
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 684 kB of archives.
After this operation, 1,765 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1
http://us.archive.u****.com/ubuntu/ precise/main libcap2 amd64 1:2.22-1ubuntu3 [12.0 kB]
Get:2
http://us.archive.u****.com/ubuntu/ precise/main libopts25 amd64 1:5.12-0.1ubuntu1 [59.9 kB]
Get:3
http://us.archive.u****.com/ubuntu/ precise-updates/main ntp amd64 1:4.2.6.p3+dfsg-1ubuntu3.1 [612 kB]
Fetched 684 kB in 5s (137 kB/s)
Selecting previously unselected package libcap2.
(Reading database ... 48908 files and directories currently installed.)
Unpacking libcap2 (from .../libcap2_1%3a2.22-1ubuntu3_amd64.deb) ...
Selecting previously unselected package libopts25.
Unpacking libopts25 (from .../libopts25_1%3a5.12-0.1ubuntu1_amd64.deb) ...
Selecting previously unselected package ntp.
Unpacking ntp (from .../ntp_1%3a4.2.6.p3+dfsg-1ubuntu3.1_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up libcap2 (1:2.22-1ubuntu3) ...
Setting up libopts25 (1:5.12-0.1ubuntu1) ...
Setting up ntp (1:4.2.6.p3+dfsg-1ubuntu3.1) ...
* Starting NTP server ntpd [ OK ]
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
6、修改NTP服务器配置文件:
localadmin@server1:~$ sudo vi /etc/ntp.conf
localadmin@server1:~$ cat /etc/ntp.conf
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See
http://www.pool.ntp.org/join.html for
# more information.
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
# Use Ubuntu"s ntp server as a fallback.
server ntp.u****.com
server 127.127.1.0
fudge 127.127.1.0
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <
http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don"t allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
localadmin@server1:~$
7、重启NTP服务:
localadmin@server1:~$ sudo service ntp restart
* Stopping NTP server ntpd [ OK ]
* Starting NTP server ntpd [ OK ]
localadmin@server1:~$
8、安装mysql-server:
localadmin@server1:~$ sudo apt-get install mysql-server python-mysqldb
在接下来的root密码确认中,本例输入了两次“123456”
然后修改mysql的bind-address,将其改成0.0.0.0,并重启mysql服务。
localadmin@server1:~$ sudo vi /etc/mysql/m.cnf
localadmin@server1:~$ sodo service mysql restart