mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: Unclear that we want users to use Monit (#2533)
Solution: Edit the "How to Set Up a BigchainDB Network" page so that the Monit way is the only fully-documented way. Give a tip for do-it-yourselfers.
This commit is contained in:
parent
c68fab6c31
commit
61ce427e1d
@ -264,28 +264,9 @@ If MongoDB isn't running, then you can start it using the command `mongod`, but
|
|||||||
|
|
||||||
If you installed MongoDB using `sudo apt install mongodb`, then a MongoDB startup script should already be installed (so MongoDB will start automatically when the machine is restarted). Otherwise, you should install a startup script for MongoDB.
|
If you installed MongoDB using `sudo apt install mongodb`, then a MongoDB startup script should already be installed (so MongoDB will start automatically when the machine is restarted). Otherwise, you should install a startup script for MongoDB.
|
||||||
|
|
||||||
## Member: Start BigchainDB and Tendermint
|
## Member: Start BigchainDB and Tendermint Using Monit
|
||||||
|
|
||||||
If you want to use a process manager, jump to the [next section](member-start-bigchaindb-and-tendermint-using-monit).
|
This section describes how to manage the BigchainDB and Tendermint processes using [Monit][monit], a small open-source utility for managing and monitoring Unix processes. BigchainDB and Tendermint are managed together, because if BigchainDB is stopped (or crashes) and is restarted, *Tendermint won't try reconnecting to it*. (That's not a bug. It's just how Tendermint works.)
|
||||||
|
|
||||||
To start BigchainDB, one uses the command `bigchaindb start` but that will run it in the foreground. If you want to run it in the background (so it will continue running after you logout), you can use `nohup`, `tmux`, or `screen`. For example, `nohup bigchaindb start 2>&1 > bigchaindb.log &`
|
|
||||||
|
|
||||||
The _recommended_ approach is to create a startup script for BigchainDB, so it will start right after the boot of the operating system. (As mentioned earlier, MongoDB should already have a startup script.)
|
|
||||||
|
|
||||||
To start Tendermint, one uses the command `tendermint node` but that will run it in the foreground. If you want to run it in the background (so it will continue running after you logout), you can use `nohup`, `tmux`, or `screen`. For example, `nohup tendermint node 2>&1 > tendermint.log &`
|
|
||||||
|
|
||||||
The _recommended_ approach is to create a startup script for Tendermint, so it will start right after the boot of the operating system.
|
|
||||||
|
|
||||||
Note: We'll share some example startup scripts in the future. This document is a work in progress.
|
|
||||||
|
|
||||||
If you followed the recommended approach and created startup scripts for BigchainDB and Tendermint, then you can reboot the machine now. MongoDB, BigchainDB and Tendermint should all start.
|
|
||||||
|
|
||||||
|
|
||||||
### Member: Start BigchainDB and Tendermint using Monit
|
|
||||||
|
|
||||||
This section describes how to manage the BigchainDB and Tendermint processes using [Monit][monit] - a small open-source utility for managing and monitoring Unix processes.
|
|
||||||
|
|
||||||
This section assumes that you followed the guide down to the [start MongoDB section](#member-start-mongodb) inclusive.
|
|
||||||
|
|
||||||
Install Monit:
|
Install Monit:
|
||||||
|
|
||||||
@ -293,32 +274,30 @@ Install Monit:
|
|||||||
sudo apt install monit
|
sudo apt install monit
|
||||||
```
|
```
|
||||||
|
|
||||||
If you installed the `bigchaindb` Python package, you should have the `bigchaindb-monit-config` script in your `PATH` now.
|
If you installed the `bigchaindb` Python package as above, you should have the `bigchaindb-monit-config` script in your `PATH` now. Run the script to build a configuration file for Monit:
|
||||||
|
|
||||||
Run the script:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
bigchaindb-monit-config
|
bigchaindb-monit-config
|
||||||
```
|
```
|
||||||
|
|
||||||
The script builds a configuration file for Monit.
|
|
||||||
|
|
||||||
Run Monit as a daemon, instructing it to wake up every second to check on processes:
|
Run Monit as a daemon, instructing it to wake up every second to check on processes:
|
||||||
|
|
||||||
```
|
```
|
||||||
monit -d 1
|
monit -d 1
|
||||||
```
|
```
|
||||||
|
|
||||||
It will run the processes and restart them when they crash. If the root `bigchaindb_` process crashes, Monit will also restart the Tendermint process.
|
Monit will run the BigchainDB and Tendermint processes and restart them when they crash. If the root `bigchaindb_` process crashes, Monit will also restart the Tendermint process.
|
||||||
|
|
||||||
Check the status by running `monit status` or `monit summary`.
|
You can check the status by running `monit status` or `monit summary`.
|
||||||
|
|
||||||
By default, it will collect program logs into the `~/.bigchaindb-monit/logs` folder.
|
By default, it will collect program logs into the `~/.bigchaindb-monit/logs` folder.
|
||||||
|
|
||||||
Consult `monit -h` or [the Monit documentation][monit-manual] to know more about the operational power you've just got the taste of.
|
To learn more about Monit, use `monit -h` (help) or read [the Monit documentation][monit-manual].
|
||||||
|
|
||||||
Check `bigchaindb-monit-config -h` if you want to arrange a different folder for logs or some of the Monit internal artifacts.
|
Check `bigchaindb-monit-config -h` if you want to arrange a different folder for logs or some of the Monit internal artifacts.
|
||||||
|
|
||||||
|
If you want to start and manage the BigchainDB and Tendermint processes yourself, then look inside the file [bigchaindb/pkg/scripts/bigchaindb-monit-config](https://github.com/bigchaindb/bigchaindb/blob/master/pkg/scripts/bigchaindb-monit-config) to see how *it* starts BigchainDB and Tendermint.
|
||||||
|
|
||||||
## How Others Can Access Your Node
|
## How Others Can Access Your Node
|
||||||
|
|
||||||
If you followed the above instructions, then your node should be publicly-accessible with BigchainDB Root URL `http://hostname:9984` (where hostname is something like `bdb7.canada.vmsareus.net` or `17.122.200.76`). That is, anyone can interact with your node using the [BigchainDB HTTP API](http-client-server-api.html) exposed at that address. The most common way to do that is to use one of the [BigchainDB Drivers](./drivers-clients/index.html).
|
If you followed the above instructions, then your node should be publicly-accessible with BigchainDB Root URL `http://hostname:9984` (where hostname is something like `bdb7.canada.vmsareus.net` or `17.122.200.76`). That is, anyone can interact with your node using the [BigchainDB HTTP API](http-client-server-api.html) exposed at that address. The most common way to do that is to use one of the [BigchainDB Drivers](./drivers-clients/index.html).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user