feisky

云计算、虚拟化与Linux技术笔记
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 66 下一页

2012年9月5日

摘要: #!/usr/bin/pythondef get_info(): import sys f=sys._getframe() return (f.f_back.f_code.co_name, f.f_back.f_lineno)if __name__=='__main__': print get_info() 阅读全文

posted @ 2012-09-05 20:52 feisky 阅读(433) 评论(0) 推荐(0) 编辑

2012年8月24日

摘要: 曾经写过一个脚本在Linux系统上来获得本地的IP地址:#!/usr/bin/env pythonimport socketimport structimport fcntlimport sysdef getip(ethname): if ethname=="": ethname="eth0" try: s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ip=socket.inet_ntoa(fcntl.ioctl(s.fileno(), 0X8915, struct.pack('256s... 阅读全文

posted @ 2012-08-24 10:17 feisky 阅读(1158) 评论(1) 推荐(0) 编辑

摘要: 简介Dremel 是Google 的“交互式”数据分析系统。可以组建成规模上千的集群,处理PB级别的数据。MapReduce处理一个数据,需要分钟级的时间。作为MapReduce的发起人,Google开发了Dremel将处理时间缩短到秒级,作为MapReduce的有力补充。Dremel作为Google BigQuery的report引擎,获得了很大的成功。最近Apache计划推出Dremel的开源实现Drill,将Dremel的技术又推到了浪尖上。Google Dremel设计根据Google公开的论文《Dremel: Interactive Analysis of WebScaleDatas 阅读全文

posted @ 2012-08-24 09:10 feisky 阅读(2631) 评论(0) 推荐(0) 编辑

2012年8月16日

摘要: How do I send gratuitous ARPs under Linux? How do I tell my DUMMY router that the IP is over here now, under Linux operating systems?You can use the arping command to send a gratuitous reply using the -A option. arping can send ARP REQUEST to a neighbor host:# arping -U {IP-HERE} -I {Interface-Name- 阅读全文

posted @ 2012-08-16 13:24 feisky 阅读(856) 评论(0) 推荐(0) 编辑

摘要: Here we are going to findout how to mark volume groups as active or inactive in Linux using lvchange command in LinuxUselvscancommand to get list of volumes#/usr/sbin/lvscanthe output will beACTIVE ‘/dev/Linux_volume/LogVol00′ [33.78 GB] inheritACTIVE ‘/dev/Linux_volume/LogVol02′ [10.00 GB] inheritA 阅读全文

posted @ 2012-08-16 11:07 feisky 阅读(645) 评论(0) 推荐(0) 编辑

2012年7月29日

摘要: 先看看测试代码// cas.c#include <stdio.h>#include <pthread.h>#include <stdlib.h>static int count = 0;void *test_func(void *arg){ int i=0; for(i=0;i<100000;++i){ __sync_fetch_and_add(&count,1); } return NULL;}int main(int argc, const char *argv[]){ pthread_t ... 阅读全文

posted @ 2012-07-29 12:03 feisky 阅读(1553) 评论(0) 推荐(0) 编辑

