当搭建完openstack之后,在创建instance之前,第一件事情就是创建network,一个经典的流程如下:

TENANT_NAME="openstack"
TENANT_NETWORK_NAME="openstack-net"
TENANT_SUBNET_NAME="${TENANT_NETWORK_NAME}-subnet"
TENANT_ROUTER_NAME="openstack-router"
FIXED_RANGE="NEUTRON_FIXED_RANGE"
NETWORK_GATEWAY="NEUTRON_NETWORK_GATEWAY"

PUBLIC_GATEWAY="NEUTRON_PUBLIC_GATEWAY"
PUBLIC_RANGE="NEUTRON_PUBLIC_RANGE"
PUBLIC_START="NEUTRON_PUBLIC_START"
PUBLIC_END="NEUTRON_PUBLIC_END"

(1) 创建private network和subnet

TENANT_ID=$(keystone tenant-list | grep " $TENANT_NAME " | awk '{print $2}')

TENANT_NET_ID=$(neutron net-create --tenant_id $TENANT_ID $TENANT_NETWORK_NAME --provider:network_type gre --provider:segmentation_id 1 | grep " id " | awk '{print $4}')

TENANT_SUBNET_ID=$(neutron subnet-create --tenant_id $TENANT_ID --ip_version 4 --name $TENANT_SUBNET_NAME $TENANT_NET_ID $FIXED_RANGE --gateway $NETWORK_GATEWAY --dns_nameservers list=true 8.8.8.8 | grep " id " | awk '{print $4}')

当仅有private network的时候,会对这个private network创建一个DHCP Server

所以DHCP Agent会执行下面的命令:

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip -o link show tap452bdfab-31

这个命令试图从dhcp的namespace里面查找dhcp的网卡,但是很可惜找不到,返回error

Cannot open network namespace "qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0": No such file or directory

于是试图创建dhcp server的网卡,这个网卡会attach到br-int上,所以先查看br-int

ip -o link show br-int

如果br-int没有问题,于是创建dhcp server的网卡,并且attach到br-int上

ovs-vsctl -- --if-exists del-port tap452bdfab-31 -- add-port br-int tap452bdfab-31 -- set Interface tap452bdfab-31 type=internal -- set Interface tap452bdfab-31 external-ids:iface-id=452bdfab-3152-44d0-bd9c-40c94a6f8640 -- set Interface tap452bdfab-31 external-ids:iface-status=active -- set Interface tap452bdfab-31 external-ids:attached-mac=fa:16:3e:d7:08:67

为网卡设置mac

ip link set tap452bdfab-31 address fa:16:3e:d7:08:67

查看当前存在的namespace

ip -o netns list

返回

qrouter-26a45e0e-a58a-443b-a972-d62c0c5a1323

qdhcp-760d2c5e-4938-49b0-bffe-c77c5b141d18

发现没有这个dhcp所对应的namespace,需要创建一个

ip netns add qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0

将io网卡设置为up

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip link set lo up

将新建的dhcp server的网卡放在这个namespace里面

ip link set tap452bdfab-31 netns qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0

将DHCP server的网卡设置为up

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip link set tap452bdfab-31 up

查看这个网卡的ip地址

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip addr show tap452bdfab-31 permanent scope global

为这个网卡配置ip地址

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip -4 addr add 192.168.10.3/24 brd 192.168.10.255 scope global dev tap452bdfab-31

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip -4 addr add 169.254.169.254/16 brd 169.254.255.255 scope global dev tap452bdfab-31

第一个地址是dhcp server的地址,第二个地址是metadata server的地址

查看路由表

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip route list dev tap452bdfab-31

169.254.0.0/16  proto kernel  scope link  src 169.254.169.254

192.168.10.0/24  proto kernel  scope link  src 192.168.10.3

添加路由表

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip route replace default via 192.168.10.1 dev tap452bdfab-31

查看网卡的配置

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip addr show tap452bdfab-31

232: tap452bdfab-31: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default

link/ether fa:16:3e:d7:08:67 brd ff:ff:ff:ff:ff:ff

inet 192.168.10.3/24 brd 192.168.10.255 scope global tap452bdfab-31

valid_lft forever preferred_lft forever

