3

I'm trying to run consul on windows, my steps:

  1. Download consul.exe
  2. Install nssm like

    2.1.iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

    2.2.choco install -y nssm

  3. Create config file for consul:

    { "bootstrap": false, "server": true, "datacenter": "MyServices", "data_dir": "C:\Marchello\Downloads\cons\data", "log_level": "INFO" }

  4. Execute nssm command:

    nssm install Consul C:\Marchello\Downloads\cons\consul.exe agent -config-dir C:\Marchello\Downloads\cons\config --ui-dir C:\Marchello\Downloads\cons\ui

  5. Got message Service Consul installed successfully

  6. Run command nssm start Consul In result I'm getting message: Consul: Unexpected status SERVICE_PAUSED in response to START control

I'm confused, what I'm doing wrong?

Kadzhaev Marat
  • 1,278
  • 1
  • 19
  • 33

2 Answers2

4

Try using windows service sc.exe

Basic Consul configuration JSON

{
  "datacenter": "east-aws",
  "data_dir": "d:\\workspace\\consul",
  "log_level": "INFO",
  "node_name": "foobar",
  "server": true,
  "bind_addr": "127.0.0.1",
  "bootstrap": true,
  "ui": true,
  "log_file" : "d:\\workspace\\consul.log" 
}

Here above config.json is kept in this folder d:\workspace\consul

sc.exe create "Consul" binPath= "d:\workspace\consul\Consul.exe agent -config-dir=d:\workspace\consul" start= auto

In the above command, a space is mandatory after binPath=< space> and also the open/close of the double quote. This means all the consul related command should come within the double quote.

sc.exe start "Consul"

Narottam Goyal
  • 3,534
  • 27
  • 26
2

How many of the services are starting actually? It happens when starting more than ~16 services. The first 16 will start successfully, and then the rest stays as in "Paused" state.

On the other hand, it might be a privilege issue. Changing the logon to Administrator should fix the issue.

Also, check Application event log for errors where the source is nssm around the time you have installed the service.

Hope the steps help you.

Ranadip Dutta
  • 8,857
  • 3
  • 29
  • 45