- 浏览: 1477867 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
做两个节点控制节点和计算节点
mcontroller521 192.168.139.185
mcompute521 192.168.139.186
/etc/sysconfig/network-scripts/ifcfg-eth0
##############
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.139.185
NETMASK=255.255.240.0
GATEWAY=192.168.128.1
DNS1=114.114.114.114
##################
/etc/hosts
##############
192.168.139.186 mcompute521
192.168.139.185 mcontroller521
#############
yum remove PackageKit
yum install centos-release-openstack-mitaka -y
yum install https://repos.fedorapeople.org/repos/openstack/openstack-mitaka/rdo-release-mitaka-6.noarch.rpm -y
yum upgrade -y
yum install python-openstackclient openstack-selinux -y
vim /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
yum install mariadb mariadb-server python2-PyMySQL -y
/etc/my.cnf.d/openstack.cnf
########################
[mysqld]
bind-address = 192.168.139.185
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
#######################
systemctl enable mariadb.service
systemctl start mariadb.service
mysql_secure_installation
yum install rabbitmq-server -y
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
rabbitmqctl add_user openstack haoning
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
yum install memcached python-memcached -y
systemctl enable memcached.service
systemctl start memcached.service
mysql -u root -p
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'mcompute521' IDENTIFIED BY 'haoning';
openssl rand -hex 10
276827888f4482e79226
yum install openstack-keystone httpd mod_wsgi -y
/etc/keystone/keystone.conf
###############
[DEFAULT]
admin_token = 276827888f4482e79226
[database]
connection = mysql+pymysql://keystone:haoning@mcontroller521/keystone
[token]
provider = fernet
###############
su -s /bin/sh -c "keystone-manage db_sync" keystone
/etc/httpd/conf/httpd.conf
#########################
ServerName mcontroller521
########################
/etc/httpd/conf.d/wsgi-keystone.conf
#####################
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
###################
systemctl enable httpd.service
systemctl start httpd.service
export OS_TOKEN=276827888f4482e79226
export OS_URL=http://mcontroller521:35357/v3
export OS_IDENTITY_API_VERSION=3
openstack service create --name keystone --description "OpenStack Identity" identity
openstack endpoint create --region wuhan identity public http://mcontroller521:5000/v3
openstack endpoint create --region wuhan identity internal http://mcontroller521:5000/v3
openstack endpoint create --region wuhan identity admin http://mcontroller521:35357/v3
openstack domain create --description "Default Domain" default
openstack project create --domain default --description "Admin Project" admin
openstack user create --domain default --password-prompt admin
openstack role create admin
openstack role add --project admin --user admin admin
openstack project create --domain default --description "Service Project" service
openstack project create --domain default --description "Demo Project" demo
openstack user create --domain default --password-prompt demo
openstack role create user
openstack role add --project demo --user demo user
openstack domain list
openstack project list
openstack user list
openstack role list
unset OS_TOKEN OS_URL
openstack --os-auth-url http://mcontroller521:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token issue
openstack --os-auth-url http://mcontroller521:5000/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name demo --os-username demo token issue
admin-openrc
###############
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://mcontroller521:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
#################
demo-openrc
#################
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://mcontroller521:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
#################
★★★★★★★安装glance
mysql -u root -p
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'mcompute521' IDENTIFIED BY 'haoning';
openstack user create --domain default --password-prompt glance
openstack role add --project service --user glance admin
openstack service create --name glance --description "OpenStack Image" image
openstack endpoint create --region wuhan image public http://mcontroller521:9292
openstack endpoint create --region wuhan image internal http://mcontroller521:9292
openstack endpoint create --region wuhan image admin http://mcontroller521:9292
openstack endpoint list
yum install openstack-glance -y
/etc/glance/glance-api.conf
##################
[database]
connection = mysql+pymysql://glance:haoning@mcontroller521/glance
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = haoning
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
##################
/etc/glance/glance-registry.conf
############################
[database]
connection = mysql+pymysql://glance:haoning@mcontroller521/glance
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = haoning
[paste_deploy]
flavor = keystone
###########################
su -s /bin/sh -c "glance-manage db_sync" glance
systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
openstack image list
★★★★★★★Install and configure controller node
mysql -u root -p
CREATE DATABASE nova_api;
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'mcompute521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'mcompute521' IDENTIFIED BY 'haoning';
openstack user create --domain default --password-prompt nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region wuhan compute public http://mcontroller521:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region wuhan compute internal http://mcontroller521:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region wuhan compute admin http://mcontroller521:8774/v2.1/%\(tenant_id\)s
yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler -y
/etc/nova/nova.conf
#####################
[DEFAULT]
enabled_apis = osapi_compute,metadata
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.139.185
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
connection = mysql+pymysql://nova:haoning@mcontroller521/nova_api
[database]
connection = mysql+pymysql://nova:haoning@mcontroller521/nova
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = haoning
[vnc]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[glance]
api_servers = http://mcontroller521:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
#####################
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova
systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
★★★★★★★★Install and configure a compute node
yum install openstack-nova-compute -y
/etc/nova/nova.conf
################
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.139.186
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://mcontroller521:6080/vnc_auto.html
[glance]
api_servers = http://mcontroller521:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[libvirt]
virt_type = qemu
##################
egrep -c '(vmx|svm)' /proc/cpuinfo
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
openstack compute service list
neutron★★★★★★★★★★★★Install and configure controller node
mysql -u root -p
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'mcompute521' IDENTIFIED BY 'haoning';
openstack user create --domain default --password-prompt neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region wuhan network public http://mcontroller521:9696
openstack endpoint create --region wuhan network internal http://mcontroller521:9696
openstack endpoint create --region wuhan network admin http://mcontroller521:9696
★★★★★★Networking Option 1: Provider networks
yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables -y
/etc/neutron/neutron.conf
################
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
rpc_backend = rabbit
auth_strategy = keystone
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
[database]
connection = mysql+pymysql://neutron:haoning@mcontroller521/neutron
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = haoning
[nova]
auth_url = http://mcontroller521:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = nova
password = haoning
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
###################
/etc/neutron/plugins/ml2/ml2_conf.ini
##############
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[ml2_type_vxlan]
vni_ranges = 1:1000
[securitygroup]
enable_ipset = True
###############################
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
###########################
[linux_bridge]
physical_interface_mappings = provider:eth0
[vxlan]
enable_vxlan = True
local_ip = 192.168.139.185
l2_population = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
############################
/etc/neutron/l3_agent.ini
##############################
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
##############################
/etc/neutron/dhcp_agent.ini
#########################
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
/etc/neutron/metadata_agent.ini
###########################
[DEFAULT]
nova_metadata_ip = mcontroller521
metadata_proxy_shared_secret = haoning
###########################
/etc/nova/nova.conf
################################
[neutron]
url = http://mcontroller521:9696
auth_url = http://mcontroller521:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = neutron
password = haoning
service_metadata_proxy = True
metadata_proxy_shared_secret = haoning
#############################
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
systemctl restart openstack-nova-api.service
systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl enable neutron-l3-agent.service
systemctl start neutron-l3-agent.service
neutron★★★★★★Install and configure compute node
yum install openstack-neutron-linuxbridge ebtables ipset -y
/etc/neutron/neutron.conf
#####################
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = haoning
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
##################################################
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
###########################
[linux_bridge]
physical_interface_mappings = provider:eth0
[vxlan]
enable_vxlan = True
local_ip = 192.168.139.186
l2_population = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
#############################
/etc/nova/nova.conf
###################
[neutron]
url = http://mcontroller521:9696
auth_url = http://mcontroller521:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = neutron
password = haoning
####################
systemctl restart openstack-nova-compute.service
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
neutron ext-list
neutron agent-list
★★★★★★★建个vm
neutron net-create --shared --provider:physical_network provider --provider:network_type flat provider
neutron subnet-create --name provider --allocation-pool start=192.168.139.220,end=192.168.139.225 --dns-nameserver 8.8.8.8 --gateway 192.168.128.1 provider 192.168.128.0/20
neutron net-create selfservice
neutron subnet-create --name selfservice --dns-nameserver 8.8.4.4 --gateway 172.16.1.1 selfservice 172.16.1.0/24
neutron net-update provider --router:external
neutron router-create router
neutron router-interface-add router selfservice
neutron router-gateway-set router provider
neutron port-list
neutron router-port-list router
openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
ssh-keygen -q -N ""
openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey
openstack keypair list
openstack security list
openstack security group rule create --proto icmp default
openstack security group rule create --proto tcp --dst-port 22 default
openstack flavor list
openstack image list
openstack network list
openstack security group list
外网
#openstack server create --flavor m1.tiny --image cirros --nic net-id=PROVIDER_NET_ID --security-group default --key-name mykey provider-instance
openstack server list
openstack console url show provider-instance
ssh cirros@203.0.113.103
内网
neutron net-list / openstack network list
openstack server create --flavor m1.tiny --image cirros --nic net-id=a61423e7-4a5f-49d9-856f-1fdcb61c4418 --security-group default --key-name mykey selfservice-instance
openstack console url show selfservice-instance
nova list
ip netns exec qdhcp-a61423e7-4a5f-49d9-856f-1fdcb61c4418 ssh cirros@172.16.1.3
#openstack ip floating create provider
192.168.139.222
#openstack ip floating add 192.168.139.222 selfservice-instance
ssh cirros@192.168.139.222
nova list / openstack server list
nova hypervisor-list
nova service-list
nova-manage cell_v2 discover_hosts
nova-manage cell_v2 list_cells
openstack endpoint list
mcontroller521 192.168.139.185
mcompute521 192.168.139.186
/etc/sysconfig/network-scripts/ifcfg-eth0
##############
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.139.185
NETMASK=255.255.240.0
GATEWAY=192.168.128.1
DNS1=114.114.114.114
##################
/etc/hosts
##############
192.168.139.186 mcompute521
192.168.139.185 mcontroller521
#############
yum remove PackageKit
yum install centos-release-openstack-mitaka -y
yum install https://repos.fedorapeople.org/repos/openstack/openstack-mitaka/rdo-release-mitaka-6.noarch.rpm -y
yum upgrade -y
yum install python-openstackclient openstack-selinux -y
vim /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
yum install mariadb mariadb-server python2-PyMySQL -y
/etc/my.cnf.d/openstack.cnf
########################
[mysqld]
bind-address = 192.168.139.185
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
#######################
systemctl enable mariadb.service
systemctl start mariadb.service
mysql_secure_installation
yum install rabbitmq-server -y
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
rabbitmqctl add_user openstack haoning
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
yum install memcached python-memcached -y
systemctl enable memcached.service
systemctl start memcached.service
mysql -u root -p
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'mcompute521' IDENTIFIED BY 'haoning';
openssl rand -hex 10
276827888f4482e79226
yum install openstack-keystone httpd mod_wsgi -y
/etc/keystone/keystone.conf
###############
[DEFAULT]
admin_token = 276827888f4482e79226
[database]
connection = mysql+pymysql://keystone:haoning@mcontroller521/keystone
[token]
provider = fernet
###############
su -s /bin/sh -c "keystone-manage db_sync" keystone
/etc/httpd/conf/httpd.conf
#########################
ServerName mcontroller521
########################
/etc/httpd/conf.d/wsgi-keystone.conf
#####################
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
###################
systemctl enable httpd.service
systemctl start httpd.service
export OS_TOKEN=276827888f4482e79226
export OS_URL=http://mcontroller521:35357/v3
export OS_IDENTITY_API_VERSION=3
openstack service create --name keystone --description "OpenStack Identity" identity
openstack endpoint create --region wuhan identity public http://mcontroller521:5000/v3
openstack endpoint create --region wuhan identity internal http://mcontroller521:5000/v3
openstack endpoint create --region wuhan identity admin http://mcontroller521:35357/v3
openstack domain create --description "Default Domain" default
openstack project create --domain default --description "Admin Project" admin
openstack user create --domain default --password-prompt admin
openstack role create admin
openstack role add --project admin --user admin admin
openstack project create --domain default --description "Service Project" service
openstack project create --domain default --description "Demo Project" demo
openstack user create --domain default --password-prompt demo
openstack role create user
openstack role add --project demo --user demo user
openstack domain list
openstack project list
openstack user list
openstack role list
unset OS_TOKEN OS_URL
openstack --os-auth-url http://mcontroller521:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token issue
openstack --os-auth-url http://mcontroller521:5000/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name demo --os-username demo token issue
admin-openrc
###############
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://mcontroller521:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
#################
demo-openrc
#################
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://mcontroller521:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
#################
★★★★★★★安装glance
mysql -u root -p
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'mcompute521' IDENTIFIED BY 'haoning';
openstack user create --domain default --password-prompt glance
openstack role add --project service --user glance admin
openstack service create --name glance --description "OpenStack Image" image
openstack endpoint create --region wuhan image public http://mcontroller521:9292
openstack endpoint create --region wuhan image internal http://mcontroller521:9292
openstack endpoint create --region wuhan image admin http://mcontroller521:9292
openstack endpoint list
yum install openstack-glance -y
/etc/glance/glance-api.conf
##################
[database]
connection = mysql+pymysql://glance:haoning@mcontroller521/glance
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = haoning
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
##################
/etc/glance/glance-registry.conf
############################
[database]
connection = mysql+pymysql://glance:haoning@mcontroller521/glance
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = haoning
[paste_deploy]
flavor = keystone
###########################
su -s /bin/sh -c "glance-manage db_sync" glance
systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
openstack image list
★★★★★★★Install and configure controller node
mysql -u root -p
CREATE DATABASE nova_api;
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'mcompute521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'mcompute521' IDENTIFIED BY 'haoning';
openstack user create --domain default --password-prompt nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region wuhan compute public http://mcontroller521:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region wuhan compute internal http://mcontroller521:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region wuhan compute admin http://mcontroller521:8774/v2.1/%\(tenant_id\)s
yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler -y
/etc/nova/nova.conf
#####################
[DEFAULT]
enabled_apis = osapi_compute,metadata
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.139.185
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
connection = mysql+pymysql://nova:haoning@mcontroller521/nova_api
[database]
connection = mysql+pymysql://nova:haoning@mcontroller521/nova
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = haoning
[vnc]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[glance]
api_servers = http://mcontroller521:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
#####################
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova
systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
★★★★★★★★Install and configure a compute node
yum install openstack-nova-compute -y
/etc/nova/nova.conf
################
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.139.186
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://mcontroller521:6080/vnc_auto.html
[glance]
api_servers = http://mcontroller521:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[libvirt]
virt_type = qemu
##################
egrep -c '(vmx|svm)' /proc/cpuinfo
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
openstack compute service list
neutron★★★★★★★★★★★★Install and configure controller node
mysql -u root -p
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'mcontroller521' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'mcompute521' IDENTIFIED BY 'haoning';
openstack user create --domain default --password-prompt neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region wuhan network public http://mcontroller521:9696
openstack endpoint create --region wuhan network internal http://mcontroller521:9696
openstack endpoint create --region wuhan network admin http://mcontroller521:9696
★★★★★★Networking Option 1: Provider networks
yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables -y
/etc/neutron/neutron.conf
################
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
rpc_backend = rabbit
auth_strategy = keystone
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
[database]
connection = mysql+pymysql://neutron:haoning@mcontroller521/neutron
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = haoning
[nova]
auth_url = http://mcontroller521:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = nova
password = haoning
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
###################
/etc/neutron/plugins/ml2/ml2_conf.ini
##############
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[ml2_type_vxlan]
vni_ranges = 1:1000
[securitygroup]
enable_ipset = True
###############################
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
###########################
[linux_bridge]
physical_interface_mappings = provider:eth0
[vxlan]
enable_vxlan = True
local_ip = 192.168.139.185
l2_population = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
############################
/etc/neutron/l3_agent.ini
##############################
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
##############################
/etc/neutron/dhcp_agent.ini
#########################
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
/etc/neutron/metadata_agent.ini
###########################
[DEFAULT]
nova_metadata_ip = mcontroller521
metadata_proxy_shared_secret = haoning
###########################
/etc/nova/nova.conf
################################
[neutron]
url = http://mcontroller521:9696
auth_url = http://mcontroller521:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = neutron
password = haoning
service_metadata_proxy = True
metadata_proxy_shared_secret = haoning
#############################
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
systemctl restart openstack-nova-api.service
systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl enable neutron-l3-agent.service
systemctl start neutron-l3-agent.service
neutron★★★★★★Install and configure compute node
yum install openstack-neutron-linuxbridge ebtables ipset -y
/etc/neutron/neutron.conf
#####################
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
[oslo_messaging_rabbit]
rabbit_host = mcontroller521
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcontroller521:5000
auth_url = http://mcontroller521:35357
memcached_servers = mcontroller521:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = haoning
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
##################################################
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
###########################
[linux_bridge]
physical_interface_mappings = provider:eth0
[vxlan]
enable_vxlan = True
local_ip = 192.168.139.186
l2_population = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
#############################
/etc/nova/nova.conf
###################
[neutron]
url = http://mcontroller521:9696
auth_url = http://mcontroller521:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = neutron
password = haoning
####################
systemctl restart openstack-nova-compute.service
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
neutron ext-list
neutron agent-list
★★★★★★★建个vm
neutron net-create --shared --provider:physical_network provider --provider:network_type flat provider
neutron subnet-create --name provider --allocation-pool start=192.168.139.220,end=192.168.139.225 --dns-nameserver 8.8.8.8 --gateway 192.168.128.1 provider 192.168.128.0/20
neutron net-create selfservice
neutron subnet-create --name selfservice --dns-nameserver 8.8.4.4 --gateway 172.16.1.1 selfservice 172.16.1.0/24
neutron net-update provider --router:external
neutron router-create router
neutron router-interface-add router selfservice
neutron router-gateway-set router provider
neutron port-list
neutron router-port-list router
openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
ssh-keygen -q -N ""
openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey
openstack keypair list
openstack security list
openstack security group rule create --proto icmp default
openstack security group rule create --proto tcp --dst-port 22 default
openstack flavor list
openstack image list
openstack network list
openstack security group list
外网
#openstack server create --flavor m1.tiny --image cirros --nic net-id=PROVIDER_NET_ID --security-group default --key-name mykey provider-instance
openstack server list
openstack console url show provider-instance
ssh cirros@203.0.113.103
内网
neutron net-list / openstack network list
openstack server create --flavor m1.tiny --image cirros --nic net-id=a61423e7-4a5f-49d9-856f-1fdcb61c4418 --security-group default --key-name mykey selfservice-instance
openstack console url show selfservice-instance
nova list
ip netns exec qdhcp-a61423e7-4a5f-49d9-856f-1fdcb61c4418 ssh cirros@172.16.1.3
#openstack ip floating create provider
192.168.139.222
#openstack ip floating add 192.168.139.222 selfservice-instance
ssh cirros@192.168.139.222
nova list / openstack server list
nova hypervisor-list
nova service-list
nova-manage cell_v2 discover_hosts
nova-manage cell_v2 list_cells
openstack endpoint list
发表评论
-
建立tap设备的c的代码
2019-01-08 19:09 474tapper.c #include <stdio.h& ... -
br0和tap0的互相影响
2019-01-02 19:17 815转载 http://www.cnblogs.com/wlei/ ... -
M版openstack(ovs,dvr,动态迁移)
2017-06-09 10:30 1788主要内容 1.先搭建三个节点的环境,dvr模式 2.建一个vm ... -
vxlan多台主机的vm之间不同网段互通
2016-09-19 21:06 4373组播: 试验: 在三台机器上 192.168.139.251 ... -
vxlan多台主机的vm之间相同网段互通
2016-09-19 16:30 2239三台机器 建立namespace ... -
qemu用tap方式启动vm的网络试验(ip route)
2016-09-14 11:29 2806ip route add 192.168.8.0/24 via ... -
openstack的topo图
2016-09-07 14:07 630http://haoningabc.iteye.com/blo ... -
openstack的M版本的neutron的实验
2016-09-01 20:00 3131试验步骤: 1.创建内部 ... -
openstack的M版本安装
2016-08-17 13:33 1058参考 http://docs.openstack.org/mi ... -
can't initialize iptables table错误
2016-04-26 10:05 788can't initialize iptables table ... -
linux下TUN/TAP虚拟网卡的使用
2016-03-31 18:46 4882tun在网络层 tap在二层 ls ... -
openstack L版本(openvswitch的安装和应用)
2016-03-24 15:04 3020参考L版本的linuxbridge的安装方式 和k版本的ov ... -
openstack试验(linux vxlan)
2016-03-22 22:27 2726yum install centos-release-open ... -
backup a libvirt xml
2016-03-18 21:23 569<domain type='kvm' id='2'> ... -
neutron router试验
2016-03-17 20:41 965上接 http://haoningabc.iteye.com/ ... -
openstack L版本(使用linux bridge的vxlan)
2016-03-12 23:35 2378参考 http://docs.openstack.org/li ... -
openstack的L版本安装(flat网络)
2016-03-07 17:55 980参考http://docs.openstack.org ... -
openstack调试 数据库跟踪
2016-03-04 18:07 717查看openstack代码 openstack每个命令之后,数 ... -
neutron基础九(qemu nat网络)
2016-02-06 17:21 1621接上基础八,kvm透传nested忽略 1.在主机ce ... -
neutron基础八(qemu 桥接网络)
2016-02-06 13:13 1544qemu的桥接和nat的qemu启动命令是一样的,但是后续的脚 ...
相关推荐
"OpenStack 使用 Linux Bridge+VXLAN 模式的网络变化与分析" OpenStack 是一个开源的云计算平台,提供了丰富的网络功能,以满足不同的应用场景。其中,Neutron 是 OpenStack 的网络组件,负责管理和维护网络资源。...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
### OpenStack M 版本离线搭建详解 #### 一、概述 OpenStack M 版本,即 OpenStack Mitaka 版本,是 OpenStack 的一个成熟版本之一,广泛应用于私有云建设和管理中。然而,在很多企业的环境中,出于安全考虑,内部...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
手动安装openstack Mitaka版
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
### OpenStack M 版本搭建知识点详解 #### 一、OpenStack架构理解与设计 **OpenStack** 是一个开源的云计算管理平台项目,它提供了一系列的工具和服务来帮助组织搭建和管理自己的私有云和公有云基础设施。...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
1.手动安装 liberty 版本 openstack 环境 2.手动安装 liberty 版本 openstack 环境(allinone)---安装数据库及 rabbitmq 3.手动安装liberty版本openstack环境(allinone)---安装keystone 4.手动安装 liberty 版本 ...
在探讨OpenStack中使用Linux Bridge实现VXLAN网络的过程中,我们将涉及以下几个方面的知识点: 1. OpenStack环境部署和网络组件 OpenStack版本为ocata,系统采用Ubuntu 16.04.2,部署了一个控制节点和一个计算节点...
Linux网桥在OpenStack云计算平台中的应用是一项重要的网络虚拟化技术。在OpenStack中,网桥被用来桥接物理网络接口和虚拟机,或者多个虚拟机之间的网络通信。理解Linux网桥的原理和工作机制对于深入理解OpenStack的...
CentOS6.3下制作可以在OpenStack运行的Linux系统模版
openstack-M资源包 |--cirros-0.3.4-x86_64-disk.img |--local_settings |--openstack_compute_install.sh |--openstack_rpm.tar.gz |--openstack-manuals_html.tar.gz |--openstack-mitaka-autoinstall.sh |--user_...
OpenStack Icehouse版本安装指南是一份指导性文档,它详细描述了如何在Ubuntu 12.04或Ubuntu 14.04 LTS(长期支持版)操作系统上安装OpenStack Icehouse版本的步骤和配置要求。OpenStack Icehouse是OpenStack项目的...
OpenStack F版本源码安装是针对云计算平台OpenStack的一个特定版本——F版本的源代码部署过程。OpenStack是一个开源的云计算管理平台项目,由NASA和Rackspace合作发起,旨在提供一个可以部署和管理大规模计算环境的...
OpenStack的网络架构基于Linux桥接和iptables规则,因此需要安装必要的包来支持Bridge功能。在Essex版本中,用户需要手动配置网络桥接以连接虚拟机实例到物理网络。 安装过程还包括其他组件,如Nova(计算服务)、...
官方离线安装包,亲测可用
openstack-q版本镜像下载地址