4月 252017
 

openvswitch 安装,参考: https://phpor.net/blog/post/5102

启动相关进程:

创建数据库:

语法说明: ovsdb-tool [options] create [db [schema]]

默认数据库位置: /etc/openvswitch/conf.db

默认的表结构: /usr/share/openvswitch/vswitch.ovsschema   (schema 是一个很大的json)

 

启动ovsdb-server:

语法说明: ovsdb-server [database]…  [–remote=remote]…  [–run=command] –log-file[=/var/log/openvswitch/ovsdb-server.log]

默认数据库文件: /etc/openvswitch/conf.db

监听socket文件: 通过 –remote指定,可以是ip:port ,没有默认值

日志文件: 通过–log-file 开启日志,通过 –log-file=/var/log/ovsdb-server.log 来指定文件位置,默认位置: /var/log/openvswitch/ovsdb-server.log

 

通过ovsdb-client 操作数据库

ovsdb-client – command-line interface to ovsdb-server

默认的server socket文件: unix:/var/run/openvswitch/db.sock

 

加载openvswitch 内核模块:

如果不加载该模块,则ovs-vswitchd启动时会报错

该模块内核中已经有了,加载即可:

 

启动ovs-vswitchd:   ovs-vswitchd – Open vSwitch daemon

语法说明: ovs-vswitchd [database]

database 就是ovsdb-server listen的unix socket或ip:port ,这里默认位置为:  unix:/var/run/openvswitch/db.sock

日志通过 –log-file 打开,默认位置: /var/log/openvswitch/ovs-vswitchd.log

 

查看网络配置:

ovs-vsctl 通过

 

各组件之间的关系:

数据库文件是静态文件,如同sqlitedb,需要通过工具(ovsdb-tool)创建;对于mysql数据库,本身就可以直接提供网络服务,但是这里的数据库文件却仅仅是个文件,需要 ovsdb-server 来提供网络服务,ovsdb-server 只知道如何操作数据库(表),对网络却一无所知,但是ovs-vswitchd却是懂网络的,ovs-vswitchd 通过ovsdb-server数据库的变更,执行网络配置,提供一个配置网络的服务;ovs-vsctl 通过ovsdb-server (/var/run/openvswitch/db.sock)操作数据库

 

 Posted by at 下午 6:22
4月 072017
 

Dump a process

To dump a process, run:

where,
-D : directory to save image files
-t : PID of process to dump

Convert criu images to core dump

Continuing with the examples above where we dumped the process with PID 1234, we can generate the core dump with the crit utility that comes with criu:

where,
-i : input directory with criu images
-o : output directory for the core dump

To find the generate core dump file:

Check the information with readelf:

Start debugging with GDB:

Resume the process

To resume a process from dump files:

where,
-d : detach criu from the process after resume

 

 

测试:

脚本 a.php

启动:

dump:

restore:

截屏:

参考:

Dump, debug, resume process with criu

 Posted by at 上午 9:55
3月 202017
 

注意:

  1. 目前只支持扩容而不支持缩容
  2. 目前支持磁盘格式为: vdi、vhd
  3. 而且只支持动态增长类型的磁盘

参考:

  1. http://www.cnblogs.com/zhcncn/articles/2948508.html
  2. http://www.linuxidc.com/Linux/2015-04/116454.htm

示例:

  1. 磁盘格式转换:
    VBoxManage clonehd box-disk1.vmdk box-disk1.vdi –format vdi
  2. 磁盘大小修改:
    VBoxManage modifyhd  box-disk1.vdi –resize 120000

 

 Posted by at 下午 4:08