34.openstack文档(一)

发表于 linux 分类,标签:

1.安装epel源

yum  -y install epel-release


2.时间同步控制节点

# yum install chrony

编辑 /etc/chrony.conf 文件,按照你环境的要求,对下面的键进行添加,修改或者删除:


server NTP_SERVER iburst

使用NTP服务器的主机名或者IP地址替换 NTP_SERVER 。配置支持设置多个 server 值。


 注解


控制节点默认跟公共服务器池同步时间。但是你也可以选择性配置其他服务器,比如你组织中提供的服务器。


为了允许其他节点可以连接到控制节点的 chrony 后台进程,在``/etc/chrony.conf`` 文件添加下面的值:


allow 10.0.0.0/24

如有必要,将 10.0.0.0/24 替换成你子网的相应描述。


启动 NTP 服务并将其配置为随系统启动:


# systemctl enable chronyd.service

# systemctl start chronyd.service

其他节点

# yum install chrony

编辑``/etc/chrony.conf`` 文件并注释除``server`` 值外的所有内容。修改它引用控制节点:


server controller iburst

启动 NTP 服务并将其配置为随系统启动:


# systemctl enable chronyd.service

# systemctl start chronyd.service

验证操作

在控制节点上执行这个命令:


# chronyc sources

  210 Number of sources = 2

  MS Name/IP address         Stratum Poll Reach LastRx Last sample

  ===============================================================================

  ^- 192.0.2.11                    2   7    12   137  -2814us[-3000us] +/-   43ms

  ^* 192.0.2.12                    2   6   177    46    +17us[  -23us] +/-   68ms

在 Name/IP address 列的内容应显示NTP服务器的主机名或者IP地址。在 S 列的内容应该在NTP服务目前同步的上游服务器前显示 *。


在所有其他节点执行相同命令:


# chronyc sources

  210 Number of sources = 1

  MS Name/IP address         Stratum Poll Reach LastRx Last sample

  ===============================================================================

  ^* controller                    3    9   377   421    +15us[  -87us] +/-   15ms

在 Name/IP address 列的内容应显示控制节点的主机名。


3.OpenStack包

从Ussuri版本开始,您需要使用CentOS8或RHEL 8。以前的 OpenStack 版本需要使用 CentOS7 或 RHEL 7。对于发行版和版本的不同,都包含说明。

在 CentOS 上,该存储库提供了启用 OpenStack 存储库的 RPM。CentOS 默认包含储存库,因此您只需安装套件即可启用 OpenStack 储存库。对于 CentOS8,您还需要启用 PowerTools 存储库。extrasextras


安装火车版本时,请运行:

# yum install centos-release-openstack-train

完成安装

yum upgrade

为您的版本安装适当的 OpenStack 客户端


适用于 CentOS 7 和 RHEL 7


# yum install python-openstackclient

RHEL 和 CentOS 默认启用 SELinux。安装软件包以自动管理 OpenStack 服务的安全策略:openstack-selinux

# yum install openstack-selinux


4.安装数据库

# yum install mariadb mariadb-server python2-PyMySQL

启动数据库服务并将其配置为在系统引导时启动


# systemctl enable mariadb.service

# systemctl start mariadb.service

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


# mysql_secure_installation(此处设置详见Mysql安全启动配置向导)


5.RHEL 和 CentOS 的 Message queue(消息队列)

安装软件包:


# yum install rabbitmq-server

启动消息队列服务并将其配置为在系统引导时启动


# systemctl enable rabbitmq-server.service

# systemctl start rabbitmq-server.service

添加用户:openstack


# rabbitmqctl add_user openstack RABBIT_PASS


Creating user "openstack" ...

替换为合适的密码。RABBIT_PASS


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


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


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


6.Memcached for RHEL and CentOS

Install the packages:


For CentOS 7 and RHEL 7


# yum install memcached python-memcached

Edit the /etc/sysconfig/memcached file and complete the following actions

Configure the service to use the management IP address of the controller node. This is to enable access by other nodes via the management network:

OPTIONS="-l 127.0.0.1,::1,controller"

Note

Change the existing line OPTIONS="-l 127.0.0.1,::1".

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


# systemctl enable memcached.service

# systemctl start memcached.service


7.Etcd

Install the package


# yum install etcd

Edit the /etc/etcd/etcd.conf file and set the ETCD_INITIAL_CLUSTER, ETCD_INITIAL_ADVERTISE_PEER_URLS, ETCD_ADVERTISE_CLIENT_URLS, ETCD_LISTEN_CLIENT_URLS to the management IP address of the controller node to enable access by other nodes via the management network:


#[Member]
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://10.0.0.11:2380"
ETCD_LISTEN_CLIENT_URLS="http://10.0.0.11:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.11:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.11:2379"
ETCD_INITIAL_CLUSTER="controller=http://10.0.0.11:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"


Enable and start the etcd service


# systemctl enable etcd

# systemctl start etcd




















0 篇评论

发表我的评论