It's about open source softwares

Friday, October 23, 2015

Want to Ping Azure VM?

Whenever there is issues with any application or machines, the first thing we do is PING. I mean ping to that machine using IP address or hostname (if name resolution setup in the environment).

In Azure cloud we are not able to ping the virtual machines using IP address from outside environment. Ping uses ICMP protocol to communicate with each other. In Azure ICMP protocol is turned off. Azure firewall doesn't allow any ICMP traffic to go in and out of their infrastructure.

Though you can ping Azure virtual machines which are present in virtual network. For this you need to allow inbound rule for ICMP traffic in firewall. You can also disable the firewall. After this you are able to ping the machines present in virtual network using IP addresses.

Note: You can ping the internal or external IP of virtual machine only from inside not from outside the only.
Share:

Tuesday, October 6, 2015

Install NGINX as windows service using nssm

nginx [engine x] is popular HTTP and reverse proxy server with lot of features. nginx provides executable files for windows environment. We just need to download and unzip setup file to get started.  The official document says we cannot run nginx as windows service. 

We can use nssm (non sucking service manager) to install nginx as windows service. nssm monitors the running service and will restart it if it dies.

Install nginx  

Download Nginx stable version(nginx-1.8.0) from http://nginx.org/en/download.html
Unzip setup and copy in C:\nginx-1.8.0 directory. 


Install nssm

Download nssm zip file from http://nssm.cc/download 
unzip it in C:\nssm-2.24 directory.


Install nginx as windows service


Run below command to install nginx service

C:\> cd C:\nssm-2.24\win64
C:\> nssm.exe install nginx




It will pop up GUI screen in which we have to provide nginx information. Set the application path to nginx executable present in “C:\nginx-1.8.0”. Explore other options present for recovery, login, dependencies, etc. 


Press install service button to install service



Confirm the service installation in services 
o Click ctl+R  to open RUN prompt
o Type services.msc 

Start nginx service and confirm the installation




You are ready to use nginx server. 


References:


  • http://nginx.org/
  • http://nssm.cc/


Share:

Saturday, October 3, 2015

SERF: In a Nutshell

What is SERF


SERF is open source decentralized, fault-tolerant and highly available solution by Hashicorp used for cluster membership management, failure detection and orchestration.

Serf relies on an efficient and lightweight gossip protocol to communicate with nodes. The Serf agents periodically exchange messages with each other in much the same way that a zombie apocalypse would occur: it starts with one zombie but soon infects everyone. It communicates using both TCP and UDP protocols. It is extremely lightweight and uses low memory footprint(5 to 10 MB). Serf runs on every major platform: Linux, Mac OS X, and Windows.

Serf tries to solves problems related to clustered architectures,
  • Cluster Membership Management: Serf maintains list of members present in the cluster. It also provides provision to execute custom handler scripts whenever membership changes. Serf agents exchange messages to each other periodically to check the membership status i.e. joining or leaving of members.
  • Failure Detection and Recovery: Serf automatically detects failed nodes within seconds, notifies the rest of the cluster, and executes handler scripts allowing you to handle these events. Serf will attempt to recover failed nodes by reconnecting to them periodically.
  • Event Propagation: Serf can broadcast custom events and queries to the cluster. These can be used to trigger deploys, propagate configuration, etc. Events are simply fire-and-forget broadcast, and Serf makes a best effort to deliver messages in the face of offline nodes or network partitions. Queries provide a simple real-time request/response mechanism.

Use Cases


SERF is decentralize solution for cluster management so it solves use-cases that are having decentralized state, masterless architecture, and are completely fault tolerant.
  • Webservers and load balancers
  • Memcached and Redis clusters
  • Triggering deployments
  • Updating DNS records
  • Simple Observability
  • A Building Block for Service Discovery

References

  • https://www.serfdom.io
  • https://www.serfdom.io/docs/index.html

Share: