登陆
用户demo登陆
那么我们就手动启动一下。
[root@linux-node1 ~]# neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini
这样的话,就能排除问题。
[root@linux-node1 ~]# neutron net-list
[root@linux-node1 ~]# neutron port-list
看一下租户id
[root@linux-node1 ~]# keystone tenant-list
+----------------------------------+-------+---------+
| id | name | enabled |
+----------------------------------+-------+---------+
| cdbb9a7dcd044328a7969bc8069624ae | admin | True |
| ed844c55ff2a45da880c818e356f8a71 | demo | True |
+----------------------------------+-------+---------+
[root@linux-node1 ~]# neutron net-create --tenant-id ed844c55ff2a45da880c818e356f8a71 demo-net --shared --provider:network_type flat --provider:physical_network physnet1
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | 39513fa0-5409-42e0-9d2c-9b2ced0e8322 |
| name | demo-net |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | |
| shared | True |
| status | ACTIVE |
| subnets | |
| tenant_id | ed844c55ff2a45da880c818e356f8a71 |
+---------------------------+--------------------------------------+
查看一下
[root@linux-node1 ~]# neutron net-list
+--------------------------------------+----------+---------+
| id | name | subnets |
+--------------------------------------+----------+---------+
| 39513fa0-5409-42e0-9d2c-9b2ced0e8322 | demo-net | |
+--------------------------------------+----------+---------+
除单一扁平网络用网络创建外,其它都可以用dash创建
大家可以看子网没有创建,其实命令都能创建,但是我们还是用dashbaod
[root@linux-node1 ~]# neutron net-list
+--------------------------------------+----------+---------+
| id | name | subnets |
+--------------------------------------+----------+---------+
| 39513fa0-5409-42e0-9d2c-9b2ced0e8322 | demo-net | |
+--------------------------------------+----------+---------+
我们在dash看一下
那么我们来创建网络
然后咱们在用demo用户登陆一下
接下来,做第二台虚拟机
因为这个虚拟机是用其它虚拟机克隆出来的,所以需要
[root@demo ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.33.12
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
[root@demo ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
IPV6INIT=no
USERCTL=no
[root@demo ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:D5:C0:22
inet addr:192.168.33.12 Bcast:192.168.33.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed5:c022/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:641 errors:0 dropped:0 overruns:0 frame:0
TX packets:237 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:61007 (59.5 KiB) TX bytes:23755 (23.1 KiB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:D5:C0:2C
inet addr:192.168.224.131 Bcast:192.168.224.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed5:c02c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2663 (2.6 KiB) TX bytes:1962 (1.9 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:633 (633.0 b) TX bytes:633 (633.0 b)
[root@demo ~]# ping wwww.baidu.com
PING ps_other.a.shifen.com (123.125.114.144) 56(84) bytes of data.
64 bytes from 123.125.114.144: icmp_seq=1 ttl=128 time=6.32 ms
64 bytes from 123.125.114.144: icmp_seq=2 ttl=128 time=7.25 ms
^C
--- ps_other.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1404ms
rtt min/avg/max/mdev = 6.326/6.788/7.251/0.469 ms
[root@demo ~]# vim /etc/sysconfig/selinux
[root@demo ~]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@demo ~]# chkconfig iptables off
[root@demo ~]# vim /etc/sysconfig/network
[root@demo ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=linux-node2.openstack.com
[root@demo ~]# vim /etc/host
[root@demo ~]# vim /etc/hosts
[root@demo ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.33.11 linux-node1.openstack.com
192.168.33.12 linux-node2.openstack.com
[root@demo ~]# rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.Wtk9LM: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@demo ~]# yum install -y python-pip gcc gcc-c++ make libtool patch automake python-devel libxslt-devel MySQL-python openssl-devel libudev-devel git wget libvirt-python libvirtqemu-kvm gedit python-numdisplay device-mapper bridge-utils libffi-devel libffi lrzsz
接下来,我们从linux-node1节点上往计算节点上传neutron,为此我们要保证这两个服务器之间的通信的。
[root@linux-node1 ~]# ping 192.168.33.12
PING 192.168.33.12 (192.168.33.12) 56(84) bytes of data.
64 bytes from 192.168.33.12: icmp_seq=1 ttl=64 time=1.18 ms
64 bytes from 192.168.33.12: icmp_seq=2 ttl=64 time=0.955 ms
^C
--- 192.168.33.12 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1435ms
rtt min/avg/max/mdev = 0.955/1.068/1.181/0.113 ms
[root@linux-node1 ~]# cd /usr/local/src/
[root@linux-node1 src]# ll
总用量 25136
drwxrwxr-x 8 1004 1004 4096 4月 17 18:16 cinder-2014.1
-rw-r--r-- 1 root root 4624288 4月 17 18:20 cinder-2014.1.tar.gz
drwxrwxr-x 8 1004 1004 4096 8月 18 22:14 glance-2014.1
-rw-r--r-- 1 root root 2111279 4月 17 19:39 glance-2014.1.tar.gz
-rw-r--r-- 1 root root 3208738 4月 17 19:13 horizon-2014.1.tar.gz
drwxrwxr-x 11 1004 1004 4096 8月 18 19:08 keystone-2014.1
-rw-r--r-- 1 root root 1419245 4月 17 17:23 keystone-2014.1.tar.gz
drwxrwxr-x 10 1004 1004 4096 8月 19 08:09 neutron-2014.1
-rw-r--r-- 1 root root 6386204 4月 17 19:54 neutron-2014.1.tar.gz
drwxrwxr-x 10 1004 1004 4096 8月 19 05:20 nova-2014.1
-rw-r--r-- 1 root root 7951303 4月 17 18:07 nova-2014.1.tar.gz
-rw-r--r-- 1 root root 1578 8月 18 17:35 openstack.txt
[root@linux-node1 src]# scp nova-2014.1.tar.gz neutron-2014.1.tar.gz 192.168.33.12:/usr/local/src
The authenticity of host '192.168.33.12 (192.168.33.12)' can't be established.
RSA key fingerprint is 19:2c:d3:93:d2:cc:86:87:3b:df:71:e4:76:56:70:8a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.33.12' (RSA) to the list of known hosts.
Address 192.168.33.12 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
[email protected]'s password:
nova-2014.1.tar.gz 100% 7765KB 7.6MB/s 00:00
neutron-2014.1.tar.gz 100% 6237KB 6.1MB/s 00:00
[root@linux-node2 ~]# cd /usr/local/src/
[root@linux-node2 src]# ll
总用量 14008
-rw-r--r-- 1 root root 6386204 8月 21 19:26 neutron-2014.1.tar.gz
-rw-r--r-- 1 root root 7951303 8月 21 19:26 nova-2014.1.tar.gz
[root@linux-node2 src]# mkdir /var/log/neutron
[root@linux-node2 src]# mkdir /var/log/nova
[root@linux-node2 src]# mkdir /var/lib/nova
[root@linux-node2 src]# mkdir /var/lib/neutron
[root@linux-node2 src]# mkdir /var/run/neutron
[root@linux-node2 src]# mkdir /var/run/nova
[root@linux-node2 ~]# mkdir /var/lib/nova/instances
[root@linux-node1 ~]# scp -r /etc/nova/ /etc/neutron/ 192.168.33.12:/etc/
[root@linux-node2 src]# ll
总用量 14008
-rw-r--r-- 1 root root 6386204 8月 21 19:26 neutron-2014.1.tar.gz
-rw-r--r-- 1 root root 7951303 8月 21 19:26 nova-2014.1.tar.gz
[root@linux-node2 src]# tar zxf nova-2014.1.tar.gz
[root@linux-node2 src]# tar zxf neutron-2014.1.tar.gz
[root@linux-node2 src]# cd nova-2014.1
[root@linux-node2 nova-2014.1]# pip install -r requirements.txt -i
http://pypi.douban.com/simple
[root@linux-node1 ~]# scp /etc/init.d/openstack-neutron-linuxbridge-agent 192.168.33.12:/etc/init.d/
Address 192.168.33.12 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
[email protected]'s password:
openstack-neutron-linuxbridge-agent 100% 1926 1.9KB/s 00:00
[root@linux-node1 ~]# cd init.d
[root@linux-node1 init.d]# scp openstack-nova-compute 192.168.33.12:/etc/init.d/
Address 192.168.33.12 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
[email protected]'s password:
openstack-nova-compute 100% 1506 1.5KB/s 00:00
[root@linux-node2 nova-2014.1]# cd ~
[root@linux-node2 ~]# ls /etc/init.d/openstack-*
/etc/init.d/openstack-neutron-linuxbridge-agent /etc/init.d/openstack-nova-compute
[root@linux-node2 ~]# chmod +x /etc/init.d/openstack-*
[root@linux-node2 ~]# cd /etc/init.d/
[root@linux-node2 init.d]# chkconfig --add openstack-nova-compute
[root@linux-node2 init.d]# chkconfig --add openstack-neutron-linuxbridge-agent