OpenStack安装部署---个人笔记整理

1、系统安装
apt-get install ntp   ###安装时间服务器程序
nano /etc/ntp.conf
     server ntp.ubuntu.com iburst
     server 127.127.1.0
     fudge 127.127.1.0 stratum 10
service ntp restart
apt-get install tgt   ###nova-volume中的一个服务
service tgt start
apt-get install open-iscsi open-iscsi-utils  ###安装openiscsi-client
apt-get install bridge-utils   ###安装网桥程序
/etc/init.d/networking restart
apt-get install rabbitmq-server memcached python-memcache ###安装RabbitMQ,AMQP-implementation
apt-get install kvm libvirt-bin  ###安装虚拟机程序

2、安装SQL和创建数据库
apt-get install -y mysql-server python-mysqldb  ###安装mysql程序
    nano /etc/mysql/my.cnf
         bind-address = 127.0.0.1 --->bind-address = 0.0.0.0
    service mysql restart
实例:使用root账户创建nova、glance和keystone数据库
mysql -u root <<EOF
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'novadbadmin'@'%'
  IDENTIFIED BY 'dieD9Mie';
EOF

mysql -u root <<EOF
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glancedbadmin'@'%'
  IDENTIFIED BY 'ohC3teiv';
EOF

mysql -u root <<EOF
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystonedbadmin'@'%'
  IDENTIFIED BY 'Ue0Ud7ra';
EOF
3、安装keystone
apt-get install keystone python-keystone python-mysqldb python-keystoneclient  ###安装keystone服务
nano /etc/keystone/keystone.conf
     [sql]
     connection = mysql://keystonedbadmin:[email protected]/keystone
     idle_timeout = 200
service keystone restart
keystone-manage db_sync
......keystone_data.sh
......endpoints.sh
./endpoints.sh -m 10.42.0.6 -u keystonedbadmin -D keystone -P Ue0Ud7ra -K 10.42.0.6 -R RegionOne -E "http://localhost:35357/v2.0" -S 10.42.0.50 -T hastexo
## -m 10.42.0.6 正在运行mysql数据库的计算机
## -u keystonedbadmin 认证的用户才可以访问mysql数据库
## -D keystone 将数据库属于mysql中的keystone
## -P Ue0Ud7ra 定义这个密码可以访问mysql中的keystone
## -K 10.42.0.6 指定运行OpenStack 服务的主机ip地址
## -R RegionOne 指定的终端范围地址才可以访问
## -E "http://localhost:35357/v2.0"  通过认证的终端访问地址
## -S 10.42.0.6 指定运行swift的服务IP
## -T hastexo
4、Glance安装和配置
apt-get install glance glance-api glance-client glance-common glance-registry python-glance   ###安装glance相关服务
nano /etc/glance/glance-api-paste.ini
     admin_tenant_name = %SERVICE_TENANT_NAME%
     admin_user = %SERVICE_USER%
     admin_password = %SERVICE_PASSWORD%
nano /etc/glance/glance-registry.conf
     sql_connection = mysql://glancedbadmin:[email protected]/glance
     [paste_deploy]
     flavor = keystone
nano /etc/glance/glance-api.conf
     [paste_deploy]
     flavor = keystone
glance-manage version_control 0
glance-manage db_sync
service glance-api restart && service glance-registry restart

export OS_TENANT_NAME=admin ###验证Glance工作是否正常
export OS_USERNAME=admin
export OS_PASSWORD=hastexo
export OS_AUTH_URL="http://localhosts:5000/v2.0/"

glance index   ###
echo $?   ###返回0表示正常

wget http://http://uec-images.ubuntu.com/releases/12.04/release/ubuntu-12.04-server-cloudimg-amd64-disk1.img  ###使用wget下载img文件

glance add name="Ubuntu 12.04 cloudimg amd64" is_public=true container_format=ovf disk_format=qcow2 < ubuntu-12.04-server-cloudimg-amd64-disk1.img ###添加img镜像

