Merge pull request #752 from SkynetLabs/ivo/db_backups_fix
Fix DB backups creation
This commit is contained in:
commit
09fc534249
20
README.md
20
README.md
|
@ -17,12 +17,10 @@ List of available parameters:
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Skynet uses a custom [License](./LICENSE.md). The Skynet License is a source
|
Skynet uses a custom [License](./LICENSE.md). The Skynet License is a source code license that allows you to use, modify
|
||||||
code license that allows you to use, modify and distribute the software, but
|
and distribute the software, but you must preserve the payment mechanism in the software.
|
||||||
you must preserve the payment mechanism in the software.
|
|
||||||
|
|
||||||
For the purposes of complying with our code license, you can use the
|
For the purposes of complying with our code license, you can use the following Siacoin address:
|
||||||
following Siacoin address:
|
|
||||||
|
|
||||||
`fb6c9320bc7e01fbb9cd8d8c3caaa371386928793c736837832e634aaaa484650a3177d6714a`
|
`fb6c9320bc7e01fbb9cd8d8c3caaa371386928793c736837832e634aaaa484650a3177d6714a`
|
||||||
|
|
||||||
|
@ -38,10 +36,11 @@ Mongo needs a couple of extra steps in order to start a secure cluster.
|
||||||
- Manually run an initialisation `docker run` with extra environment variables that will initialise the admin user with
|
- Manually run an initialisation `docker run` with extra environment variables that will initialise the admin user with
|
||||||
a password (example below).
|
a password (example below).
|
||||||
- During the initialisation run mentioned above, we need to make two extra steps within the container:
|
- During the initialisation run mentioned above, we need to make two extra steps within the container:
|
||||||
- Change the ownership of `mgkey` to `mongodb:mongodb`
|
- Change the ownership of `mgkey` to `mongodb:mongodb`
|
||||||
- Change its permissions to 400
|
- Change its permissions to 400
|
||||||
- After these steps are done we can open a mongo shell on the master node and run `rs.add()` in order to add the new
|
- After these steps are done we can open a mongo shell on the primary node and run `rs.add()` in order to add the new
|
||||||
node to the cluster.
|
node to the cluster. If you don't know which node is primary, log onto any server and jump into the Mongo's container
|
||||||
|
(`docker exec -it mongo mongo -u admin -p`) and then get the status of the replica set (`rs.status()`).
|
||||||
|
|
||||||
Example initialisation docker run command:
|
Example initialisation docker run command:
|
||||||
|
|
||||||
|
@ -167,6 +166,9 @@ Steps:
|
||||||
|
|
||||||
#### Configure your CockroachDB node
|
#### Configure your CockroachDB node
|
||||||
|
|
||||||
|
Open port 26257 on all nodes that will take part in the cluster. Ideally, you would only open the port for the other
|
||||||
|
nodes in the cluster.
|
||||||
|
|
||||||
There is some configuration that needs to be added to your `.env`file, namely:
|
There is some configuration that needs to be added to your `.env`file, namely:
|
||||||
|
|
||||||
1. CR_IP - the public IP of your node
|
1. CR_IP - the public IP of your node
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "\n\n`date +"%Y-%m-%d-%H%M"` Starting a DB backup.\n"
|
echo "`date +"%Y-%m-%d-%H%M"` Starting a DB backup."
|
||||||
|
|
||||||
|
# First of all, let's pamper awscli because Python is so special:
|
||||||
|
pip3 install --upgrade awscli
|
||||||
|
|
||||||
# Get current script directory (pwd doesn't cut it)
|
# Get current script directory (pwd doesn't cut it)
|
||||||
csd=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
csd=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
|
|
|
@ -30,14 +30,14 @@ You may want to fork this repository and replace ssh keys in
|
||||||
### Step 1: setting up server user
|
### Step 1: setting up server user
|
||||||
|
|
||||||
1. SSH in a freshly installed Debian machine on a user with sudo access (can be root)
|
1. SSH in a freshly installed Debian machine on a user with sudo access (can be root)
|
||||||
1. `apt-get update && apt-get install sudo -y` to make sure `sudo` is available
|
1. `apt-get update && apt-get install sudo libnss3-tools -y` to make sure `sudo` is available
|
||||||
1. `adduser user` to create user called `user` (creates `/home/user` directory)
|
1. `adduser user` to create user called `user` (creates `/home/user` directory)
|
||||||
1. `usermod -aG sudo user` to add this new user to sudo group
|
1. `usermod -aG sudo user` to add this new user to sudo group
|
||||||
1. `sudo groupadd docker` to create a group for docker (it might already exist)
|
1. `sudo groupadd docker` to create a group for docker (it might already exist)
|
||||||
1. `sudo usermod -aG docker user` to add your user to that group
|
1. `sudo usermod -aG docker user` to add your user to that group
|
||||||
1. Quit the ssh session with `exit` command
|
1. Quit the ssh session with `exit` command
|
||||||
|
|
||||||
You a can now ssh into your machine as the user `user`.
|
You can now ssh into your machine as the user `user`.
|
||||||
|
|
||||||
### Step 2: setting up environment
|
### Step 2: setting up environment
|
||||||
|
|
||||||
|
@ -59,11 +59,11 @@ You a can now ssh into your machine as the user `user`.
|
||||||
|
|
||||||
At this point we have almost everything running, we just need to set up your wallet and allowance:
|
At this point we have almost everything running, we just need to set up your wallet and allowance:
|
||||||
|
|
||||||
1. Create new wallet (remember to save the seeds)
|
1. Create a new wallet (remember to save the seed)
|
||||||
> `docker exec -it sia siac wallet init`
|
> `docker exec -it sia siac wallet init`
|
||||||
1. Unlock wallet (use seed as password)
|
1. Unlock the wallet (use the seed as password)
|
||||||
> `docker exec -it sia siac wallet unlock`
|
> `docker exec -it sia siac wallet unlock`
|
||||||
1. Generate wallet addresse (save them for later to transfer the funds)
|
1. Generate a new wallet address (save it for later to transfer the funds)
|
||||||
> `docker exec -it sia siac wallet address`
|
> `docker exec -it sia siac wallet address`
|
||||||
1. Set up allowance
|
1. Set up allowance
|
||||||
> `docker exec -it sia siac renter setallowance`
|
> `docker exec -it sia siac renter setallowance`
|
||||||
|
@ -75,6 +75,8 @@ At this point we have almost everything running, we just need to set up your wal
|
||||||
1. 500 GB expected upload
|
1. 500 GB expected upload
|
||||||
1. 5 TB expected download
|
1. 5 TB expected download
|
||||||
1. default redundancy
|
1. default redundancy
|
||||||
|
1. Set a maximum storage price
|
||||||
|
> `docker exec -it sia siac renter setallowance --max-storage-price 100SC`
|
||||||
1. Instruct siad to start making 10 contracts per block with many hosts to potentially view the whole network's files
|
1. Instruct siad to start making 10 contracts per block with many hosts to potentially view the whole network's files
|
||||||
> `docker exec -it sia siac renter setallowance --payment-contract-initial-funding 10SC`
|
> `docker exec -it sia siac renter setallowance --payment-contract-initial-funding 10SC`
|
||||||
|
|
||||||
|
|
Reference in New Issue