記事のディレクトリ
1つは、環境構成です。
1.制御ノードct1
CPU | デュアルコアデュアルスレッドCPU仮想化が有効 |
---|---|
羊 | 8Gハードディスク:300G + 1024G(CEPHブロックストレージ) |
デュアルネットワークカード | VM1-(ローカルエリアネットワーク)192.168.100.110 NAT-192.168.162.120 |
オペレーティング・システム | Centos 7.6(1810)-最小限のインストール |
2.ノードc1を計算します
CPU | デュアルコアデュアルスレッドCPU仮想化が有効 |
---|---|
羊 | 8Gハードディスク:300G + 1024G(CEPHブロックストレージ) |
デュアルネットワークカード | VM1(ローカルエリアネットワーク)-192.168.100.120 NAT-192.168.162.120 |
オペレーティング・システム | Centos 7.6(1810)-最小限のインストール |
3.ノードc2を計算します
CPU | デュアルコアデュアルスレッドCPU仮想化が有効 |
---|---|
羊 | 8Gハードディスク:300G + 1024G(CEPHブロックストレージ) |
デュアルネットワークカード | VM1(ローカルエリアネットワーク)-192.168.100.130 NAT-192.168.162.130 |
オペレーティング・システム | Centos 7.6(1810)-最小限のインストール |
基本的な環境構成
構成項目(すべてのノード)
1.ホスト名
2.ファイアウォール、コア保護
systemctl stop firewalld
setenforce 0
3.相互作用なし
4.基本的な環境依存パッケージ
yum -y install net-tools bash-completion vim gcc gcc-c++ make pcre pcre-devel expat-devel cmake bzip2 lrzsz
EXPAT C语言发开库
yum -y install centos-release-openstack-train python-openstackclient openstack-selinux openstack-utils
#OpenStack 的 train 版本仓库源安装 包,同时安装 OpenStack 客户端和 openstack-selinux 安装包
5、時刻の同期+定期的なスケジュールされたタスク
[root@ct ~]# hostnamectl set-hostname ct
[root@ct ~]# bash
●● 制御ノード構成(ct)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
●● パラメータを変更して確認します
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.100.11
NETMASK=255.255.255.0
#GATEWAY=192.168.100.2
vi /etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO=static
IPV4_ROUTE_METRIC=90 ###调由优先级,NAT网卡优先
ONBOOT=yes
IPADDR=192.168.226.150
NETMASK=255.255.255.0
GATEWAY=192.168.226.2
systemctl restart network #重启网卡
ホストの構成(すべてのノード)
[root@ct ~]# vi /etc/hosts
192.168.100.11 ct
192.168.100.12 c1
192.168.100.13 c2
PS:以上为局域网IP
[root@ct ~]# systemctl stop firewalld
[root@ct ~]# systemctl disable firewalld
[root@ct ~]# setenforce 0
[root@ct ~]# vim /etc/sysconfig/selinux
SELINUX=disabled
3つのノードは相互作用しません
●非対称キー
[root@ct ~]# ssh-keygen -t rsa
[root@ct ~]# ssh-copy-id ct
[root@ct ~]# ssh-copy-id c1
[root@ct ~]# ssh-copy-id c2
DNSの構成(すべてのノード)
[root@ct ~]# vim /etc/resolv.conf
nameserver 114.114.114.114
【制御ノードct時刻同期設定】
ct ->同步阿里云时钟服务器
c1、c2 -> 同步ct
[root@ct ~]# yum install chrony -y
[root@ct ~]# vim /etc/chrony.conf
[root@ct ~]# systemctl enable chronyd
[root@ct ~]# systemctl restart chronyd
● 【控制节点ct时间同步配置】
[root@ct ~]# vi /etc/chrony.conf
server 0.centos.pool.ntp.org iburst ###注释掉
server 1.centos.pool.ntp.org iburst ###注释掉
server 2.centos.pool.ntp.org iburst ###注释掉
server 3.centos.pool.ntp.org iburst ###注释掉
server ntp6.aliyun.com iburst ###配置阿里云时钟服务器源
allow 192.168.100.0/24 ###允许192.168.100.0/24网段的主机来同步时钟服务
● 使用 chronyc sources 命令查询时间同步信息
[root@ct ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 203.107.6.88 2 6 17 0 +3559us[+3429us] +/- 25ms
[制御ノードc1、c2時刻同期構成]
[root@c1 ~]# vi /etc/chrony.conf
server 0.centos.pool.ntp.org iburst ###注释掉
server 1.centos.pool.ntp.org iburst ###注释掉
server 2.centos.pool.ntp.org iburst ###注释掉
server 3.centos.pool.ntp.org iburst ###注释掉
server ct iburst ###配置阿里云时钟服务器源
[root@c1 ~]# systemctl enable chronyd.service ###永久开启时间同步服务器
[root@c1 ~]# systemctl restart chronyd.service ###重启时间同步服务器
[root@c2 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
==============================================================================
^* ct
[root@c1 ~]# crontab -e ###配置计划任务,每隔2分钟同步一次
*/2 * * * * /usr/bin/chronyc sources >>/var/log/chronyc.log
システム環境の構成
構成サービス(制御ノードct):
1.MariaDBをインストールして構成します
[root@ct ~]# yum -y install mariadb mariadb-server python2-PyMySQL
mariadb:mysqlのブランチであり、mysqlと完全に互換性のあるオープンソースソフトウェアです
。mariadb-server:データベースサービス
python2-PyMySQL:openstackのコントロールエンドがmysqlに接続するために必要なモジュール(インストールされていない場合) 、データベースに接続できなくなります;このパッケージはコンソールにのみインストールされます
yum -y install libibverbs
MySQLサブ構成ファイルを追加し、次のコンテンツを追加します
[root@ct ~]# vim /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.100.11
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
[root@ct ~]# vim /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.100.11 #控制节点局域网地址
default-storage-engine = innodb #默认存储引擎
innodb_file_per_table = on #每张表独立表空间文件
max_connections = 4096 #最大连接数
collation-server = utf8_general_ci #默认字符集
character-set-server = utf8
起動時に自動起動し、サービスを開始します
[root@ct my.cnf.d]# systemctl enable mariadb
[root@ct my.cnf.d]# systemctl start mariadb
MariaDBセキュリティ構成スクリプトを実行する
[root@ct my.cnf.d]# mysql_secure_installation
Enter current password for root (enter for none): #回车
OK, successfully used password, moving on...
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
... Success!
Disallow root login remotely? [Y/n] N #是否不允许root用户远程登陆
... skipping.
Remove test database and access to it? [Y/n] Y 是否删除test测试库
Reload privilege tables now? [Y/n] Y
2、RabbitMQをインストールします
仮想マシンを作成するためのすべての指示は、コントロールエンドからrabbitmqに送信され、ノードノードはrabbitmqを監視します
[root@ct ~]# yum -y install rabbitmq-server
==サービスを構成し、RabbitMQサービスを開始し、起動時に開始するように設定します。==
[root@ct ~]# systemctl enable rabbitmq-server.service
[root@ct ~]# systemctl start rabbitmq-server.service
コントローラとコンピューティングノード間のrabbitmq接続の認証(関連付け)用のメッセージキューユーザーを作成します
[root@ct ~]# rabbitmqctl add_user openstack RABBIT_PASS
Creating user "openstack"
openstackユーザーの操作権限を構成します(通常、読み取りおよび書き込み権限を構成します)
[root@ct ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/"
#可查看25672和5672 两个端口(5672是Rabbitmq默认端口,25672是Rabbit的测试工具CLI的端口)
構成を選択します。
●rabbitmqプラグインリストを表示する
[root@ct ~]# rabbitmq-plugins list
rabbitmqWeb管理インターフェイスプラグインを開きます。ポートは15672です。
[root@ct ~]# rabbitmq-plugins enable rabbitmq_management
ポートを確認してください(25672 5672 15672)
[root@ct my.cnf.d]# ss -natp | grep 5672
この時点で、192.168.162.100:15672にアクセスできます。
デフォルトのアカウントとパスワードは両方ともゲストです。[ログイン]をクリックして、次のインターフェイスに入ります。
3、memcachedをインストールします
関数:
店舗セッション情報に使用されているmemcachedを取り付け、OpenStackののダッシュボードへのログインは、いくつかのセッション情報がmemcachedの中に格納される、生成されるときにキャッシュにMemcachedの使用するサービスの認証メカニズム(キーストーン)はトークン
JWT
Memcachedをインストールします
[root@ct ~]# yum install -y memcached python-memcached
#python-*模块在OpenStack中起到连接数据库的作用
Memcached構成ファイルを変更する
[root@ct ~]# cat /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1,ct"
[root@ct ~]# systemctl enable memcached
[root@ct ~]# systemctl start memcached
[root@ct ~]# netstat -nautp | grep 11211
第四に、etcdをインストールします
[root@ct ~]# yum -y install etcd
etcd構成ファイルを変更する
[root@ct ~]# cd /etc/etcd/
[root@ct etcd]# ls
etcd.conf
[root@ct etcd]# vim etcd.conf
ETCD_DATA_DIR = "/ var / lib / etcd / default.etcd"
#データディレクトリの場所ETCD_LISTEN_PEER_URLS = "http://192.168.10.10:2380"#他のetcdメンバーのURLを監視します(ポート2380、クラスター間の通信、ドメイン名は無効な値)
ETCD_LISTEN_CLIENT_URLS =“ http://192.168.10.10:2379”#外部サービスのアドレス(ポート2379、クラスター内の通信ポート)
ETCD_NAME =“ ct”
#クラスター内のノードID(名前)ETCD_INITIAL_ADVERTISE_PEER_URLS =“ http: / /192.168.10.10:2380”#ノードメンバーのURLアドレス、ポート2380:クラスター間の通信に使用されます。
ETCD_ADVERTISE_CLIENT_URLS = "http://192.168.10.10:2379"
ETCD_INITIAL_CLUSTER = "ct = http://192.168.10.10:2380" ETCD_INITIAL_CLUSTER_TOKEN = "
etcd-cluster-01"
#クラスター初期化トークンETCD_INITIAL_CLUSTER_initial state = "new"ステータス、新規は静的です。存在する場合は、このETCDサービスが既存のクラスターに参加しようとすることを意味します。DNSの
場合は、このクラスターが追加されるオブジェクトになることを意味します。
起動時に自動起動し、サービスを開き、ポートを検出します
systemctl enable etcd.service
systemctl start etcd.service
netstat -anutp |grep 2379
netstat -anutp |grep 2380