inet 169.254.169.254/16 brd 169.254.255.255 scope global tap452bdfab-31

valid_lft forever preferred_lft forever

inet6 fe80::f816:3eff:fed7:867/64 scope link tentative

valid_lft forever preferred_lft forever

启动dhcp server

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 env NEUTRON_NETWORK_ID=66b9930b-2871-414c-8c6f-991a6a8cffe0 dnsmasq --no-hosts --no-resolv --strict-order --bind-interfaces --interface=tap452bdfab-31 --except-interface=lo --pid-file=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/host --addn-hosts=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/opts --leasefile-ro --dhcp-range=set:tag0,192.168.10.0,static,86400s --dhcp-lease-max=256 --conf-file= --domain=openstacklocal

启动metadata proxy

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 neutron-ns-metadata-proxy --pid_file=/var/lib/neutron/external/pids/66b9930b-2871-414c-8c6f-991a6a8cffe0.pid --metadata_proxy_socket=/var/lib/neutron/metadata_proxy --network_id=66b9930b-2871-414c-8c6f-991a6a8cffe0 --state_path=/var/lib/neutron --metadata_port=80 --debug --verbose --log-file=neutron-ns-metadata-proxy-66b9930b-2871-414c-8c6f-991a6a8cffe0.log --log-dir=/var/log/neutron

最后查看一下网卡配置

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip addr show tap452bdfab-31

kill -HUP 17666

这个PID是什么呢?

# ps aux | grep 17666
nobody   17666  0.0  0.0  28204  1112 ?        S    Jul14   0:00 dnsmasq --no-hosts --no-resolv --strict-order --bind-interfaces --interface=tap452bdfab-31 --except-interface=lo --pid-file=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/host --addn-hosts=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/66b9930b-2871-414c-8c6f-991a6a8cffe0/opts --leasefile-ro --dhcp-range=set:tag0,192.168.10.0,static,86400s --dhcp-lease-max=256 --conf-file= --domain=openstacklocal

原来是我们的dhcp server

这个命令的作用是:如果想要更改配置而不需停止并重新启动服务,请使用该命令。在对配置文件作必要的更改后,发出该命令以动态更新服务配置。

最后查看一下路由配置

ip netns exec qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0 ip route list dev tap452bdfab-31

(2) 创建一个router,并且和private network相连

ROUTER_ID=$(neutron router-create --tenant_id $TENANT_ID $TENANT_ROUTER_NAME | grep " id " | awk '{print $4}')

neutron router-interface-add $ROUTER_ID $TENANT_SUBNET_ID

查看br-ex

ip -o link show br-ex

59: br-ex: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default

link/ether a0:48:1c:ab:df:b5 brd ff:ff:ff:ff:ff:ff

查看所有的namespace

ip -o netns list

qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0

qrouter-26a45e0e-a58a-443b-a972-d62c0c5a1323

qdhcp-760d2c5e-4938-49b0-bffe-c77c5b141d18

发现没有这个router的namespace,创建一个

ip netns add qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82

将io网卡设为up

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip link set lo up

这是一个router,所以enable ip forward

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 sysctl -w net.ipv4.ip_forward=1

初始化iptables

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 iptables-save –c

# Generated by iptables-save v1.4.21 on Thu Jul 17 01:37:57 2014

*nat

:PREROUTING ACCEPT [0:0]

:INPUT ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:POSTROUTING ACCEPT [0:0]

COMMIT

# Completed on Thu Jul 17 01:37:57 2014

# Generated by iptables-save v1.4.21 on Thu Jul 17 01:37:57 2014

*mangle

:PREROUTING ACCEPT [0:0]

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:POSTROUTING ACCEPT [0:0]

COMMIT

# Completed on Thu Jul 17 01:37:57 2014

# Generated by iptables-save v1.4.21 on Thu Jul 17 01:37:57 2014

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

COMMIT

# Completed on Thu Jul 17 01:37:57 2014

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 iptables-restore –c

