create elasticsearch client at startup and close at shutdown.