starting and using spanner

Feb 5, 01:30 PM

1) create new project https://console.cloud.google.com/projects

2) https://console.developers.google.com/iam-admin/
- create IAM and add “cloud spanner admin “ (added all options under “cloud spanner)

3) be SURE billing is installed in project !

4) https://console.cloud.google.com/spanner/ – initialize spanner (dont skip this step)

https://console.developers.google.com/apis/api/spanner.googleapis.com/overview?project=marks-spanner-project-2&duration=P30D (???)

IF NOT USING GOOGLE-VPS:
https://cloud.google.com/sdk/docs/quickstart-redhat-centos
(use the yum option) gcloud init;

IF USING GOOGLE-VPS:
in terminal window:

sudo yum -y update; ## of course!

gcloud config set account marks-spanner-project-2; ## this is PROJECT-ID, not PROJECT-NAME!
gcloud config set project PROJECT_ID ;

gcloud config list ; gcloud auth list ; ### confirm everything.

  1. BE SURE PROJECT NAME MATCHES – this had been a problem!

gcloud auth application-default login; ## will create a temporary “login-link”
gcloud auth login;

gcloud auth list; ## auth list

========================

gcloud spanner instances create test-instance-next \ —config=regional-us-central1 \ —description=“Test Instance” \ —nodes=1 ;
gcloud spanner instances delete test-instance-next ; ## deletes instance

gcloud spanner instances list ;

======================

https://cloud.google.com/spanner/docs/getting-started/nodejs/

git clone https://github.com/googleapis/nodejs-spanner.git ;
cd /nodejs-spanner/samples ;
npm install ;

cool command:
gcloud spanner databases execute-sql example-db \ —instance=test-instance \ —sql=‘SELECT SingerId, AlbumId, AlbumTitle FROM Albums’;

Mark Edwards

,

---

Commenting is closed for this article.

---