Quantcast
Channel: LinE's Blog
Viewing all articles
Browse latest Browse all 25

OpenStack部署小记-存储节点

$
0
0

基础部署

1.IP地址设置

首先将系统安装完成,然后按照架构设置中配置存储节点的网卡
编辑 /etc/network/interfaces
写入如下内容

vi /etc/network/interfaces

auto eth0
iface eth0 inet static
        address 10.0.1.20
        netmask 255.255.255.0

auto eth1
iface eth1 inet static
        address 10.0.2.20
        netmask 255.255.255.0

auto eth2
iface eth2 inet static
        address 10.0.3.20
        netmask 255.255.255.0

auto eth3
iface eth3 inet static
        address 192.168.100.20
        netmask 255.255.255.0
        gateway 192.168.100.2

然后重启网络,并启用网卡

service network restart
ifup eth0
ifup eth1
ifup eth2
ifup eth3

查看网卡配置是否正确

ifconfig eth0
ifoonfig eth1
ifoonfig eth2
ifoonfig eth3


2.设置HOSTS

将四个节点的主机名分别写入到/etc/hosts中

rm -rfv /etc/hosts
echo "127.0.0.1       localhost"  >> /etc/hosts
echo "10.0.1.10       controller" >> /etc/hosts
echo "10.0.1.20       compute"    >> /etc/hosts
echo "10.0.1.30       network"    >> /etc/hosts
echo "10.0.1.40       storage"    >> /etc/hosts

3.设置DNS

这里使用114的DNS,将DNS写入到/etc/resolv.conf中

echo "nameserver 114.114.114.114" >> /etc/resolv.conf

4.测试网络连通性

依次Ping 四个节点以及百度,测试外网是否通畅

ping -c 2 controller|grep "64 bytes from"
ping -c 2 compute|grep "64 bytes from"
ping -c 2 network|grep "64 bytes from"
ping -c 2 storage|grep "64 bytes from"
ping -c 2 www.baidu.com|grep "64 bytes from"

5.升级系统

更新软件源,升级系统

apt-get update
apt-get upgrade

6.安装 NTP 时间同步

apt-get -y install ntp

删除/var/lib/ntp/ntp.conf.dhcp

rm -rfv /var/lib/ntp/ntp.conf.dhcp

编辑/etc/ntp.conf
删除里面的所有server
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
ntp.ubuntu.com
新加一个server指向controller

sed -i 's/server 0.ubuntu.pool.ntp.org//g' /etc/ntp.conf
sed -i 's/server 1.ubuntu.pool.ntp.org//g' /etc/ntp.conf
sed -i 's/server 2.ubuntu.pool.ntp.org//g' /etc/ntp.conf
sed -i 's/server 3.ubuntu.pool.ntp.org//g' /etc/ntp.conf
sed -i "s/server ntp.ubuntu.com/server controller iburst/g" /etc/ntp.conf

重新启动ntp服务

service ntp restart

7.配置 OpenStack 安装包源

安装Openstack的密钥环

apt-get -y install ubuntu-cloud-keyring

添加Openstack Kilo版本的安装源

echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu" "trusty-updates/kilo main">/etc/apt/sources.list.d/cloudarchive-kilo.list

这里因为openstack的官方源速度太酸爽,所以我花了一天时间把这个源的amd64版本全部同步下来了,在本地开启一个HTTP服务,将ubuntu-cloud.archive.canonical.com.tar.gz解开,放置到Web根目录下,在节点上的HOSTS里写入域名指向即可
打包下载地址:http://pan.baidu.com/s/118iEa 密码: 9hmd

echo "10.0.1.200       ubuntu-cloud.archive.canonical.com"    >> /etc/hosts

更新源,然后升级系统

apt-get -y update
apt-get -y dist-upgrade

至此,基础服务部署完成

块存储服务 Cinder

对象存储服务 Swift


Viewing all articles
Browse latest Browse all 25

Trending Articles