启动metadata proxy

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 neutron-ns-metadata-proxy --pid_file=/var/lib/neutron/external/pids/d62d417d-2005-46d7-a83b-b1e5c0a36d82.pid --metadata_proxy_socket=/var/lib/neutron/metadata_proxy --router_id=d62d417d-2005-46d7-a83b-b1e5c0a36d82 --state_path=/var/lib/neutron --metadata_port=9697 --debug --verbose --log-file=neutron-ns-metadata-proxy-d62d417d-2005-46d7-a83b-b1e5c0a36d82.log --log-dir=/var/log/neutron

查看router的网卡

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip -o link show qr-29003a09-e7

但是网卡不存在

Device "qr-29003a09-e7" does not exist.

查看br-int,router的网卡会attach到这个网卡上

ip -o link show br-int

58: br-int: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default

link/ether 0a:9b:c6:54:ef:46 brd ff:ff:ff:ff:ff:ff

创建router的网卡,并且attach到br-int

ovs-vsctl -- --if-exists del-port qr-29003a09-e7 -- add-port br-int qr-29003a09-e7 -- set Interface qr-29003a09-e7 type=internal -
- set Interface qr-29003a09-e7 external-ids:iface-id=29003a09-e787-49dd-b5f4-11ad107159c7 -- set Interface qr-29003a09-e7 external-ids:iface-status=active -- set Interface qr-29003a09-e7 external-ids:attached-mac=fa:16:3e:84:6e:cc

设置router网卡的mac

ip link set qr-29003a09-e7 address fa:16:3e:84:6e:cc

查看所有的namespace

ip -o netns list

qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82

qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0

qrouter-26a45e0e-a58a-443b-a972-d62c0c5a1323

qdhcp-760d2c5e-4938-49b0-bffe-c77c5b141d18

有这个router的namespace

将这个网卡放在这个namespace里面

ip link set qr-29003a09-e7 netns qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82

将router的网卡设为up

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip link set qr-29003a09-e7 up

查看网卡的地址

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip addr show qr-29003a09-e7 permanent scope global

设置网卡的地址

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip -4 addr add 192.168.10.1/24 brd 192.168.10.255 scope global dev qr-2
9003a09-e7

查看所有的网卡

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip -o -d link list

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0

241: qr-29003a09-e7: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default

link/ether fa:16:3e:84:6e:cc brd ff:ff:ff:ff:ff:ff promiscuity 1

(3) 创建外网,并且连接到router

neutron net-create public --router:external=True

neutron subnet-create --ip_version 4 --gateway $PUBLIC_GATEWAY public $PUBLIC_RANGE --allocation-pool start=$PUBLIC_START,end=$PUBLIC_END --disable-dhcp --name public-subnet

neutron router-gateway-set ${TENANT_ROUTER_NAME} public

查看br-ex

ip -o link show br-ex

59: br-ex: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default

link/ether a0:48:1c:ab:df:b5 brd ff:ff:ff:ff:ff:ff

列出所有的网卡

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip -o -d link list

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0

241: qr-29003a09-e7: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default

link/ether fa:16:3e:84:6e:cc brd ff:ff:ff:ff:ff:ff promiscuity 1

查看qg网卡

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip -o link show qg-556ca938-e1

但是网卡不存在

Device "qg-556ca938-e1" does not exist.

查看br-ex

ip -o link show br-ex

创建新的网卡qg,attach到br-ex

ovs-vsctl -- --if-exists del-port qg-556ca938-e1 -- add-port br-ex qg-556ca938-e1 -- set Interface qg-556ca938-e1 type=internal -- set Interface qg-556ca938-e1 external-ids:iface-id=556ca938-e11b-4246-bdc1-ef25c91b7593 -- set Interface qg-556ca938-e1 external-ids:iface-status=active -- set Interface qg-556ca938-e1 external-ids:attached-mac=fa:16:3e:68:12:c0

设置网卡mac

ip link set qg-556ca938-e1 address fa:16:3e:68:12:c0

查看所有的namespace

ip -o netns list

qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82

qdhcp-66b9930b-2871-414c-8c6f-991a6a8cffe0

qrouter-26a45e0e-a58a-443b-a972-d62c0c5a1323

qdhcp-760d2c5e-4938-49b0-bffe-c77c5b141d18

将qg网卡设置到namespace中

ip link set qg-556ca938-e1 netns qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82

将网卡设置为up

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip link set qg-556ca938-e1 up