摘要: 非阻塞型同步 (Non-blocking Synchronization) 简介如何正确有效的保护共享数据是编写并行程序必须面临的一个难题,通常的手段就是同步。同步可分为阻塞型同步(Blocking Synchronization)和非阻塞型同步( Non-blocking Synchronization)。阻塞型同步是指当一个线程到达临界区时,因另外一个线程已经持有访问该共享数据的锁,从而不能获取锁资源而阻塞,直到另外一个线程释放锁。常见的同步原语有 mutex、semaphore 等。如果同步方案采用不当,就会造成死锁(deadlock),活锁(livelock)和优先级反转(priori 阅读全文

posted @ 2012-07-29 11:56 feisky 阅读(1506) 评论(0) 推荐(1) 编辑

2012年7月9日

摘要: sudo apt-get install linux-source 会自动安装当前版本内核的源代码到 /usr/src 阅读全文

posted @ 2012-07-09 12:11 feisky 阅读(1438) 评论(0) 推荐(0) 编辑

2012年7月5日

摘要: [plain]view plaincopy#!/bin/shmem=`free-m|awk'NR==2{print$2}'`ps-aux2>&1|sort-k4-r|awk'$4~/^[0-9]/&&$4>0{print$4,$11}'|awk'{print$1/100*mem""$2}'mem=$mem|sort-k2|awk'{a[$2]+=$1;b[$2]++;total+=$1;total++;}END{for(iina){t=i;gsub(/:|.*\//,"&q 阅读全文

posted @ 2012-07-05 15:57 feisky 阅读(489) 评论(0) 推荐(0) 编辑

2012年7月4日

摘要: https://blueprints.launchpad.net/nova/+spec/lvm-disk-imagesRecently, we have implemented LVM disk support functionality (based onour work for Diablo) and successfully delivered it to upstream.New LVM image backend can be enabled by settinglibvirt_images_typeflag to valuelvm.You must also specify vol 阅读全文

posted @ 2012-07-04 10:16 feisky 阅读(970) 评论(0) 推荐(0) 编辑

2012年7月3日

摘要: 云计算用一个朋友的话来说:”做云计算最苦逼的就是得时时刻刻为一些可能一辈子都碰不到的事做好准备。更苦逼的就是刚以为一个问题不会遇到,立刻就发生了。。。“。这个还真的没有办法,谁让哥我是搞云计算的呢,简单一个虚拟化就搞的你蛋疼,你还能想其它的吗?一直纠结在做虚拟化使用什么镜像格式,刚刚开始用了raw的file,后来发现LVM的很多特性对于虚拟化还是有比较理想的能力,而且性能也很不错就用了LVM。后来被VMware骗了跑去搞Esxi接触了VMDK,最近研究openstack发现了qcow2格式,貌似现在很流行呀。也说不上分析这些镜像格式的能力,就简单说说自己的一些使用心得。目前主要有那些格式来作为 阅读全文

posted @ 2012-07-03 18:01 feisky 阅读(24664) 评论(1) 推荐(1) 编辑

2012年6月29日

摘要: openstack创建虚机由于制作镜像比较麻烦,直接从https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz下了一个回来。wgethttps://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz发布镜像# uec-publish-tarball cirros-0.3.0-x86_64-uec.tar.gz cirr x86_64WARNING: 'uec-publish-tarbal 阅读全文

posted @ 2012-06-29 10:42 feisky 阅读(1389) 评论(1) 推荐(0) 编辑

摘要: openstack配置xen首先安装nova-compute-xen:apt-get install nova-compute-xen配置nova:/etc/nova/nova-compute.conf: --libvirt_type=xen/etc/nova/nova.conf: --connection_type=libvirt--libvirt_type=xen这样还是无法启动nova-compute,报错:2012-06-28 15:12:26 TRACE nova Traceback (most recent call last):2012-06-28 15:12:26 TRAC.. 阅读全文

posted @ 2012-06-29 10:40 feisky 阅读(2806) 评论(1) 推荐(1) 编辑

2012年6月20日

摘要: 关于性能优化这是一个比较大的话题,在《由12306.cn谈谈网站性能技术》中我从业务和设计上说过一些可用的技术以及那些技术的优缺点,今天,想从一些技术细节上谈谈性能优化,主要是一些代码级别的技术和方法。本文的东西是我的一些经验和知识,并不一定全对,希望大家指正和补充。在开始这篇文章之前,大家可以移步去看一下酷壳以前发表的《代码优化概要》,这篇文章基本上告诉你——要进行优化,先得找到性能瓶颈! 但是在讲如何定位系统性能瓶劲之前,请让我讲一下系统性能的定义和测试,因为没有这两件事,后面的定位和优化无从谈起。一、系统性能定义让我们先来说说如何什么是系统性能。这个定义非常关键,如果我们不清楚什么是系统 阅读全文

posted @ 2012-06-20 12:59 feisky 阅读(520) 评论(0) 推荐(0) 编辑

2012年6月11日

摘要: 虚机配置文件中增加:extra="single" 阅读全文

posted @ 2012-06-11 14:07 feisky 阅读(488) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 66 下一页
无觅相关文章插件,快速提升流量