Avoid Blind Wait In DevOps Code

Occasionally DevOps code needs to check and wait status, before running further steps. For example, wait for service A to be up, then start service B; confirm TCP port is listening, then launch requests; etc.

For simplicity or time pressure, people usually use a blind wait like “sleep 10” to fix this. This is certainly not good enough. How we can improve this with affordable cost?

Blind Wait


Generate Common DB Data Report By ELK

Usually critical data is stored in DB. We can periodically poll and combine key metrics from DB into a data report, such as how many tables/collections in DB, how many items in each critical table, etc. Data report enables people to visualize the history and trend of key metrics.

Furthermore if the basic data report can be generated automatically, people can easily add more metrics, which may make more business sense. The most exciting part is that we can get a general solution which applies to different projects! So how we can get this idea started?

DB History Report


Create Local VM With Fixed IP Address

People are using VMs for local test more and more. The VMs are usually accessed by IP. Most likely laptops running the VM will be carried to different places, whether home, office or starbucks. Hence the wifi changes all the time. So the IPs of latop and VM change as well.

Quite natural we want the VM to have a fixed IP, thus we don’t need to change current ip of the VM all the time. So how to achieve that?

Create Local VM With Fixed IP Address


Write Initscript For Linux Daemon Service

How to write a linux initscript?* You have implemented a daemon service. Now you may want everyone in the project can easily manage the service without extra communication. The standard way would be “service $servicename start/stop/status”. Another thing, no one would enjoy starting service manually, when the machine is rebooted. Here are things you shall need to know or watch out to get above done.