Openstack组建部署 — Environment of Controller Node

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介: 目录目录前文列表Controller NodeInstall and configure componentsSetup DNS ServerSetup NTP ServerInstall SQL DatabaseSetup Message queue...

目录

前文列表

Controller Node

控制节点是整个Openstack控制枢纽,可以将Database、Message queue、DNS、NTP、Keystone等服务集成到一起,当然Openstack实现了松耦合的架构思想,因此所有的组件都可以在任意Node中安装组合,视乎实际情况而定。

Install and configure components

Setup DNS Server

step1.

yum install -y bind bind-chroot

**Step2.**Edit the config file.

[root@controller ~]# cat /etc/named.conf | grep -v ^# | grep -v ^// | grep -v ^$
options {
    directory   "/var/named";
    dump-file   "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { any; };
    recursion yes;
    dnssec-enable yes;
    dnssec-validation yes;
    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";
    managed-keys-directory "/var/named/dynamic";
    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
zone "." IN {
    type hint;
    file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

**Step3.**Forward Domain
vim /etc/named.rfc1912.zones

zone "jmilk.com" IN {
        type master;
        file "jmilk.com.zone";
        allow-update { none; };
};

Create zone config file:

cp -p /var/named/named.localhost /var/named/jmilk.com.zone

vim /var/named/jmilk.com.zone

$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      controller.jmilk.com.
controller A    192.168.1.5
network A       192.168.1.6
compute1 A      192.168.1.10
compute2 A      192.168.1.11
block1 A        192.168.1.20
block2 A        192.168.1.21
object1 A       192.168.1.31
object2 A       192.168.1.32

vim /etc/resolv.conf

# Generated by NetworkManager
search jmilk.com
nameserver 127.0.0.1

注意:当需要联网安装软件包时,还是需要将DNSSERVER指向外网DNSSERVER

Restart the named service

systemctl restart named
systemctl enable named

Setup NTP Server

Install the packages:

yum install chrony

Edit the /etc/chrony.conf:
vim /etc/chrony.conf

#注释其他以server开头的配置项,并添加下列配置,使用国内速度较快的NTP Server
server 1.cn.pool.ntp.org iburst  
allow 192.168.1.0/24

Start the NTP service and configure it to start when the system boots:

systemctl enable chronyd.service
systemctl start chronyd.service

CHECK:

[root@controller ~]# timedatectl status 
      Local time: Fri 2016-06-10 12:00:08 EDT
  Universal time: Fri 2016-06-10 16:00:08 UTC
        RTC time: Fri 2016-06-10 16:00:09
        Timezone: America/New_York (EDT, -0400)
     NTP enabled: yes               #YES
NTP synchronized: yes               #YES
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2016-03-13 01:59:59 EST
                  Sun 2016-03-13 03:00:00 EDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2016-11-06 01:59:59 EDT
                  Sun 2016-11-06 01:00:00 EST

[root@controller ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* 202.118.1.130                 2   6    17    31   +307us[ +415us] +/-   82ms

Install SQL Database

Install the packages:

yum install mariadb mariadb-server python2-PyMySQL -y

Create and edit the /etc/my.cnf.d/openstack.cnf file
vim /etc/my.cnf.d/openstack.cnf

[mysqld]
bind-address = 192.168.1.5      #Controller Node IPAddress 设置
ip绑定
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
character-set-server = utf8    #默认数据库引擎及默认字符集为UTF-8

Start the database service and configure it to start when the system boots:

systemctl enable mariadb.service
systemctl start mariadb.service

初始化MySQL

[root@controller ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] 
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] 
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] 
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] 
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] 
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Setup Message queue

OpenStack使用message queue实现协调操作和服务之间的状态信息。Message queue service一般在Controller Node上运行。
OpenStack常用的消息代理软件:

  • RabbitMQ(更加常用)
  • Qpid
  • ZeroMQ

Install the package:

yum install rabbitmq-server -y

Start the message queue service and configure it to start when the system boots:

systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service

Add the openstack user

rabbitmqctl add_user openstack fanguiju

Permit configuration, write, and read access for the openstack user:

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

Setup Memcached

