# apt-get install keystone python-keystone python-keystoneclient
我们在mysql里为认证服务创建一个数据库,名字就叫做keystone,密码也是keystone
# mysql -u root -p
mysql> CREATE DATABASE keystone;
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
修改Keystone的配置文件/etc/keystone/keystone.conf,使其指向我们刚刚创建的数据库。修改[sql]部分如下:
[sql]
# The SQLAlchemy connection string used to connect to the database
connection = mysql://keystone:keystone@localhost/keystone
接下来创建keystone需要的表格。
# keystone-manage db_sync
生成admin的token。
# openssl rand -hex 10
还是编辑/etc/keystone/keystone.conf,把上面生成的token替换下面的ADMIN_TOKEN
[DEFAULT]
# A "shared secret" between keystone and other openstack services
admin_token = ADMIN_TOKEN
重启认证服务
# service keystone restart
安装glance包。
# apt-get install glance
删除/var/lib/glance/glance.sqlite,防止错误使用sqlite数据库。
为镜像服务创建数据库,名字叫做glance,密码也是glance
# mysql -u root -p
mysql> CREATE DATABASE glance;
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'glance';
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance';
生成数据表。
# glance-manage db_sync
# nova image-list
+--------------------------------------+-------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+-------------------------+--------+--------+
| dbe3ba9c-c22b-41c9-bac5-dd0e6964c1ce | Ubuntu 12.04 LTS Server | ACTIVE | |
+--------------------------------------+-------------------------+--------+--------+
# nova list
+--------------------------------------+--------+--------+------------+-------------+---------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+--------+------------+-------------+---------------------+
| eff82154-bd75-40a7-bc83-60ba0f5b2ac4 | ubuntu | ACTIVE | None | Running | vmnet=192.168.122.2 |
+--------------------------------------+--------+--------+------------+-------------+---------------------+