Skip to content

Commit a4bb050

Browse files
committed
Updated the READMEs for migration and gcloud.
1 parent e2b4262 commit a4bb050

File tree

2 files changed

+69
-13
lines changed

2 files changed

+69
-13
lines changed

terra/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Create the following sync script (sync.sh) in Server B:
7878

7979
```bash
8080
#!/bin/bash
81-
rsync $SERVER_A:.terra/config/ ~/.terra/config/ -e 'ssh -p $SSH_PORT' --delete --include-from=~/validator-script/terra/includes.txt -vzrc
81+
rsync $SERVER_A:.terra/config/ ~/.terra/config/ -e 'ssh -p '$SSH_PORT --delete --include-from=$HOME/validator-script/terra/includes.txt -vzrc
8282
# Validator key is not synchronized here as it might be for a new server.
8383
rsync $SERVER_A:oracle-feeder/price-server/config/default.js ~/oracle-feeder/price-server/config/ -e 'ssh -p $SSH_PORT' -vzrc
8484
rsync $SERVER_A:oracle-feeder/feeder/voter.json ~/oracle-feeder/feeder/ -e 'ssh -p $SSH_PORT' -vzrc

terra/gcloud/README.md

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,34 +49,68 @@ Note: This will require the Compute API to be turned on. Before it can be turned
4949
```bash
5050
GCP_PROJECT_NAME=terra-col-1 #gcloud config get-value project
5151
GCP_ZONE=asia-southeast1-b
52-
GCP_NODE_SETUP=terra-setup-1
53-
GCP_DISK_SETUP=columbus-a
52+
GCP_NODE_VAL=validator1-terra
53+
GCP_DISK_VALIDATOR=columbus-a
5454
GCP_IAM_EMAIL=$(gcloud iam service-accounts list --format="value(email)")
55+
MOINT_POINT=/mnt/columbus-a
56+
GCP_REGION=asia-southeast1
5557

56-
gcloud compute instances create $GCP_NODE_SETUP
58+
# Create the validator node.
59+
gcloud compute instances create $GCP_NODE_VAL \
5760
--project=$GCP_PROJECT_NAME \
58-
--zone=us-$GCP_ZONE \
59-
--machine-type=e2-micro \
61+
--zone=$GCP_ZONE \
62+
--machine-type=n2-standard-8 \
6063
--network-interface=network-tier=PREMIUM,subnet=default \
6164
--maintenance-policy=MIGRATE \
6265
--service-account=335875269057-compute@developer.gserviceaccount.com \
6366
--scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append \
64-
--create-disk=auto-delete=yes,boot=yes,device-name=$GCP_NODE_SETUP,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20211212,mode=rw,size=10,type=projects/$GCP_PROJECT_NAME/zones/$GCP_ZONE/diskTypes/pd-balanced \
67+
--create-disk=auto-delete=yes,boot=yes,device-name=$GCP_NODE_VAL,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20211212,mode=rw,size=10,type=projects/$GCP_PROJECT_NAME/zones/$GCP_ZONE/diskTypes/pd-balanced \
6568
--no-shielded-secure-boot \
6669
--shielded-vtpm \
6770
--shielded-integrity-monitoring \
6871
--reservation-affinity=any
6972

70-
gcloud compute disks create $GCP_DISK_SETUP \
71-
--size=200GB
72-
--type=pd-ssd
73-
--project=$GCP_PROJECT_NAME
73+
#### Setting up the base node
74+
gcloud compute disks create $GCP_DISK_VALIDATOR \
75+
--size=400GB \
76+
--type=pd-ssd \
77+
--project=$GCP_PROJECT_NAME \
7478
--zone=$GCP_ZONE
7579

76-
gcloud compute instances attach-disk $GCP_NODE_SETUP --disk $GCP_DISK_SETUP
80+
gcloud compute instances attach-disk $GCP_NODE_VAL --disk $GCP_DISK_VALIDATOR --zone=$GCP_ZONE
81+
82+
# gcloud beta compute disks create columbus-b --project=terra-col-1 --type=pd-ssd --size=800GB --zone=us-west1-b
83+
84+
sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,nodiscard /dev/sdb
85+
sudo mkdir $MOUNT_POINT
86+
sudo mount -o discard,defaults /dev/sdb $MOUNT_POINT
87+
```
88+
89+
### ~~Reconfiguring disks~~
90+
91+
~~First check that there are no processes accessing the filesystem.~~
92+
93+
```bash
94+
fuser -v $MOUNT_POINT
7795
```
7896

79-
##### Prerequisites
97+
```bash
98+
sudo umount $MOUNT_POINT
99+
```
100+
101+
```bash
102+
gcloud compute disks resize $GCP_DISK_VALIDATOR --size 500GB --zone $GCP_ZONE
103+
```
104+
105+
~~Reference: https://cloud.google.com/compute/docs/disks/detach-reattach-boot-disk~~
106+
107+
### Resizing disks
108+
109+
Disks can be resized **without** unmounting them.
110+
111+
Reference: https://cloud.google.com/compute/docs/disks/working-with-persistent-disks#resize_pd
112+
113+
### Prerequisites
80114

81115
**The service may need to be first enabled in the Google Admin Console.**
82116

@@ -88,6 +122,28 @@ Turn on _Allow users to create GCP projects_
88122

89123
From the dashboard, go to _Billing_ from the side menu. A prompt appears to "link a billing account".
90124

125+
# Monitoring
126+
127+
## Agent installation
128+
129+
```bash
130+
curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh
131+
sudo bash add-google-cloud-ops-agent-repo.sh --also-install
132+
```
133+
134+
Reference: https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/installation
135+
136+
#### LEGACY
137+
138+
THIS IS REPLACED WITH OPS AGENT.
139+
140+
```bash
141+
curl -sSO https://dl.google.com/cloudagents/add-monitoring-agent-repo.sh
142+
sudo bash add-monitoring-agent-repo.sh --also-install
143+
```
144+
145+
Reference: https://cloud.google.com/monitoring/agent/monitoring/installation#agent-version-debian-ubuntu
146+
91147
# Notes
92148

93149
## GCP

0 commit comments

Comments
 (0)