codejuan / blog Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
有空记录一下
问题
capadd是增加Linux内核能力,比如sys admin, net admin
sysctl是改命名空间级的内核参数
cgroup里用的是number,在监控时需要转换为设备名
格式变了,review的时候不方便
crlf的sh无法执行
解决办法
gitattribute
*.sh text eol=lf
*.bat text eol=crlf
在H厂,一纸行政命令,就要云化,但是在屁股决定脑袋的思维之下,云化变成了Docker化,逼着很多应用去削足适履,苦不堪言也就罢了,落地成果也不好。
A厂则不一样,云化的过程是尽量让业务不感知,看看T4和AliDocker的发展历程便可知。改造Docker,改造LXC以适配应用,而不是让应用来适配容器。
结果而论,A厂绝大部分应用都云化了,H厂很多容器项目都还在挣扎求存。
/var/log/yum.log
获取本线程cache
判断对象大小,微对象,小对象,大对象的方法不同
微对象,从微对象freelist取,如果没有,则去central 来refill
小对象,与微对象类似
大对象,直接从heap取
https://superuser.com/questions/247127/what-is-and-in-linux/247131
$# Stores the number of command-line arguments that
were passed to the shell program.
$? Stores the exit value of the last command that was
executed.
$0 Stores the first word of the entered command (the
name of the shell program).
$* Stores all the arguments that were entered on the
command line ($1 $2 ...).
"$@" Stores all the arguments that were entered
on the command line, individually quoted ("$1" "$2" ...).
分为三个组件,agent,collector,UI
关键在于agent,是用来注入到JVM,hack相关函数,在修改消息体,加上trace ID和span ID
原理,用的java agent,在class load的时候,在关注的函数外围插入代码
增加host
192.30.253.118 http://gist.github.com
192.30.253.119 http://gist.github.com
#14.04
apt-get update
apt-get install apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get purge lxc-docker
apt-cache policy docker-engine
apt-get install linux-image-extra-$(uname -r)
apt-get install linux-image-generic-lts-trusty
reboot
apt-get update
apt-get install docker-engine
放在galaxy的ali docker log driver里,性能怎样?
client hello
Server hello
application data
全部被加密了,看不到url body head等等
you should update docker to 1.11+
or
patch the related change
默认是-1,如果不设置的话,就不会rotate。为啥不设置一个默认size呢?
格式变了,review的时候不方便
crlf的sh无法执行
解决办法
gitattribute
*.sh text eol=lf
*.bat text eol=crlf
/proc//net/dev
To squash four commits into one, do the following:
$ git rebase -i HEAD~4
In the text editor that comes up, replace the words "pick" with "squash" next to the commits you want to squash into the commit before it. Save and close the editor, and git will combine the "squash"'ed commits with the one before it. Git will then give you the opportunity to change your commit message to something like, "Issue #100: Fixed retweet bug."
Important: If you've already pushed commits to GitHub, and then squash them locally, you will have to force the push to your branch.
$ git push origin branch-name --force
Helpful hint: You can always edit your last commit message, before pushing, by using:
$ git commit --amend
SB是stack basic register
FP是函数参数和返回值,高地址是参数
SP是函数栈,低地址是变量
Mac
preference-Go-GOPATH-module path
利用systemd管理cgroup,通过system.slice建立一个独立的cgroup树
git diff previous_release..current_release -- include ':!spec'
docker create 的时候可以指定
内存离CPU近,可以提升性能
又一次被公司与世隔绝的环境恶心了一回。想装一个包,试了各种代理都不管用。
只好找到一个iso,mount出来,然后find rpm,拷贝到环境里,再进行安装。
大好时光浪费在这上面,唉
如果是私有云场景,可以把容器的log driver设置none,类似虚拟机的做法,用户的stdout等都不保存
公有云则可以参考阿里,写一个driver,打到专门的日志服务
最近看了一些帖子,提到了zeus和sigma,这是不是一个东西?
环境,5000虚拟机,
先strace,后看系统日志
原因是arp表太小,修改
/proc/sys/net/ipv4/neigh/default下面的gc_thresh1和2和3,改大一些
土鳖终于用上了Mac。习惯了以前win+L
一键锁屏,到了Mac之后,竟然没有快捷方式。
什么hot Corner还是麻烦,鼠标划来划去,还容易对不准。
Google一番,终于找到简单方法,用alfred, ALT+SPACE然后Lock
/var/run/docker/libcontainerd/{container ID}/config.json
https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration
https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md
A依赖B,
type xxCallback func()
FB(xxCallback)
B里有一个函数FB的参数就是xxCallback
我的写法
f := func(){}
然后B.FB(f)
报错,说无法将f转换成xxCallback
原因是,虽然f的参数,返回值都和回调函数xxCallback一样,但是因为B没有导入A,所以不知道f的情况,这个时候就会编译不过?
我了解到有三种做法
需要在/etc/ceilometer/rootwrap.d/xx.filter写上
filter
project似乎不是租户隔离的。
我创建project时提示project名称已存在,而我的project列表还是空的。
在搞lxc过程中研究了一下usernamespace,3.8开始支持,3.10能用(只能ext3 ext4),3.12之后就支持不错。
如果开了user namesapce,容器里的用户的uid就会加上一个偏移,降低和宿主机上的用户id相同的可能性。宿主机上用ls看容器用户创建的文件,uid都会是一串很大的数字。还有一个isolate特性,原理是不同容器会用到不同偏移段,容器间的uid也会不同。如果不用isolate,那么容器用的都是相同的偏移
看过之后,对技术实现已经清楚了。。
啥时候我也能真正做个有用户的产品呢
When a IPC namespace is destroyed(i.e., When the last process that is a member of the namespace terminates), all IPC objects In the namespace are automatical destroyed.
When a network namespace is freed, its physical network devices are moved back to the initial network namespace. But how about the virtual network device?
br_tun的流表做的转换
tun_ID就是vxlan ID,然后转为mod_vlanID
instance[key_data],然后通过-v read only的方式挂到容器,
讲清楚价值,以及能不能落地
技术细节,高层不关心
docker不过是新瓶装旧酒,最大的贡献是镜像,使得环境可以一致。
是否真的是一个进程一个容器呢?这个见仁见智吧,根据实际的业务场景,以及切换成本来看。我一致觉得,docker跑有状态应用不太合理。
根据官方口径,x万台物理机,xxx万个容器,业务场景更复杂,都能搞定,之前的项目没有理由搞不定。
好强大啊…有时间研究一下
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.