58 Openstack基础openstack之glanceopenstack之keystone

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了58 Openstack基础openstack之glanceopenstack之keystone相关的知识,希望对你有一定的参考价值。

03 openstack之keystone


配置环境

Controller CentOS release 6.7 controller

eth0:仅主机 192.168.28.121

eth1:桥接 192.168.1.121

node2 192.168.1.122 CentOS release 6.7 compute1

eth0:仅主机,eth1:VMnet2 不会直接与外部网络通信

node3 192.168.1.123 CentOS release 6.7 networking

eth0:仅主机,eth1:VMnet2,eth2:桥接

[[email protected] ~]# vim /etc/hosts

添加

192.168.28.121      controller.magedu.com controller

192.168.28.122      compute1.magedu.com compute1

192.168.28.123      network1.magedu.com network1



#配置安装Mariadb

[[email protected] ~]# yum -y groupinstall "Development tools" "Desktop Platform Development" -y

[[email protected] ~]# yum -y install cmake

[[email protected] ~]# groupadd -r -g 306 mysql

[[email protected] ~]# useradd -r -g 306 -u 306 mysql

[[email protected] ~]# mkdir -p /mydata/data

[[email protected] ~]# chown  mysql.mysql /mydata/data/

[[email protected] ~]# tar xf mariadb-5.5.53.tar.gz 

[[email protected] ~]# cd mariadb-5.5.53

[[email protected] mariadb-5.5.53]#cmake  \

-DCMAKE_INSTALL_PREFIX=/usr/local/mariadb-5.5.53 \

 -DMYSQL_DATADIR=/mydata/data \

 -DSYSCONFDIR=/etc \

 -DWITH_INNOBASE_STORAGE_ENGINE=1 \

 -DWITH_ARCHIVE_STORAGE_ENGINE=1 \

 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \

 -DWITH_READLINE=1 \

 -DWITH_SSL=system \

 -DWITH_ZLIB=system \

 -DWITH_LIBWRAP=0 \

 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \

 -DDEFAULT_CHARSET=utf8 \

 -DDEFAULT_COLLATION=utf8_general_ci

[[email protected] mariadb-5.5.53]# make && make install

[[email protected] mariadb-5.5.53]# cd /usr/local/mariadb-5.5.53/

[[email protected] mariadb-5.5.53]# chown -R root.mysql ./*

[[email protected] mariadb-5.5.53]# cd ..

[[email protected] local]# ln -s mariadb-5.5.53/ mysql

[[email protected] local]# cd mysql

