fix some bugs
clean code
Merge pull request #3 from michaelnsj/FIX_ES_BUGS

Merged.
fix the port problem
Merge pull request #4 from michaelnsj/FIX_ES_BUGS

Merged.
immutable the host, port and cluster name
fix some bugs
Merge pull request #5 from michaelnsj/FIX_ES_BUGS

Merged.
fix provision problem on poor hardware like amazon t1.small