Ansible, Windows & Service - CHECK!


This might help some users with a Windows-only requirement.

We deploy Dremio as part of a bigger environment (on Linux or Windows, customer decides) and it needs to be installed on a different drive, not C:\ and the data/log etc folders need to be on the D:<whatever> drive. The whole environment is deployed with Ansible so it would be great if Dremio could also be deployed with Ansible and run as a service. We only run a simple single instance Dremio so no clustering etc.
Dremio 3.0.1 on Windows 2012: works nicely when using the Dremio.exe panel with the start button.
Closing the Dremio.exe also stop Dremio. Changing the env/conf files didn’t change the behaviour.

This is what I did:

  • Install JDK requirement

  • Install Microsoft Visual C++ 2010 Redistributable Package (x64)

  • Install Dremio as usual, but basically it just expands into C:\Program Files\Dremio\

  • Move the C:\Program Files\Dremio folder to D:\Dremio\Dremio-3.0.1

  • Create a D:\Dremio\start.cmd file with following contents:

cmd /c java -Dhadoop.home.dir="D:\dremio\Dremio-3.0.1\Dremio\winutils" -Djava.util.logging.config.class=org.slf4j.bridge.SLF4JBridgeHandler -Ddremio.log.path="D:\Dremio\log" -Dpaths.local="D:\Dremio\data" -Dpaths.dist="file:/D:/Dremio/pdfs" -Dpaths.db="D:\Dremio\db" -Dpaths.spilling="[file:/D:/Dremio/spill]" -classpath "D:\dremio\Dremio-3.0.1\Dremio\conf;D:\dremio\Dremio-3.0.1\Dremio\jars\*;D:\dremio\Dremio-3.0.1\Dremio\jars\ext\*;D:\dremio\Dremio-3.0.1\Dremio\jars\3rdparty\*" com.dremio.dac.daemon.DremioDaemon dremio start

  • Use NSSM to create a service out of the start.cmd file

  • You might need to open a port on the Windows local firewall.

Those steps are pretty easy to automate from Ansible, the Dremio folder is actually zipped up and part of the Ansible task that deploys it and the start.cmd is a Jinja2 template so it gets filled up with the correct locations as each customer has slightly different “best-practices” on where to install stuff. The service approach allows Dremio to start at boot time and stopping the service stops Dremio.
Upgrading will probably be a simple remove of the old D:/Dremio-3.0.1 folder and deploy the new version in it’s own folder and update the start.cmd file with the correct location.

Hope it might help someone :wink:


1 Like