[[email protected] mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data/

[[email protected] mysql]# mkdir /etc/mysql

[[email protected] mysql]# cp support-files/my-large.cnf /etc/mysql/my.cnf

[[email protected] mysql]# vim /etc/mysql/my.cnf 

添加

datadir = /mydata/data

innodb_file_per_table = ON

skip_name_resolv = ON  

[[email protected] mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld

[[email protected] mysql]# chmod +x /etc/rc.d/init.d/mysqld 

[[email protected] mysql]# chkconfig --add mysqld

[[email protected] ~]# vim /etc/profile.d/mysql.sh

export PATH=/usr/local/mysql/bin:$PATH

[[email protected] ~]# . /etc/profile.d/mysql.sh


#配置openstack-controller

[[email protected] ~]# cd /etc/sysconfig/netwok-scripts 

[[email protected] network-scripts]# cp ifcfg-eth{0,1}

[[email protected] network-scripts]# vim ifcfg-eth1

替换所有的eth0为eth1

删除UUID、MAC、MM_CONTROLLED行

其它保持不变

[[email protected] network-scripts]# vim ifcfg-eth0

删除UUID、MAC、MM_CONTROLLED、网关、DNS

修改IP地址为192.168.28.121

[[email protected] network-scripts]# service NetworkManager stop

[[email protected] network-scripts]# chkconfig NetworkManager off

[[email protected] network-scripts]# service network restart

[[email protected] network-scripts]# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0C:29:AF:63:D0  

 inet addr:192.168.28.121  Bcast:192.168.28.255  Mask:255.255.255.0

 inet6 addr: fe80::20c:29ff:feaf:63d0/64 Scope:Link

 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

 RX packets:25 errors:0 dropped:0 overruns:0 frame:0

 TX packets:47 errors:0 dropped:0 overruns:0 carrier:0

 collisions:0 txqueuelen:1000 

 RX bytes:1962 (1.9 KiB)  TX bytes:3146 (3.0 KiB)


eth1      Link encap:Ethernet  HWaddr 00:0C:29:AF:63:DA  

 inet addr:192.168.1.121  Bcast:192.168.1.255  Mask:255.255.255.0

 inet6 addr: fe80::20c:29ff:feaf:63da/64 Scope:Link

 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

 RX packets:1745 errors:0 dropped:0 overruns:0 frame:0

 TX packets:115 errors:0 dropped:0 overruns:0 carrier:0

 collisions:0 txqueuelen:1000 

 RX bytes:316460 (309.0 KiB)  TX bytes:13880 (13.5 KiB)

 

#同步服务器时间  

[[email protected] network-scripts]# crontab -l

*/3 * * * * /usr/sbin/ntpdate 192.168.1.1 &> /dev/null


#配置openstack-Compute1

[[email protected] ~]# cd /etc/sysconfig/netwok-scripts 

[[email protected] network-scripts]# cp ifcfg-eth{0,1}

[[email protected] network-scripts]# vim ifcfg-eth1

替换所有的eth0为eth1

删除UUID、MAC、MM_CONTROLLED、DNS、网关、网关、掩码行

其它保持不变

[[email protected] network-scripts]# vim ifcfg-eth0

删除UUID、MAC、MM_CONTROLLED

修改IP地址为192.168.28.122

修改网关为192.168.28.121

[[email protected] network-scripts]# service NetworkManager stop

[[email protected] network-scripts]# chkconfig NetworkManager off

[[email protected] network-scripts]# service network restart

[[email protected] network-scripts]#route add default gw 192.168.28.121


#同步服务器时间

[[email protected] ~]# crontab -l

*/3 * * * * /usr/sbin/ntpdate 192.168.1.1 &> /dev/null

[[email protected] ~]# scp /etc/hosts compute1:/etc/

[[email protected] ~]# iptables -t nat -A POSTROUTING -s 192.168.28.0/24 -j SNAT --to-source 192.168.1.121

[[email protected] ~]# service iptables save

[[email protected] ~]# vim /etc/sysctl.conf 

修改

net.ipv4.ip_forward = 0

net.ipv4.ip_forward = 1


[[email protected] ~]# cd /etc/yum.repos.d/

[[email protected] yum.repos.d]# vim openstack.repo

[openstack]

name=openstack-icehouse

baseurl=http://192.168.56.2/openstack

enabled=1

gpgcheck=0

[[email protected] yum.repos.d]# yum install openstack-keystone python-keystoneclient #没有安装成功

[[email protected] yum.repos.d]# yum install -y openstack-utils

[[email protected] yum.repos.d]# openstack-db --init --service keystone --pass keystone

[[email protected] yum.repos.d]# cd

[[email protected] ~]# mysql

mysql> GRANT ALL ON keystone.* to ‘keystone‘@‘%‘ IDENTIFIED BY ‘keystone‘;

mysql> FLUSH PRIVILEGES;

mysql> \q

[[email protected] ~]# su -s /bin/sh -c ‘keystone-manage db_sync‘ keystone

[[email protected] ~]# service mysqld stop

[[email protected] ~]# yum install mariadb-galera-server

[[email protected] ~]# rm -f /etc/profile.d/mysql.sh


截止 93:0(84558)

由于openstack-keystone无法安装成功,本视频无法继续进行


04 openstack之glance


截止 11:33(10512)

由于openstack-keystone无法安装成功,本视频无法继续进行


本文出自 “追梦” 博客,请务必保留此出处http://sihua.blog.51cto.com/377227/1892009

以上是关于58 Openstack基础openstack之glanceopenstack之keystone的主要内容,如果未能解决你的问题,请参考以下文章

OpenStack入门 之 初步认识

云计算之openstack基础服务之一keystone服务最佳实践

Openstack概述 、 部署安装环境 、 部署Openstack 、 Openstack操作基础

OpenStack部署之实验环境准备

openstack搭建之-基础服务配置(15)

002-官网安装openstack之-安装基础服务