The Identity service authentication mechanism for services uses Memcached to cache tokens. Memcached缓存技术用于对Keystone组件的认证信息token进行缓存。一般安装在Controller Node上,在生产系统中,建议使用认证、防火墙、加密的手段来保证token缓存的安全。
Install the packages:

yum install memcached python-memcached -y

Start the Memcached service and configure it to start when the system boots:

systemctl enable memcached.service
systemctl start memcached.service
相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
4月前
|
消息中间件 JavaScript 中间件
函数计算产品使用问题之WebIDE编写的Node.js代码是否会自动进行打包部署
函数计算产品作为一种事件驱动的全托管计算服务,让用户能够专注于业务逻辑的编写,而无需关心底层服务器的管理与运维。你可以有效地利用函数计算产品来支撑各类应用场景,从简单的数据处理到复杂的业务逻辑,实现快速、高效、低成本的云上部署与运维。以下是一些关于使用函数计算产品的合集和要点,帮助你更好地理解和应用这一服务。
|
4月前
|
资源调度 JavaScript Linux
【Azure 应用服务】本地Node.js部署上云(Azure App Service for Linux)遇到的三个问题解决之道
【Azure 应用服务】本地Node.js部署上云(Azure App Service for Linux)遇到的三个问题解决之道
|
1月前
|
JavaScript C++ 容器
【Azure Bot Service】部署NodeJS ChatBot代码到App Service中无法自动启动
2024-11-12T12:22:40.366223350Z Error: Cannot find module 'dotenv' 2024-11-12T12:40:12.538120729Z Error: Cannot find module 'restify' 2024-11-12T12:48:13.348529900Z Error: Cannot find module 'lodash'
42 11
|
3月前
|
JavaScript 应用服务中间件 Linux
宝塔面板部署Vue项目、服务端Node___配置域名
本文介绍了如何使用宝塔面板在阿里云服务器上部署Vue项目和Node服务端项目,并配置域名。文章详细解释了安装宝塔面板、上传项目文件、使用pm2启动Node项目、Vue项目打包上传、以及通过Nginx配置域名和反向代理的步骤。
651 0
宝塔面板部署Vue项目、服务端Node___配置域名
|
3月前
|
JavaScript 前端开发 Windows
NodeJS的环境部署
介绍如何在Windows操作系统上安装Node.js环境,包括下载长期支持版本的Node.js、安装程序、编写测试代码并执行,以及如何在WebStorm集成开发环境中配置和运行Node.js。
51 1
|
3月前
|
JavaScript Linux 开发工具
如何将nodejs项目程序部署到阿里云服务器上
该文章详细描述了将Node.js项目部署到阿里云服务器的步骤,包括服务器环境配置、项目上传及使用PM2进行服务管理的过程。
|
4月前
|
JavaScript NoSQL 中间件
《Node.js后端修炼手册》——揭秘服务器搭建与部署上线的生死时速,让你一战成名!
【8月更文挑战第27天】本文详细介绍如何从零开始利用Node.js构建后端服务器并部署至生产环境。首先,通过简易步骤搭建基础服务器,包括环境安装与配置。接着,引入Express框架优化路由与中间件管理,提升开发效率。随后,利用Mongoose实现MongoDB数据库连接,增强数据交互能力。为保证系统稳定性,文中还讲解了错误处理机制。最后,通过PM2等工具部署应用至生产环境,确保高效运行。本教程辅以示例代码,帮助读者快速掌握Node.js后端开发全流程。
124 2
|
4月前
|
JavaScript Linux API
【Azure 应用服务】NodeJS Express + MSAL 应用实现AAD集成登录并部署在App Service Linux环境中的实现步骤
【Azure 应用服务】NodeJS Express + MSAL 应用实现AAD集成登录并部署在App Service Linux环境中的实现步骤
|
4月前
|
开发框架 JavaScript .NET
【Azure 应用服务】Azure Mobile App (NodeJS) 的服务端部署在App Service for Windows中出现404 Not Found
【Azure 应用服务】Azure Mobile App (NodeJS) 的服务端部署在App Service for Windows中出现404 Not Found
|
4月前
|
JavaScript Linux 容器
【Azure 应用服务】NodeJS项目部署在App Service For Linux环境中,部署完成后应用无法访问
【Azure 应用服务】NodeJS项目部署在App Service For Linux环境中,部署完成后应用无法访问