zoukankan      html  css  js  c++  java
  • openstack基础环境

    主机环境:

    centos7.5

    ip:192.168.2.11

    修改主机名,修改后主机名不得再更改

    yum install chrony -y (控制节点和计算节点都要装)
    编辑 vi /etc/chrony.conf 文件,按照你环境的要求,对下面的键进行添加,修改或者删除:
    #allow 192.168.0.0/16 #删除
    server NTP_SERVER iburst #增加

    设置开机自启动并启动chronyd

    systemctl start chronyd
    systemctl enable chronyd

    设置时区为亚洲上海
    timedatectl set-timezone Asia/Shanghai
    chronyc sources

    安装openstack源
    yum install -y centos-release-openstack-pike

    安装mariadb和python2-PyMySQL

    yum install -y mariadb mariadb-server python2-PyMySQL

    vim /etc/my.cnf.d/openstack.cnf
    [mysqld]
    bind-address = 192.168.2.11
    default-storage-engine = innodb
    innodb_file_per_table = on
    max_connections = 4096
    collation-server = utf8_general_ci
    character-set-server = utf8

    设置开机自启动并启动mysql

    systemctl enable mariadb
    systemctl start mariadb

    数据库初始化:mysql_secure_installation(密码123123)

    创建数据库并授权
    MariaDB [(none)]> create database keystone;
    Query OK, 1 row affected (0.01 sec)

    MariaDB [(none)]> create database nova;
    Query OK, 1 row affected (0.01 sec)

    MariaDB [(none)]> create database glance;
    Query OK, 1 row affected (0.00 sec)

    MariaDB [(none)]> create database neutron;
    Query OK, 1 row affected (0.00 sec)

    MariaDB [(none)]> create database cinder;
    Query OK, 1 row affected (0.00 sec)

    MariaDB [(none)]> create database nova_api;
    Query OK, 1 row affected (0.00 sec)

    MariaDB [(none)]> grant all on nova.* to 'nova'@'localhost' identified by 'nova';
    Query OK, 0 rows affected (0.01 sec)

    MariaDB [(none)]> grant all on nova.* to 'nova'@'%' identified by 'nova';
    Query OK, 0 rows affected (0.01 sec)

    MariaDB [(none)]> grant all on nova_api.* to 'nova'@'localhost' identified by 'nova';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on nova_api.* to 'nova'@'%' identified by 'nova';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on keystone.* to 'keystone'@'%' identified by 'keystone';
    Query OK, 0 rows affected (0.01 sec)

    MariaDB [(none)]> grant all on keystone.* to 'keystone'@'localhost' identified by 'keystone';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on glance.* to 'glance'@'localhost' identified by 'glance';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on glance.* to 'glance'@'%' identified by 'glance';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on neutron.* to 'neutron'@'localhost' identified by 'neutron';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on neutron.* to 'neutron'@'%' identified by 'neutron';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on cinder.* to 'cinder'@'localhost' identified by 'cinder';
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> grant all on cinder.* to 'cinder'@'%' identified by 'cinder';
    Query OK, 0 rows affected (0.00 sec)

    测试:
    mysql -ucinder -pcinder
    show databases;

    ##memcache安装(控制节点)
    yum install -y memcached python-memcached
    memcache更改如下vi /etc/sysconfig/memcached
    OPTIONS="-l 127.0.0.1,::1 改为 OPTIONS="-l 192.168.2.11,::1
    systemctl start memcached
    systemctl enable memcached

    ##RabbitMQ (控制节点)
    yum install -y rabbitmq-server
    systemctl enable rabbitmq-server
    systemctl start rabbitmq-server
    lsof -i:5672
    rabbitmqctl add_user openstack openstack
    rabbitmqctl set_permissions openstack ".*" ".*" ".*"
    rabbitmq-plugins list
    rabbitmq-plugins enable rabbitmq_management
    systemctl restart rabbitmq-server
    #登录rabbitmq WEB管理界面
    http://192.168.2.11:15672
    帐号:guest 密码:guest

  • 相关阅读:
    寒假学习5流程控制之ifelse与for循环
    寒假学习4scala数据类型与运算符
    寒假学习13
    寒假学习14
    寒假学习3scala简介与基础1
    sqlserver 定时自动备份
    windows mysql 主从同步
    mysql 连接数 最大并发数
    mysql基础语法
    sqlserver 常见语法
  • 原文地址:https://www.cnblogs.com/liuhui-xzz/p/9891305.html
Copyright © 2011-2022 走看看