RabbitMQ Cheat Sheet

临时修改内存限制

rabbitmqctl set_vm_memory_high_watermark 0.6

设置 TTL

设置全局 TTL 为 24 小时,文档在这里!注意 3.X 之后才支持。
其中 priority 值越高,优先级越大,默认是 0。

sudo rabbitmqctl set_policy TTL ".*" '{"message-ttl":86400000}' --apply-to queues
sudo rabbitmqctl set_policy ttl-24h ".*" '{"message-ttl":86400000}' --apply-to queues  --priority 100
sudo rabbitmqctl list_policies

组件集群

版本 < 3.X

sudo rabbitmqctl stop_app
sudo rabbitmqctl cluster rabbit@hostname_of_master
sudo
查看详细

[转] All about redirection

Copy from: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

3.1 Theory and quick reference

There are 3 file descriptors, stdin, stdout and stderr (std=standard).

Basically you can:

  • redirect stdout to a file
  • redirect stderr to a file
  • redirect stdout to a stderr
  • redirect stderr to a stdout
  • redirect stderr and stdout to a file
  • redirect stderr and stdout to stdout
  • redirect stderr and stdout to stderr

1 ‘represents’ stdout and 2 stderr.

A little note for seeing this things: with the less command you can view both stdout (which will remain on the buffer) and the stderr that will… 查看详细

数据库隔离级别

数据库是支持并发的,一旦牵扯到并发就关系到数据的隔离性,数据库隔离级别理论上分为四级,比较教条的解释情参阅 wiki

  1. Read uncommited
  2. Read Committed
  3. Repeatable Read
  4. Serializable

隔离等级依次升高,代价就是并发性能有所下降。绝大多数数据库系统默认使用 Read Committed。 MySQL 比较奇葩,逼格很高地选择了 Repeatable Read ,当然他这么做是有理由的,但是理由不在本文讨论范围。

站在 MySQL 使用者角度看,这些隔离等级意味着什么?… 查看详细

[转]OVN, Bringing Native Virtual Networking to OVS

Announcement

Following content copied from here.

The Open vSwitch team is pleased to announce OVN, a new subproject in development within the Open vSwitch. The full project announcement is at Network Heresy and reproduced below. OVN complements the existing capabilities of OVS to add native support for virtual network abstractions, such as virtual L2 and L3 overlays and security groups. Just like OVS, our design goal is to have a production-quality implementation that can operate at significant scale.

–The Open vSwitch Team

OVN, Bringing Native Virtual Networking to OVS

By Justin… 查看详细

Search Linux Source Code

如何最快速的查看内核代码?在 debian/ubuntu 系统中可以执行下面的命令:

$ sudo apt-get install linux-source
$ cd /usr/src
$ sudo tar jxf linux-source-3.13.0.tar.bz2 #版本号可能会不一样
$ cd linux-source-3.13.0

另外:

glibc 源码:

git clone git://sourceware.org/git/glibc.git

Kernel 源码:

git clone https://github.com/torvalds/linux.git

完。… 查看详细