Openstack:Q版--ubuntu16.04

2018-07-24  本文已影响0人  早点睡可以吗

Openstack:Queen 版安装(两个节点)

本文所有密码均为111,可以根据需要自己更改

基础环境搭建

1.环境设置

10.0.0.11 controller(2vCPU、4G内存、20G存储、双网卡)
10.0.0.31 compute(1vCPU、2G内存、20G存储、双网卡)

更换apt源:

cp /etc/apt/sources.list /etc/apt/sources.list.backup
vim /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

sudo apt-get update

2.Network Time Protocol (NTP)

Controller node

安装NTP服务

# apt install chrony

编辑/etc/chrony/chrony.conf:

server NTP_SERVER iburst

allow 10.0.0.0/24

替换NTP_SERVER和10.0.0.0/24为你需要的内容。

重启NTP服务:

# service chrony restart

Other nodes

安装NTP服务

# apt install chrony

编辑/etc/chrony/chrony.conf:

server controller iburst

注释掉pool 2.debian.pool.ntp.org offline iburst

重启NTP服务:

# service chrony restart

验证:

#chronyc sources

3.OpenStack packages(所有节点)

启用OpenStack Queens库:

# apt install software-properties-common
# add-apt-repository cloud-archive:queens
1.升级节点上的软件包:

# apt update && apt dist-upgrade

2.安装 OpenStack 客户端:

# apt install python-openstackclient

4.安装SQL数据库

1.安装软件包:

# apt install mariadb-server python-pymysql

2.创建和编辑/etc/mysql/mariadb.conf.d/99-openstack.cnf文件

[mysqld]
bind-address = 10.0.0.11

default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

3.重启数据库服务:

# service mysql restart

4.通过运行mysql_secure_installation脚本来保护数据库服务的安全。特别是, 为数据库root帐户选择合适的密码:

# mysql_secure_installation

4.安装Message queue

1.安装软件包:

# apt install rabbitmq-server

2.添加openstak用户:

# rabbitmqctl add_user openstack 111

Creating user "openstack" ...

3.允许openstack用户进行配置、写入和读取访问:

# rabbitmqctl set_permissions openstack ".*" ".*" ".*"

Setting permissions for user "openstack" in vhost "/" ...

5.配置Memcached

1.安装软件包:

# apt install memcached python-memcache

2.编辑/etc/memcached.conf文件, 并将服务配置为使用控制器节点的管理 IP 地址。这是通过管理网络启用其他节点的访问:

-l 10.0.0.11

注意:更改已有-l 127.0.0.1的现有行.

3.重新启动 Memcached 服务:

# service memcached restart

6.Etcd

1.安装软件包:

# apt install etcd

2.编辑 /etc/etcd/etcd.conf.yml 文件并且使用管理IP设置initial-cluster, initial-advertise-peer-urls, advertise-client-urls, listen-client-urls:

name: controller
data-dir: /var/lib/etcd
initial-cluster-state: 'new'
initial-cluster-token: 'etcd-cluster-01'
initial-cluster: controller=http://10.0.0.11:2380
initial-advertise-peer-urls: http://10.0.0.11:2380
advertise-client-urls: http://10.0.0.11:2379
listen-peer-urls: http://0.0.0.0:2380
listen-client-urls: http://10.0.0.11:2379

3.创建并且编辑/lib/systemd/system/etcd.service 文件:

[Unit]
After=network.target
Description=etcd - highly-available key value store

[Service]
LimitNOFILE=65536
Restart=on-failure
Type=notify
ExecStart=/usr/bin/etcd --config-file /etc/etcd/etcd.conf.yml
User=etcd

[Install]
WantedBy=multi-user.target

4.重启服务:

# systemctl enable etcd
# systemctl start etcd

安装服务组件

Keystone-Identity service

Glance-Image service

nova-Compute service

neutron-Networking service

Dashboard

Block Storage service

由于比较懒,后面的不想整理了。。。

请参阅官方文档进行后续安装。:

本人知识能力也有限,难免出现理解错误的地方。欢迎指正和交流。

上一篇下一篇

猜你喜欢

热点阅读