查看网卡地址

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip addr show qg-556ca938-e1 permanent scope global

设置网卡地址

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip -4 addr add 16.158.165.105/22 brd 16.158.167.255 scope global dev qg
-556ca938-e1

添加router表

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 route add default gw 16.158.164.1

设置iptables

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 iptables-save –c

# Generated by iptables-save v1.4.21 on Thu Jul 17 01:58:30 2014

*nat

:PREROUTING ACCEPT [4:425]

:INPUT ACCEPT [1:229]

:OUTPUT ACCEPT [0:0]

:POSTROUTING ACCEPT [0:0]

:neutron-l3-agent-OUTPUT - [0:0]

:neutron-l3-agent-POSTROUTING - [0:0]

:neutron-l3-agent-PREROUTING - [0:0]

:neutron-l3-agent-float-snat - [0:0]

:neutron-l3-agent-snat - [0:0]

:neutron-postrouting-bottom - [0:0]

[4:425] -A PREROUTING -j neutron-l3-agent-PREROUTING

[0:0] -A OUTPUT -j neutron-l3-agent-OUTPUT

[0:0] -A POSTROUTING -j neutron-l3-agent-POSTROUTING

[0:0] -A POSTROUTING -j neutron-postrouting-bottom

[0:0] -A neutron-l3-agent-PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 9697

[0:0] -A neutron-l3-agent-snat -jneutron-l3-agent-float-snat

[0:0] -A neutron-postrouting-bottom -j neutron-l3-agent-snat

COMMIT

# Completed on Thu Jul 17 01:58:30 2014

# Generated by iptables-save v1.4.21 on Thu Jul 17 01:58:30 2014

*mangle

:PREROUTING ACCEPT [4:425]

:INPUT ACCEPT [1:229]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:POSTROUTING ACCEPT [0:0]

COMMIT

# Completed on Thu Jul 17 01:58:30 2014

# Generated by iptables-save v1.4.21 on Thu Jul 17 01:58:30 2014

*filter

:INPUT ACCEPT [1:229]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:neutron-filter-top - [0:0]

:neutron-l3-agent-FORWARD - [0:0]

:neutron-l3-agent-INPUT - [0:0]

:neutron-l3-agent-OUTPUT - [0:0]

:neutron-l3-agent-local - [0:0]

[1:229] -A INPUT -j neutron-l3-agent-INPUT

[0:0] -A FORWARD -j neutron-filter-top

[0:0] -A FORWARD -j neutron-l3-agent-FORWARD

[0:0] -A OUTPUT -j neutron-filter-top

[0:0] -A OUTPUT -j neutron-l3-agent-OUTPUT

[0:0] -A neutron-filter-top -j neutron-l3-agent-local

[0:0] -A neutron-l3-agent-INPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 9697 -j ACCEPT

COMMIT

# Completed on Thu Jul 17 01:58:30 2014

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 iptables-restore –c

显示网卡信息

ip netns exec qrouter-d62d417d-2005-46d7-a83b-b1e5c0a36d82 ip addr show qg-556ca938-e1

242: qg-556ca938-e1: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default

link/ether fa:16:3e:68:12:c0 brd ff:ff:ff:ff:ff:ff

inet 16.158.165.105/22 brd 16.158.167.255 scope global qg-556ca938-e1

valid_lft forever preferred_lft forever

inet6 fe80::f816:3eff:fe68:12c0/64 scope link tentative

valid_lft forever preferred_lft forever

转自http://www.cnblogs.com/popsuper1982/p/3849822.html

