Terraform and Infrastructure as Code
This is a start on Terraform operations against AWS to fulfill the thought of Infrastructure as Code
The best thing is, you can provision your server using command in parallel, quick, elegant and happily. And beyond that, if you make this one in a predictable way, think for a while, how much money you can save… Oh, my gosh!
So it has most of the features I desired for a tool to provision a server:
- Infrastructure as Code
- Execution Plans
- Resource Graph
- Change Automation
So, basically I want a tool to provision a server in a reliable and simple way. Better with Dependency graph feature, which is essentially the DAG.
So here is Terraform. Let’s start.
AWS Go Through
I have been used for AWS for a while, but always there are someone who want to touch this however don’t know how to start or what to follow.
Recently I read this link, and I was doing it all through and it was a good one to start. So, you want to learn AWS? AKA, “How do I learn to be a Cloud Engineer?”
I won’t paste and tell you everything how to do it, but will point the ones that might block you or you might need to Google it.
From Simple Mutex to Distributed Lock
Lock
and Mutex
are very basic ideas in every language and OS.
Recently, I think for a while about Lock
/ Mutex
/ SpinLock
/ Reentrant Lock
/ Distributed Lock
, and find something interesting.
Setup Golang Dev Env in Sublime Text3
Recently I found I like Sublime Text more because of happy coding flow in Golang here.
Very much!!!
As usual, picture first!
nf_conntrack: table full, dropping packet
Today I found an online server in monitoring channel, alert saying Timtout connection
to xxx.xxx.com which is one of our production entrance servers and then the story began …
Accounting
Go Summary
This is a post of Golang Summary, for me to check out long time not writing program using Golang since 3 years ago.
Nginx Magics
This is a post for Nginx Magics and for you to quick get the configurations.
I put the links here to refer and put my own thoughts and comments.
For more nginx settigns, pls refer my another markdown list:
https://github.com/morganwu277/code_snippets/blob/master/nginx.md
Install Percona Monitoring and Management System
Recently I was exhausted about the Page Cleaner in MySQL issue, and in the end I just surrendered and installed this PMM and keep on monitoring. I thought I was able to solve everything via simple show innodb engine status
and show global variables/status
, etc.
But the reality showed me as a fool of wasting time on just viewing numbers flipping. I learned one thing from this: never try to hack it before you really fully master it, which is only WAST OF TIME
. Time really matters.
This is a quick notes for you to quickly install PMM and start monitoring your MySQL.
As usual, picture always show first!
Beautiful, uh? 😀
Install Ganglia and Send Metrics to Graphite
I have been used many monitoring tools for over 4 years, but there has never been a tool which is so strongly strike my heart and meet my needs in the just right way. Most of them are focusing more on the so-called extensible back-end storage, but not many of them has really meet the requirement of monitoring out of box. Of course, that could be the secret of their business money making.
Anyway, most of this article follows https://hostpresto.com/community/tutorials/how-to-install-and-configure-ganglia-monitor-on-ubuntu-16-04/ , just to give myself a quick notes to apply.
Long time that no pictures, I love pictures. Here is one for you to enjoy:
MongoDB MEM Management
NEVER USE MONGODB ON PRODUCTION.
Here the guy also meet my problem: https://news.ycombinator.com/item?id=5704572
This post is about MongoDB memory management mechanism.
All it’s using is Page Cache of System.
This is a good experience report: https://speakerdeck.com/mitsuhiko/a-year-of-mongodb
This URL gives you more details
https://www.mongodb.com/presentations/mongodb-memory-management-demystified
OK, this post is just for me to check commands to use, to management MongoDB.
CloudFlare doesn't support ETag
Because only Nignx >= 1.3.3 have etag options.
How stupid of this blog….
My conf
Setup ElasticSearch, Fluentd, Kibana in Kubernetes
Just a post about what we need to setup the ElasticSearch/Fluentd/Kibana. For detailed and how do they work, please reference the official site.
Here is my final Kibana screenshot:
Beautiful, isn’t it?
This post will setup EFK tool chain in Kubernets.
工作の思考
Redis Scan Too Slow in Django Application
Recently I met an issue that one of our APIs of the online production servers is very slow due to redis scan
.
From next graph generated by NewRelic, we found AVERAGE response time
is 2930ms while redis scan
could take 2680ms, which is 2680/2930 = 91.4% portion of the total time.
Why redis scan cost this much? From our local environment, we never noticed such huge performance issue.
Debug Ansible and Tiny Introduction of PlayBook
Ansible is a popular dev-ops tools for us to execute ad-hoc commands immediately on large mounts of machines in parallel which accelerate our working speed.
It’s simple but powerful and compatible with different OS platforms. Even more, it has lots of pre-defined modules for us to use, which significantly make the dream of reusing Dev-Ops scripts come true.
However, when you’re goging to use this fantastic tool, how to debug when you’re executing the ansible play-book with flow of commands? It looks like a unstoppable flow.
Leetcode Exercises
This is a leetcode algorithm list for me to track my thought and solutions.