Openstack Documentation learning notes

来源:互联网 发布:手机怎么登陆淘宝客服 编辑:程序博客网 时间:2024/06/03 20:43

The OpenStack Services

Service Project name Description Dashboard Horizon Web UI Compute service Nova Spawning, scheduling and decommissioning of VMs Netwroking service Neutron API to define network Object Storage service Swift Data replication in a server cluster Block Storage service Cinder Block Storage to run instances Identity Service Keystone Authentication and authorization Image service Glance VM images, instance provisioning Telemetry service Ceilometer Monitors and meters Orchestration service Heat Orchestrate muiltiple services Database service Trove Database-as-a-service Data Processing service Sahara Capabilities to provision and scale Hadoop clusters

Openstack architecture

from docs.openstack.org
Image from docs.openstack.org

- Database for Centos

systemctl enable mysql.servicesystemctl start mysql.service

- Message queue for Centos

yum install rabbitmq-server      systemctl enable rabbitmq-server.servicesystemctl start rabbitmq-server.servicerabbitmqctl add_user openstack RABBIT_PASSrabbitmqctl set_permisiions openstack ".*"".*"".*"

- Mencached to catch tokens for Identity service authentication

yum install memcached python-memcachedvi /etc/sysconfig/memcached    > OPTIONS = "-l 127.0.0.1, ::1, controller_id"systemctl enable memcached.servicesystemctl start memcached.service

- etcd to store key-value


Hands-on learning

1. Create flavor

openstack flavor create --id x --vcpus x --ram x --disk x flavor_name

2. Generate a key pair

. demo-openrc                        #source credentials ssh-keygen -q -N ""                  #generate keyopenstack keypair create --public-key ~/.ssh/id_ras.pub key_nameopenstack keypair list

3. Add security group rules

Define the rules for instances access, prevent access without permits.
–proto                                                                                          Permit ICMP (ping) or SSH (secure shell)

openstack security group rule create --proto xxx --dst-port x\ instance_name

4. Create the provider network

. admin-openrcopenstack network create --share --external \--network_name-physical-network network_name \--network_name-network-type flat network_nameopenstack subnet create --network network_name \--allocation-pool start=START_IP_ADDRESS,end=END_IP_ADDRESS \--dns-nameserver DNS_RESLOVER --gateway network_name NETWORK_GATEWAY \--subnet-range NETWORK-CIDR network_name

DNS-resolver can be found in /etc/resolv.conf

5. Create a router

openstack router create routerneutron router-interface-add router network_nameneutron router-gateway-set router network_name# see router informationip netnsneutron router-port-list router

6. Determine instance options

openstack flavor listopenstack image listopenstack network listopenstack security group listopenstack server create --flavor xx --image xx \--nic net-id=xx --security-group xx \--key-name xx instance_nameopenstack server list

7. Access the instance using the virtual console

openstack console url show instance_name

8. Access the instance using ssh

ssh cirros@xxx.xxx.xxx.xxx#password cubswin:)

9. Block storage

openstack volume create --size x volume_nameopenstack volume listopenstack server add volume instance_name volume-name

Firewalls and default ports

All the information of ports can be found here.

Frequently used ports:

Service Default ports Type HTTP 80 Horizon for dashboard MyQSL 3306 Database SSH 22 TCP

To see the port range:

sysctl net.ipv4.ip_local_port_range
原创粉丝点击