glance index  ###查看IMG镜像添加是否成功
5、安装和配置nova
apt-get install nova-api nova-cert nova-common nova-compute nova-compute-kvm nova-doc nova-network nova-objectstore nova-scheduler nova-volume nova-consoleauth novnc python-nova python-novaclient  ###安装nova相关组件
nano /etc/nova/nova.conf   ###配置nova
     --dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--lock_path=/var/lock/nova
--allow_admin_api=true
--use_deprecated_auth=false
--auth_strategy=keystone
--scheduler_driver=nova.scheduler.simple.SimpleScheduler
--s3_host=10.42.0.6
--ec2_host=10.42.0.6
--rabbit_host=10.42.0.6
--cc_host=10.42.0.6
--nova_url=http://10.42.0.6:8774/v1.1/
--routing_source_ip=10.42.0.6
--glance_api_servers=10.42.0.6:9292
--image_service=nova.image.glance.GlanceImageService
--iscsi_ip_prefix=192.168.22
--sql_connection=mysql://novadbadmin:[email protected]/nova
--ec2_url=http://10.42.0.6:8773/services/Cloud
--keystone_ec2_url=http://10.42.0.6:5000/v2.0/ec2tokens
--api_paste_config=/etc/nova/api-paste.ini
--libvirt_type=kvm
--libvirt_use_virtio_for_bridges=true
--start_guests_on_host_boot=true
--resume_guests_state_on_host_boot=true
--vnc_enabled=true
--vncproxy_url=http://10.42.0.6:6080
--vnc_console_proxy_url=http://10.42.0.6:6080
# network specific settings
--network_manager=nova.network.manager.FlatDHCPManager
--public_interface=eth0
--flat_interface=eth1
--flat_network_bridge=br100
--fixed_range=192.168.22.32/27
--floating_range=10.42.0.32/27
--network_size=32
--flat_network_dhcp_start=192.168.22.33
--flat_injected=False
--force_dhcp_release
--iscsi_helper=tgtadm
--connection_type=libvirt
--root_helper=sudo nova-rootwrap
--verbose
--libvirt_use_virtio_for_bridges
--ec2_private_dns_show
--novnc_enabled=true
--novncproxy_base_url=http://10.42.0.6:6080/vnc_auto.html
--vncserver_proxyclient_address=10.42.0.6
--vncserver_listen=10.42.0.6

nano /etc/nova/api-paste.ini  ###
     admin_tenant_name = admin
     admin_user = admin
     admin_password = admin
for a in libvirt-bin nova-network nova-compute nova-cert nova-api nova-objectstore nova-scheduler nova-volume novnc nova-consoleauth; do service "$a" stop; done   ###停止nova相关服务

for a in libvirt-bin nova-network nova-compute nova-cert nova-api nova-objectstore nova-scheduler nova-volume novnc nova-consoleauth; do service "$a" start; done  ###启动nova相关服务
nova-manage db sync   ###同步数据库
nova-manage network create private --fixed_range_v4=192.168.22.32/27 --num_networks=1 --bridge=br100 --bridge_interface=eth1 --network_size=32  ###创建网桥
chown -R nova:nova /etc/nova   ###/etc/nova属于nova用户和nova组
for a in libvirt-bin nova-network nova-compute nova-cert nova-api nova-objectstore nova-scheduler nova-volume novnc nova-consoleauth; do service "$a" stop; done ###停止nova相关服务

for a in libvirt-bin nova-network nova-compute nova-cert nova-api nova-objectstore nova-scheduler nova-volume novnc nova-consoleauth; do service "$a" start; done ###启动nova相关服务
nova list   ###显示nova列表信息
nova image-list   ###显示镜像列表信息

6、安装VM虚拟机
nova keypair-add --pub_key id_rsa.pub key1  ###用于SSH访问虚拟机做认证
nova image-list   ###查看img镜像文件列表
nova flavor-list  ###查看flavor组合列表
nova boot --flavor ID --image Image-UUID --key_name key-name vm_name  ###创建VM虚拟机语法
实例:nova boot --flavor 1 --image 9bab7ce7-7523-4d37-831f-c18fbc5cb543 --key_name key1 superfrobnicator
nova show superfrobnicator  ###查看superfrobnicator信息
ssh -i private-key ubuntu@IP


你可能感兴趣的:(mysql,数据库,service,database,NetWork,interface)