root@compute:~# virt-install -n controller -r 4096 -c /root/ubuntu-14.04.5-server-amd64.iso --disk
/var/lib/libvirt/images/controller.img,bus=virtio,size=100--graphics vnc,listen=0.0.0.0 --noautoconsole -v
Starting install...
Allocating 'controller.img' | 100 GB 00:00
ERROR Unable toadd bridge br-ex port vnet0: Operation not supported
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start controller
otherwise, please restart your installation.
创建ovs网桥过程:
root@liberty:~# ovs-vsctl add-br br-ex
root@liberty:~# ovs-vsctl show
b90fde22-baca-484c-a60f-025168c0c456
Bridge br-ex
Port br-ex
Interface br-ex
type: internal
ovs_version: "2.0.2"
root@liberty:~# ovs-vsctl list-ports br-ex
root@liberty:~# ip l1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: p4p1: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000link/ether d4:be:d9:be:84:b5 brd ff:ff:ff:ff:ff:ff
3: virbr0: mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000link/ether 12:5a:1d:69:c3:2c brd ff:ff:ff:ff:ff:ff
4: ovs-system: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1link/ether 3a:e8:46:68:cd:43 brd ff:ff:ff:ff:ff:ff
5: br-ex: mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1link/ether 46:56:54:92:bc:4d brd ff:ff:ff:ff:ff:ff
root@liberty:~# ip a1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: p4p1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether d4:be:d9:be:84:b5 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.118/24 brd 192.168.1.255 scope global p4p1
valid_lft forever preferred_lft forever
inet6 fe80::d6be:d9ff:febe:84b5/64 scope link
valid_lft forever preferred_lft forever
3: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 12:5a:1d:69:c3:2c brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: ovs-system: mtu 1500 qdisc noop state DOWN group default qlen 1link/ether 3a:e8:46:68:cd:43 brd ff:ff:ff:ff:ff:ff
5: br-ex: mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1link/ether 46:56:54:92:bc:4d brd ff:ff:ff:ff:ff:ff
inet6 fe80::5c46:eff:febf:e680/64 scope link
valid_lft forever preferred_lft forever
root@liberty:~# ovs-vsctl add-port br-ex p4p1
root@liberty:~# ovs-vsctl show
b90fde22-baca-484c-a60f-025168c0c456
Bridge br-ex
Port "p4p1"
Interface "p4p1"
Port br-ex
Interface br-ex
type: internal
ovs_version: "2.0.2"
root@liberty:~# ip address del 192.168.1.118/24 brd + dev p4p1
root@liberty:~# ip address add 192.168.1.118/24 brd + dev br-ex
root@liberty:~# ip a1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: p4p1: mtu 1500 qdisc pfifo_fast master ovs-systemstate UP group default qlen 1000link/ether d4:be:d9:be:84:b5 brd ff:ff:ff:ff:ff:ff
inet6 fe80::d6be:d9ff:febe:84b5/64 scope link
valid_lft forever preferred_lft forever
3: ovs-system: mtu 1500 qdisc noop state DOWN group default qlen 1link/ether 6e:36:32:94:6e:1f brd ff:ff:ff:ff:ff:ff
4: br-ex: mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1link/ether d4:be:d9:be:84:b5 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.118/24 brd 192.168.1.255 scope global br-ex
valid_lft forever preferred_lft forever
inet6 fe80::78fa:9aff:fe31:5777/64 scope link
valid_lft forever preferred_lft forever
5: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether a2:a2:98:c2:ee:eb brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
root@liberty:~# cat /etc/network/interfaces# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface#auto p4p1#iface p4p1 inet dhcp# auto p4p1# iface p4p1 inet static# address 192.168.1.118# netmask 255.255.255.0# gateway 192.168.1.250# dns-nameserver 202.106.0.20# The primary network interface
auto br-ex
iface br-ex inet static
address 192.168.1.118
netmask 255.255.255.0
gateway 192.168.1.250# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.106.0.20
auto p4p1
iface p4p1 inet manual
up ip address add 0/0 dev $IFACE
up ip link set $IFACE up
down ip link set $IFACE down
root@ctler:~# virsh list
Id Name State
----------------------------------------------------
3 network running
root@ctler:~# brctl show
bridge name bridge id STP enabled interfaces
br-em1 8000.f48e38c294b0 no em1
vnet0
virbr0 8000.fe540079faa3 yes vnet1
root@ctler:~# ip l
1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULTgroupdefault qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: em1: mtu 1500 qdisc mq master br-em1 state UP mode DEFAULTgroupdefault qlen 1000
link/ether f4:8e:38:c2:94:b0 brd ff:ff:ff:ff:ff:ff
4: br-em1: mtu 1500 qdisc noqueue state UP mode DEFAULTgroupdefault qlen 1000
link/ether f4:8e:38:c2:94:b0 brd ff:ff:ff:ff:ff:ff
5: virbr0: mtu 1500 qdisc noqueue state UP mode DEFAULTgroupdefault qlen 1000
link/ether fe:54:00:79:fa:a3 brd ff:ff:ff:ff:ff:ff
9: vnet0: mtu 1500 qdisc pfifo_fast master br-em1 state UNKNOWN mode DEFAULTgroupdefault qlen 1000
link/ether fe:54:00:6b:78:aa brd ff:ff:ff:ff:ff:ff
2.2 创建中的问题
2.2.1 Host does not support virtualization type ‘hvm’
root@compute:~# virt-install -n controller -r 4096 -c /root/ubuntu-14.04.5-server-amd64.iso --disk /var/lib/libvirt/images/controller.img,bus=virtio,size=100 --network bridge=br-ex,model=virtio --graphics vnc,listen=0.0.0.0 --noautoconsole -vERRORHost does not support virtualization type 'hvm'
root@compute:~# virt-install -n controller -r 4096 -c /root/ubuntu-14.04.5-server-amd64.iso --disk /var/lib/libvirt/images/controller.img,bus=virtio,size=100 --network bridge=br-ctl,model=virtio --graphics vnc,listen=0.0.0.0 --noautoconsole
Starting install...
ERROR internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/root/ubuntu-14.04.5-server-amd64.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /root/ubuntu-14.04.5-server-amd64.iso: Could not open '/root/ubuntu-14.04.5-server-amd64.iso': Permission denied
Domain installation doesnot appear to have been successful.
If it was, you can restart your domain byrunning:
virsh --connect qemu:///system start controller
otherwise, please restart your installation.
auto eth0
iface eth0 inet static
address 192.168.4.243
netmask 255.255.255.0
network 192.168.4.0
broadcast 192.168.4.255
gateway 192.168.4.250# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.106.0.20
dns-search network
ping测试与主机192.168.4.240通。
2.4 修改网桥
root@network:~# virsh start controllererror:Failed to start domain controller
error:Cannot get interface MTU on 'br-em1':No such device
root@network:~#
root@network:~# virsh edit controllerDomain controller XML configuration edited.
ovs-vsctl add-br br-ex
ip addr add 192.168.50.129/24 dev br-ex
ovs-vsctl add-port br-ex eth0
ip addr del 192.168.50.129/24 dev eth0
ip linkset br-ex up
ip route add default via 192.168.50.1 dev br-ex
ip link add veth_ex type veth peer name veth_ctl
ip linkset dev veth_ex up
ip linkset dev veth_ctl up
ovs-vsctl add-port br-ex veth_ex
brctl addbr br-ctl
brctl addif br-ctl veth_ctl
3.2 开机自动配置
可远程操作。 配置interfaces
root@ubuntu:~# cat /etc/network/interfaces# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto p3p1
iface p3p1 inet manual
up ip address add 0/0 dev $IFACE
up ip link set $IFACE up
down ip link set $IFACE down
auto br-ex
iface br-ex inet static
address 192.168.50.134
netmask 255.255.255.0
gateway 192.168.50.1# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.106.0.20
pre-up ip link add veth_ctl type veth peer name veth_ex
pre-up ip link set dev veth_ex up
pre-up ip link set dev veth_ctl up
up ovs-vsctl list-ports $IFACE | grep'p3p1' || ovs-vsctl add-port $IFACE p3p1
up ovs-vsctl list-ports $IFACE | grep'veth_ex' && ovs-vsctl del-port $IFACE veth_ex || echo
up ovs-vsctl add-port $IFACE veth_ex
auto br-ctl
iface br-ctl inet manual
bridge_ports veth_ctl
bridge_stp off
bridge_fd 0
bridge_maxwait 0
执行: ovs-vsctl add-br br-ex 然后重启服务器。
ifup brings the named interfaces up in the order listed. interfaces参考:http://blog.csdn.net/mountzf/article/details/52035499 http://manpages.ubuntu.com/manpages/precise/man5/interfaces.5.html 网络设置: https://www.debian.org/doc/manuals/debian-reference/ch05.zh-cn.html https://jamielinux.com/docs/libvirt-networking-handbook/bridged-network.html
root@uuu:~# ls -a .ssh/
. .. authorized_keys
root@uuu:~# cat .ssh/authorized_keys
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"ubuntu\" rather than the user \"root\".';echo;sleep 10" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCNUxhA7eQjLpreouJJkvTa+6qh9mMi0wOEGohMOxxAuZ+WQmfN+KEN5HrKv077niN5hYGpF3sVYm+1UcQOJsFbv5954y4m8Yr1s8wnFewbD9ArcThk6XM2QEH5ljlbu7AEHcCjFXcrvuw3ha0oQ+mJDonCY4fqT8dLU+Dd5yQZjAk30IhIsGvE1uXrUPTJLEEIneTDHegQBdN1psL03Z92Tv1VazOOzN+isXeGM/3YzlrwUoabTeCpdZZEpc/Zz724Gc9/DmXCnG9WKUeMDKEVYl83jwCyBDcFlOMfp3pzRRNySBqeMm2fnm388DrtZtjh+Rvj05+Zd9nM3XiT7+UdGenerated-by-Nova
root@uuu:~# cat /home/ubuntu/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCNUxhA7eQjLpreouJJkvTa+6qh9mMi0wOEGohMOxxAuZ+WQmfN+KEN5HrKv077niN5hYGpF3sVYm+1UcQOJsFbv5954y4m8Yr1s8wnFewbD9ArcThk6XM2QEH5ljlbu7AEHcCjFXcrvuw3ha0oQ+mJDonCY4fqT8dLU+Dd5yQZjAk30IhIsGvE1uXrUPTJLEEIneTDHegQBdN1psL03Z92Tv1VazOOzN+isXeGM/3YzlrwUoabTeCpdZZEpc/Zz724Gc9/DmXCnG9WKUeMDKEVYl83jwCyBDcFlOMfp3pzRRNySBqeMm2fnm388DrtZtjh+Rvj05+Zd9nM3XiT7+UdGenerated-by-Nova
root@uuu:~# mv .ssh/authorized_keys .ssh/authorized_keys.bak
root@uuu:~# cp /home/ubuntu/.ssh/authorized_keys .ssh/authorized_keys
root@uuu:~# cat .ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCNUxhA7eQjLpreouJJkvTa+6qh9mMi0wOEGohMOxxAuZ+WQmfN+KEN5HrKv077niN5hYGpF3sVYm+1UcQOJsFbv5954y4m8Yr1s8wnFewbD9ArcThk6XM2QEH5ljlbu7AEHcCjFXcrvuw3ha0oQ+mJDonCY4fqT8dLU+Dd5yQZjAk30IhIsGvE1uXrUPTJLEEIneTDHegQBdN1psL03Z92Tv1VazOOzN+isXeGM/3YzlrwUoabTeCpdZZEpc/Zz724Gc9/DmXCnG9WKUeMDKEVYl83jwCyBDcFlOMfp3pzRRNySBqeMm2fnm388DrtZtjh+Rvj05+Zd9nM3XiT7+UdGenerated-by-Nova
root@compute:~# apt-cache search acpid
acpica-tools - ACPICA tools for the development and debug of ACPI tables
acpid - Advanced Configuration and Power Interfaceevent daemon
acpidump - transitional dummy package
3、添加删除虚拟机 virsh define /etc/libvirt/qemu/node5.xml #根据主机配置文档添加虚拟机 virsh list –all #node5已经添加 virsh undefine node5 #移除虚拟机 ls /etc/libvirt/qemu virsh list –all #node5已经被移除
Android中的Toast是一种简易的消息提示框,toast提示框不能被用户点击,toast会根据用户设置的显示时间后自动消失。
创建Toast
两个方法创建Toast
makeText(Context context, int resId, int duration)
参数:context是toast显示在
angular.identiy 描述: 返回它第一参数的函数. 此函数多用于函数是编程. 使用方法: angular.identity(value); 参数详解: Param Type Details value
*
to be returned. 返回值: 传入的value 实例代码:
<!DOCTYPE HTML>
Hierarchical Queries
If a table contains hierarchical data, then you can select rows in a hierarchical order using the hierarchical query clause:
hierarchical_query_clause::=
start with condi
初次接触到socket网络编程,也参考了网络上众前辈的文章。尝试自己也写了一下,记录下过程吧:
服务端:(接收客户端消息并把它们打印出来)
public class SocketServer {
private List<Socket> socketList = new ArrayList<Socket>();
public s