OpenStack Mitaka版本手动搭建

一、基础环境配置

双节点搭建,虚拟机初始化


文章目录

    • 一、基础环境配置
      • 双节点搭建,虚拟机初始化
  • 初始化配置
  • 一、CentOS系统初始化
  • 二、进入系统,配置
  • 数据库的安装与配置
  • 一、安装Mairadb
  • 二 、安装Nomysql


初始化配置


一、CentOS系统初始化

  1. 磁盘,去除home分区,将大部分空间给“/” 根目录

  2. KDUMP取消勾选

  3. 网卡手动配置IP地址
    controller节点 ens33 10.131.192.101 gateway10.131.192.254
    ens3410.131.193.101 gateway 10.131.193.254
    compute节点 ens33 10.131.192.201 gateway 10.131.192.254
    ens3410.131.193.201 gateway 10.131.193.254

  4. 配置root密码

  5. 进入系统,修改网卡配置为static,onboot=yes;

  6. 以controler虚拟机为模板克隆虚拟机 compute,并为其添加两个10GB硬盘;进入系统后,修改其网卡IP地址。

二、进入系统,配置

  1. 关闭防火墙,关闭防火墙自启,设置SeLinux模块为Permission,删除原有在线源
    #systemctl stop firewalld;systemctl disable firewalld;setenforce 0;rm -rf /etc/yum.repos.d/*

  2. 配置本地yum源,由于在线yum源已不支持Mitaka版本,因此需要手动配置yum包;删除在线源文件
    将Mitaka.ISO包,操作系统镜像包上传至/root;

#vim /etc/yum.repos.d/local.repo
[centos]
name=centos
gpgcheck=0
enabled=1
baseurl=file:///opt/centos
[Mitaka]
name=mitaka
gpgcheck=0
enabled=1
baseurl=file:///opt/mitaka/Openstack-Mitaka

Compute节点
[centos]
name=centos
gpgcheck=0
enabled=1
baseurl=file:///opt/centos
[Mitaka]
name=mitaka
gpgcheck=0
enabled=1
baseurl=file:///opt/mitaka/Openstack-Mitaka
  1. 修改主机名

    [root@controller ~]# hostnamectl set-hostname controller
    [root@compute ~]# hostnamectl set-hostname compute

  2. 修改域名解析(Controller 和 Compute节点都需要设置)

	[root@Controller ~]# vi /etc/hosts
	127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
	::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
	10.131.192.100 Contronller
	10.131.192.200 Compute
	
	[root@Compute ~]# vi /etc/hosts
	127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
	::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
	10.131.192.100 Contronller
	10.131.192.200 Compute
  1. Contronller节点启动Vsftpd服务
	yum -y install vsftpd   
	[root@Controller ~]# vim /etc/vsftpd/vsftpd.conf
	添加
	anon_root=/opt
	启动:systemctl start vsftpd;systemctl enable vsftpd
  1. contronller节点和compute节点 安装OpenStack包
    [root@OpenStack-Contronller ~]# yum -y install openstack-utils.noarch openstack-selinux.noarch python-openstackclient.noarch

  2. 设置NTP时间同步服务器以及时间同步
    vi /etc/ntp.conf
    server 127.127.1.0
    fudge 127.127.1.0 stratum 10 这行是时间服务器的层次。设为0则为顶级,如果要向别的NTP服务器更新时间,请不要把它设为0


数据库的安装与配置


一、安装Mairadb

  1. 安全并配置组件

    yum -y install mariadb mariadb-server python2-PyMySQL
    #编辑配置文件
    #vim /etc/my.cnf
    在[mysqld]下添加如下内容

    bind-address = 10.131.192.100
	default-storage-engine = innodb
	innodb_file_per_table
	max_connections = 4096
	collation-server = utf8_general_ci
	character-set-server = utf8

2.设置mariadb启动与开机启动

#systemctl start mariadb
#systemctl enable mariadb

3.运行“mysql_secure_installation”脚本,为root用户设置密码

[root@controller ~]# mysql_secure_installation 
	Enter current password for root (enter for none):   #这句话直接回车
	Set root password? [Y/n]       选择Y,然后设置数据库密码  这里设置000000
	Remove anonymous users? [Y/n]     选择Y
	Disallow root login remotely? [Y/n]    选择N
	Remove test database and access to it? [Y/n]    选择Y
	Reload privilege tables now? [Y/n]    选择Y

4.登陆数据库认证

[root@OpenStack-Contronller ~]# mysql -uroot -p000000
	Welcome to the MariaDB monitor.  Commands end with ; or \g.
	Your MariaDB connection id is 10
	Server version: 10.1.12-MariaDB MariaDB Server
	Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
	Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
	MariaDB [(none)]> select * from 
	    -> ;
	ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
	MariaDB [(none)]> exit
	Bye

二 、安装Nomysql

  1. 安装MongoDB包并编辑文件:
   # yum install mongodb-server mongodb
	编辑配置文件
	#vi /etc/mongod.conf
	修改bind_ip = 10.131.192.100     #bind_ip 使用控制节点管理网卡的IP地址
	修改smallfiles = true
  1. 启动MongoDB 并配置它随系统启动:
# systemctl enable mongod.service
# systemctl start mongod.service

3.安装并配置(RabbitMQ)消息队列服务器、安装RabbitMQ服务

#yum -y install rabbitmq-server 
启动并设置开机启动
#systemctl start rabbitmq-server
#systemctl enable rabbitmq-server
添加Openstack用户并设置密码
#rabbitmqctl add_user openstack 000000    #此处六个零为密码,可自行更改
给openstack用户权限 : 配置 写  读  三个权限
[root@controller ~]# rabbitmqctl set_permissions openstack '.*' '.*' '.*'

4.添加Openstack用户并设置密码

#rabbitmqctl add_user openstack 000000    #此处六个零为密码,可自行更改

5.给openstack用户权限 : 配置 写 读 三个权限

[root@controller ~]# rabbitmqctl set_permissions openstack '.*' '.*' '.*'
  1. 安装memcached缓存服务
#yum -y install memcached python-memcached
启动并设置开机启动
#systemctl start memcached
#systemctl enable memcached

你可能感兴趣的:(解决问题,centos,运维)