@@ -49,34 +49,68 @@ Note: This will require the Compute API to be turned on. Before it can be turned
49
49
``` bash
50
50
GCP_PROJECT_NAME=terra-col-1 # gcloud config get-value project
51
51
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
54
54
GCP_IAM_EMAIL=$( gcloud iam service-accounts list --format=" value(email)" )
55
+ MOINT_POINT=/mnt/columbus-a
56
+ GCP_REGION=asia-southeast1
55
57
56
- gcloud compute instances create $GCP_NODE_SETUP
58
+ # Create the validator node.
59
+ gcloud compute instances create $GCP_NODE_VAL \
57
60
--project=$GCP_PROJECT_NAME \
58
- --zone=us- $GCP_ZONE \
59
- --machine-type=e2-micro \
61
+ --zone=$GCP_ZONE \
62
+ --machine-type=n2-standard-8 \
60
63
--network-interface=network-tier=PREMIUM,subnet=default \
61
64
--maintenance-policy=MIGRATE \
62
65
--service-account=335875269057-compute@developer.gserviceaccount.com \
63
66
--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 \
65
68
--no-shielded-secure-boot \
66
69
--shielded-vtpm \
67
70
--shielded-integrity-monitoring \
68
71
--reservation-affinity=any
69
72
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 \
74
78
--zone=$GCP_ZONE
75
79
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
77
95
```
78
96
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
80
114
81
115
** The service may need to be first enabled in the Google Admin Console.**
82
116
@@ -88,6 +122,28 @@ Turn on _Allow users to create GCP projects_
88
122
89
123
From the dashboard, go to _ Billing_ from the side menu. A prompt appears to "link a billing account".
90
124
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
+
91
147
# Notes
92
148
93
149
## GCP
0 commit comments