LoginSignup
0
0

More than 1 year has passed since last update.

Google Platform に SDKをインストール (コマンドによるサーバー構築に向けて)

Posted at

CentOS8向けの作業ログです。

  1. SDKをdnfでインストールするため、レポジトリ情報を更新します。
tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM

2. dnfコマンドでインストールします。

dnf install google-cloud-sdk

必要に応じで下記もインストールできます。

  • google-cloud-sdk-app-engine-python
  • google-cloud-sdk-app-engine-python-extras
  • google-cloud-sdk-app-engine-java
  • google-cloud-sdk-app-engine-go
  • google-cloud-sdk-bigtable-emulator
  • google-cloud-sdk-cbt
  • google-cloud-sdk-cloud-build-local
  • google-cloud-sdk-datalab
  • google-cloud-sdk-datastore-emulator
  • google-cloud-sdk-firestore-emulator
  • google-cloud-sdk-pubsub-emulator
  • kubectl

3. コマンドが使えるように認証します

注:XXXXXX は伏字にしている箇所です

[root@centos805 ~]# gcloud init
Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag:
  gcloud init --skip-diagnostics

Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

You must log in to continue. Would you like to log in (Y/n)?  Y

Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/auth?response_type=code&XXXXXX

Enter verification code: XXXXXX
You are logged in as: [XXXXXX@gmail.com].

Pick cloud project to use:
 [1] my-projectmemotime
 [2] testpj-85e3a
 [3] Create a new project

※ 3を選んで新規でプロジェクトを作る場合 下記の制限があるので気を付けましょう。
Project IDs must be 6-30 characters (lowercase ASCII, digits, or hyphens) in length and start with a lowercase letter.
下記のコマンドが /usr/bin にインストールされます。

lrwxrwxrwx.  1 root root      38 12月 11 01:50  gsutil -> /usr/lib64/google-cloud-sdk/bin/gsutil
lrwxrwxrwx.  1 root root      56 12月 11 01:50  git-credential-gcloud.sh -> /usr/lib64/google-cloud-sdk/bin/git-credential-gcloud.sh
lrwxrwxrwx.  1 root root      38 12月 11 01:50  gcloud -> /usr/lib64/google-cloud-sdk/bin/gcloud
lrwxrwxrwx.  1 root root      56 12月 11 01:50  docker-credential-gcloud -> /usr/lib64/google-cloud-sdk/bin/docker-credential-gcloud
lrwxrwxrwx.  1 root root      34 12月 11 01:50  bq -> /usr/lib64/google-cloud-sdk/bin/bq
lrwxrwxrwx.  1 root root      41 12月 11 01:50  anthoscli -> /usr/lib64/google-cloud-sdk/bin/anthoscli

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0