github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/commands/operator/raft/state.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: operator raft state'
     4  description: |
     5    Display Raft server state.
     6  ---
     7  
     8  # Command: operator raft state
     9  
    10  The `raft state` command is used to display the server state obtained by
    11  replaying raft log entries persisted in the Nomad [data directory] in
    12  JSON format.
    13  
    14  This command requires file system permissions to access the data
    15  directory on disk. The Nomad server locks access to the data
    16  directory, so this command cannot be run on a data directory that is
    17  being used by a running Nomad server.
    18  
    19  ~> **Warning:** This is a low-level debugging tool and not subject to
    20    Nomad's usual backward compatibility guarantees.
    21  
    22  ## Usage
    23  
    24  ```plaintext
    25  nomad operator raft state [options] <path to data dir>
    26  ```
    27  
    28  ## Raft State Options
    29  
    30  - `-last-index=<last_index>`: Set the last log index to be applied, to
    31    drop spurious log entries not properly committed. If the
    32    `last_index` option is zero or negative, it's treated as an offset
    33    from the last index seen in raft.
    34  
    35  ## Examples
    36  
    37  The output of this command can be very large, so it's recommended that
    38  you redirect the output to a file for later examination with other
    39  tools.
    40  
    41  ```shell-session
    42  $ sudo nomad operator raft state /var/nomad/data > ~/raft-state.json
    43  $ jq . < ~/raft-state.json
    44  ```
    45  
    46  [data directory]: /docs/configuration#data_dir