Skip to content

Commit 0db6959

Browse files
simonmorleydadoonet
authored andcommitted
Included notes about compute engine permissions
Closes #25. Closes #26.
1 parent b45a05f commit 0db6959

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

README.md

+53-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ multicast environments). Here is a simple sample configuration:
4747
How to start (short story)
4848
--------------------------
4949
50-
* Create Google Compute Engine instance
50+
* Create Google Compute Engine instance (with compute rw permissions)
5151
* Install Elasticsearch
5252
* Install Google Compute Engine Cloud plugin
5353
* Modify `elasticsearch.yml` file
@@ -113,6 +113,17 @@ gcloud compute ssh myesnode1 --zone europe-west1-a
113113
ssh -i ~/.ssh/google_compute_engine 192.158.29.199
114114
```
115115

116+
*Note Regarding Service Account Permissions*
117+
118+
It's important when creating an instance that the correct permissions are set. At a minimum, you must ensure you have:
119+
120+
```
121+
service_account_scope=compute-rw
122+
```
123+
124+
Failing to set this will result in unauthorized messages when starting Elasticsearch.
125+
See [Machine Permissions](#machine-permissions).
126+
116127
Once connected, install Elasticsearch:
117128

118129
```sh
@@ -313,6 +324,8 @@ gcutil setinstancemetadata myesnode1 \
313324
Tips
314325
----
315326

327+
### Store project id locally
328+
316329
If you don't want to repeat the project id each time, you can save it in `~/.gcutil.flags` file using:
317330

318331
```sh
@@ -325,6 +338,45 @@ gcutil getproject --project=es-cloud --cache_flag_values
325338
--project=es-cloud
326339
```
327340

341+
### Machine Permissions
342+
343+
**Creating machines with gcutil**
344+
345+
Ensure the following flags are set:
346+
347+
````
348+
--service_account_scope=compute-rw
349+
```
350+
351+
**Creating with console (web)**
352+
353+
When creating an instance using the web portal, click **Show advanced options**.
354+
355+
At the bottom of the page, under `PROJECT ACCESS`, choose `>> Compute >> Read Write`.
356+
357+
**Creating with knife google**
358+
359+
Set the service account scopes when creating the machine:
360+
361+
```
362+
$ knife google server create www1 \
363+
-m n1-standard-1 \
364+
-I debian-7-wheezy-v20131120 \
365+
-Z us-central1-a \
366+
-i ~/.ssh/id_rsa \
367+
-x jdoe \
368+
--gce-service-account-scopes https://www.googleapis.com/auth/compute.full_control
369+
```
370+
371+
Or, you may use the alias:
372+
373+
```
374+
--gce-service-account-scopes compute-rw
375+
```
376+
377+
If you have created a machine without the correct permissions, you will see `403 unauthorized` error messages. The only
378+
way to alter these permissions is to delete the instance (NOT THE DISK). Then create another with the correct permissions.
379+
328380
License
329381
-------
330382

0 commit comments

Comments
 (0)