Skip to content

Instantly share code, notes, and snippets.

View wang-zhijun's full-sized avatar

WANG ZHIJUN wang-zhijun

  • Tokyo
View GitHub Profile
@wang-zhijun
wang-zhijun / flink.md
Last active May 18, 2017 07:01
Flink
@wang-zhijun
wang-zhijun / aerospike.md
Last active April 14, 2017 03:33
aerospike
docker run -d --name aerospike aerospike/aerospike-server

docker run -it aerospike/aerospike-tools aql -h  $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike)
aql> insert into test.foo (PK, foo) values ('123', 'my string')
OK, 1 record affected.

aql> select * from test.foo
+-------------+
| foo |
@wang-zhijun
wang-zhijun / redis.md
Last active April 20, 2017 08:30
redis

To remove a slave node just use the del-node command of redis-trib:

./redis-trib del-node 127.0.0.1:7000 `<node-id>`

You can remove a master node in the same way as well, however in order to remove a master node it must be empty. If the master is not empty you need to reshard data away from it to all the other master nodes before. An alternative to remove a master node is to perform a manual failover of it over one of its slaves and remove the node after it turned into a slave of the new master.

A more manual way to add a replica to a specific master is to add the new node as an empty master, and then turn it into a replica using the CLUSTER REPLICATE command.

@wang-zhijun
wang-zhijun / bgp.md
Last active April 4, 2017 08:10
BGP

http://www.9tut.com/border-gateway-protocol-bgp-tutorial

BGP AS numbers can be between 1 to 65,535.

Internet Assigned Numbers Authority (IANA) manages the AS numbers from 1 to 64,512 for public use (similar to public IP addresses) while 64,512 to 65,535 numbers are reserved for private use (similar to private IP addresses).

BGP peer or BGP neighbor: Any two routers that have formed a TCP connection to exchange BGP routing information (as BGP runs over TCP on port 179, not UDP)

External BGP (eBGP): refers to the BGP neighbor relationship between two peers belongs to different AS. It is recommended that eBGP should be directly connected. Never run an IGP between eBGP peers.

@wang-zhijun
wang-zhijun / vault.md
Last active March 23, 2017 01:41
Vault

Terminal 1

# wget https://releases.hashicorp.com/vault/0.7.0/vault_0.7.0_linux_amd64.zip

# unzip vault_0.7.0_linux_amd64.zip

# mv vault /usr/bin/

# vault
@wang-zhijun
wang-zhijun / kubernetes.md
Last active February 26, 2017 04:03
kubernetes

MacにminikubeとkubectlとVirtualBoxをインストール

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.16.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

$ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl && chmod 0755 kubectl && sudo mv kubectl /usr/local/bin/

$ brew install Caskroom/cask/virtualbox
@wang-zhijun
wang-zhijun / etcd.md
Last active March 31, 2017 04:36
Etcd

Etcdは二つのポートを使っている。 一つは2379, もう一つは 2380. 2379はクライアント通信のため, 2380はEtcdサーバー間の通信のため。

# netstat -lpn | grep etcd
tcp        0      0 127.0.0.1:2379          0.0.0.0:*               LISTEN      21586/etcd
tcp        0      0 127.0.0.1:2380          0.0.0.0:*               LISTEN      21586/etcd

etcdをインストール

@wang-zhijun
wang-zhijun / cassandra.md
Last active February 8, 2017 08:45
Cassandra

Cassandraをインストール

sudo tee /etc/yum.repos.d/datastax.repo <<-'EOF'
[datastax]
name = DataStax Repo for Apache Cassandra
baseurl = http://rpm.datastax.com/community
enabled = 1
gpgcheck = 0
EOF
@wang-zhijun
wang-zhijun / firewalld.md
Created December 18, 2016 02:17
Firewalld
# firewall-cmd --state
running

# firewall-cmd --get-default-zone
public

# firewall-cmd --get-active-zones
public
 interfaces: eno16777984