neutron创建network执行的那些命令的更多相关文章

  1. 使用jar命令打jar/war包、创建可执行jar包、运行jar包、及批处理脚本编写

    jar 命令 jar 是一个jar.exe可执行命令,即可以生成jar文件,也可以生成war文件   使用示例:jar -cvf ../xxx.jar *  -c   create,创建新的归档文档 ...

  2. Neutron 理解 (1): Neutron 所实现的网络虚拟化 [How Neutron Virtualizes Network]

    学习 Neutron 系列文章: (1)Neutron 所实现的网络虚拟化 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  3. BSA Network Shell系列-nexec命令

    # nexec ## 1 说明:nexec是远程命令接口引擎 ,用于在远程主机执行命令 nexec [-?] [-t term] [-o] [-i] [-l] [-nohup hostname &qu ...

  4. Neutron vxlan network

    OpenStack 还支持 vxlan 和 gre 这两种 overlay network.   overlay network 是指建立在其他网络上的网络. 该网络中的节点可以看作通过虚拟(或逻辑) ...

  5. Neutron Vlan Network 学习

    vlan network 是带 tag 的网络,是实际应用最广泛的网络类型.    下图是 vlan100 网络的示例.   1. 三个 instance 通过 TAP 设备连接到名为 brqXXXX ...

  6. Neutron flat network 学习

    flat network 是不带 tag 的网络,要求宿主机的物理网卡直接与 linux bridge 连接,这意味着: 每个 flat network 都会独占一个物理网卡.   在 ML2 配置中 ...

  7. 创建maven项目(cmd 命令)

    2016五月 22 原 创建maven项目(cmd 命令) 分类:maven (994) (0) 1.普通方式创建 1)进入cmd窗口执行 mvn archetype:generate 2) 光标停止 ...

  8. (八)Eclipse创建Maven项目运行mvn命令

    1.Eclipse创建Maven项目 使用Eclipse创建一个Maven项目非常的简单,选择菜单项File>New>Other(也可以在项目结构空白处右击鼠标键),在弹出的对话框中选择M ...

  9. Neutron Vlan Network 原理- 每天5分钟玩转 OpenStack(92)

    前面我们陆续学习了 Neutron local network,flat network 和 DHCP 服务,从本节将开始讨论 vlan network. vlan network 是带 tag 的网 ...

随机推荐

  1. MyBatis关联查询 (association) 时遇到的某些问题/mybatis映射

    先说下问题产生的背景: 最近在做一个用到MyBatis的项目,其中有个业务涉及到关联查询,我是将两个查询分开来写的,即嵌套查询,个人感觉这样更方便重用: 关联的查询使用到了动态sql,在执行查询时就出 ...

  2. POJ 3216 最小路径覆盖+floyd

    Repairing Company Time Limit: 1000MS   Memory Limit: 131072K Total Submissions: 6646   Accepted: 178 ...

  3. 自动装配Bean

    Spring提供了几种技巧,可以减少XML的配置数量: 自动装配(autowiring):可以减少<property>(setter注入)和<constructor-arg>( ...

  4. Rhel6-DM多路经存储配置文档

    系统环境: rhel6 x86_64 iptables and selinux disabled 主机: 主机 网卡 软件 server21.example.com eth0:192.168.122. ...

  5. yarn 0.9.0 build spark

    1. 下载scala并安装.版本为2.10.3.设置SCALA_HOME和PATH环境变量 2. 下载SPARK 0.9.0源代码并解压到/root/Downloads/spark-0.9.0-inc ...

  6. Python使用CGIHTTPServer调用shell作为cgi脚本

    #!/bin/bash echo "Content-Type:text/html" echo "" echo "hello world!" ...

  7. HM NIS Edit 2.0.3 Win32 Error. Code:740.请求的操作需要提升

    使用NSIS安装向导,生成脚本后,按F9后,居然提示:HM NIS Edit 2.0.3 Win32 Error. Code:740.请求的操作需要提升 一开始就出错了,还真不顺. 在网上搜索了一下, ...

  8. Android Sudoku应用挂掉的问题

    在真机上测试数独游戏时发现,快速点击屏幕时,游戏偶尔出现挂死的情况,Log如下 04-08 15:35:00.838 7317-7356/org.elvalad.sudoku D/OpenGLRend ...

  9. windows核心编程---第四章 进程

    上一章介绍了内核对象,这一节开始就要不断接触各种内核对象了.首先要给大家介绍的是进程内核对象.进程大家都不陌生,它是资源和分配的基本单位,而进程内核对象就是与进程相关联的一个数据结构.操作系统内核通过 ...

  10. IOS7 SDK 几宗罪

    IOS7 app 默认是全屏模式,所以之前的程序窗口会上向移动到状态栏上面,所以在底边会有一条大白边 表格单元格,默认是白色背景,之前程序设置的透明效果,这里不在起作用,需要用下面的委托方法改变.- ...