Nice rainy day

Yesterday, one of my colleague XiangQian tried an English online course, the beautiful teacher is from Philippines. I stand behind XiangQian and watched the video. They started from short introduction, then described basic 5 vowels, made simple sentences, then talked about the weather (Sunny, rainy, cloudy, snowy). I like the course, courage to speak and make mistake is important and useful for most of Chinese, and the regular basic training or self studying are necessary, especially for the pronunciation.

We got rain after the course, the hottest days of summer isn’t coming, but we are trapped insider the office without air-condition, even without a direct window to exchange the air. There are many fan equipments in the seat. The good thing is that company provides delicious ice cream for us, some colleagues also make some drinking for us (Green bean soup and SuanMeiTang soup[1]). I was a little bit thin when I was young, so I hate cold winter and adapt to hot summer. I start to live in school from middle school, the heaters are very original and poor efficiency.

But I moved from thin group to fat group in the end of university time, because of stress or too much relax. I still remember the Twice Cooked Port [2], and fruit beer in Xi’an. I met difficult option in that time, to join in CPLA as an officer or drift to Beijing to seek (OpenSource) technology dream. I choose Red Hat, Linux Kernel leading contributor. OpenSouce technology and culture leads me to another extended world and effects me a lot.

Rain after hot days always take us the calm and cool. It’s good to take some exercise out of the door, walk in the rain for relax, write or read something, or just have a good sleep. I always like the last one 😉

[1] https://en.wikipedia.org/wiki/Suanmeitang
[2] https://en.wikipedia.org/wiki/Twice_cooked_pork


Play Cassandra in Docker

上次在Mac上玩Docker用的还是boot2docker[1],一个基于http://tinycorelinux.net/的轻量级Linux发行版。今天想部署多个节点的Cassandra集群,可以把已经装好的Fedora虚拟机拷贝两份硬盘空间不足,在怎么清理还是不够,主要是使用这个虚拟机编译了很多东西磁盘占用较多。下载的Fedora24-Beta mini默认迷你安装下来,也才1.5G。





Starting "default"...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           ______ o           __/

docker is configured to use the default machine with IP
For help getting started, check out the docs at https://docs.docker.com
# 新建一个容器,拉取并执行docker官方仓库里的Cassandra
Jerusalem:~ amoskong$ docker run --name vm4 -d cassandra

# 获取一个容器的shell,然后执行cqlsh连接数据库
Jerusalem:~ amoskong$ docker exec -it vm4 sh

# cqlsh
Connected to Test Cluster at
[cqlsh 5.0.1 | Cassandra 3.5 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.

重复上面的命令,指定不同的名字,就可以创建多个容器,对应多个Cassandra节点。多个节点连接连接成一个集群cluster就需要配置cassandra seeds,这个可以通过配置文件,docker命令行,或者Kitematic图形管理工具的设置界面。

# 创建容器时候指定 Cassandra seeds ip地址
Jerusalem:~ amoskong$ docker run --name vm4 -d cassandra -e CASSANDRA_SEEDS="$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' vm1)"

Jerusalem:~ amoskong$ docker run --name vm4 -d cassandra -e CASSANDRA_SEEDS=",,"

第三个容器里的cassandra老是启动失败,内存不足,在网上查了一下,最后还是通过设置环境变量 MAX_HEAP_SIZE, HEAP_NEWSIZE。