openstack(一)环境布署

openstack项目搭建:
一、环境布署
二、配置keystone服务
三、配置glance服务
四、配置placement服务
五、配置nova服务控制节点
六、配置nova服务计算节点
七、配置neutron服务控制节点
八、配置neutron服务计算节点
九、建立实例
十、配置dashboard服务python


openstack项目搭建

在这里插入图片描述

图中数字,如10,表示ip:192.168.99.10mysql


全部服务器配置

控制端:
内存:5G
vcpu:4
计算节点:
内存:2G
vcpu:2linux

  1. 准备yum源:/etc/yum.repos.d/openstack.repo
yum -y install centos-release-openstack-stein
  1. 安装openstack客户端、openstack SELinux管理包
yum -y install python-openstackclient openstack-selinux

1、控制端: 101

  1. 安装
yum -y install python2-PyMySQL mariadb

2、数据库106:配置SQL数据库

  1. 安装组件
yum -y install  mariadb mariadb-server
  1. 配置/etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.99.116
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
  1. 启动数据库和设置开机启动
systemctl enable mariadb.service
systemctl start mariadb.service
  1. 经过运行脚原本保护数据库服务
mysql_secure_installation

3、数据库106:配置Memcached

  1. 安装包:
yum -y install memcached python-memcached
  1. 编辑/etc/sysconfig/memcached文件
    配置服务以使用控制器节点的管理IP地址。这是为了经过网络访问其余节点:
OPTIONS="-l 192.168.99.116"
  1. 启动Memcached服务并将其配置为在系统引导时启动:
systemctl enable memcached.service
systemctl start memcached.service

4、ha_102:配置haproxy+keepalived

ha_1和ha_2都要配置web

  1. 安装keepalived和haproxy
yum -y install keepalived haproxy
  1. 配置master_keepalived
vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
    advert_int 1
unicast_src_ip 192.168.99.112
unicast_peer {
        192.168.99.113
}
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.99.100 dev eth0 label eth0:1
    }
}
  1. 启动
systemctl start keepalived
systemctl enable keepalived
  1. haproxy配置
global
    log         127.0.0.1 local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4000
    user        haproxy
    group       haproxy
    daemon

    stats socket /var/lib/haproxy/stats

defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 3000

listen stats
        mode http
        bind :9999
        stats enable
        log global
        stats uri /haproxy-status
        stats auth admin:123
listen dashboard
        bind :80
        mode http
        balance source
        server dashboard 192.168.99.116:80 check inter 2000 fall 3 rise 5
listen mysql
        bind :3306
        mode tcp
        balance source
        server mysql 192.168.99.116:3306 check inter 2000 fall 3 rise 5
        
listen memcached
        bind :11211
        mode tcp
        balance source
        server memcached 192.168.99.116:11211 inter 2000 fall 3 rise 5
        
listen rabbit
        bind :5672
        mode tcp
        balance source
        server rabbit 192.168.99.116:5672 inter 2000 fall 3 rise 5
        
listen rabbit_web
        bind :15672
        mode http
        server rabbit_web 192.168.99.116:15672 inter 2000 fall 3 rise 5

启动redis

systemctl restart haproxy
systemctl enable haproxy
  1. 配置内核参数
echo "net.ipv4.ip_nonlocal_bind=1" >> /etc/sysctl.conf
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p

5、数据库106:安装rabbit-MQ

567二、15672端口
7. 安装sql

yum -y install rabbitmq-server
  1. 启动(端口5672)
systemctl enable rabbitmq-server
systemctl start rabbitmq-server
  1. 添加用户和密码
rabbitmqctl add_user openstack 123
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
  1. 打开web插件(端口15672)
rabbitmq-plugins enable rabbitmq_management
  1. 查看插件
rabbitmq-plugins list
  1. 验证:有openstack这个用户
[mysql]$ rabbitmqctl list_users
Listing users
openstack       []
guest   [administrator]
  1. web访问端口15672,用户密码都是guest

在这里插入图片描述

在这里插入图片描述


openstack项目搭建:

一、环境布署
二、配置keystone服务
三、配置glance服务
四、配置placement服务
五、配置nova服务控制节点
六、配置nova服务计算节点
七、配置neutron服务控制节点
八、配置neutron服务计算节点
九、建立实例
十、配置dashboard服务数据库