google-compute-engine

Container Engine: AttributeError: 'module' object has no attribute 'Credentials'

允我心安 提交于 2019-12-24 16:24:35
问题 I'm following the "hello wordpress" example: https://cloud.google.com/container-engine/docs/tutorials/hello-wordpress, but it stops with: henrik_ormasen_gmail_com@k8s-test2-master:~$ gcloud alpha container kubectl create -f wordpress.json Traceback (most recent call last): File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 209, in <module> main() File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line

How do you access the console of a GCE VM instance?

自古美人都是妖i 提交于 2019-12-24 13:14:47
问题 How can I access the console of a Google Compute Engine VM instance? 回答1: To see the console output (read-only), you can use any of the following methods: Web UI via Developers Console – on the instance detail page, scroll to the bottom of the page and expand the console output view CLI via gcloud compute instances get-serial-port-output API via getSerialPortOutput To get read/write (interactive) access, follow instructions on this page: gcloud compute instances add-metadata [INSTANCE_NAME] \

Setup HTTP(S) Load Balancer on Compute Engine for WordPress installed on Nginx

和自甴很熟 提交于 2019-12-24 11:44:57
问题 I'm working to set up an autoscaled WordPress site with Nginx on Compute engine, Here's my workaround: I have set up an Instance on which Installed Nginx and set up my WordPress site. Created a cloud SQL instance for the database of WordPress site. Create Custom Compute Engine Image from my Instance Disk on which I have set up my WP site. Then Create an Instance Template using the custom Image I have created. Then create my required 4 managed, autoscaled instance groups based on the my

Applying rightsizing recommendations through an API in GCP

社会主义新天地 提交于 2019-12-24 10:56:46
问题 I wanted to know if there is a way to apply rightsizing recommendation which is provided for VM using an API call instead of doing it through UI in GCP Compute Engine? For ex: if there is a VM with config 16vCPUs and 40GB mem, and if the rightsizing recommendation on usage basis is to change the config to 12vCPUs and 20GB, Is there an API available which performs this action? I know it can be done manually through the interface. Thanks. 回答1: You can use the CLI to change the machine type for

Keep running Dataproc Master node

不想你离开。 提交于 2019-12-24 10:18:31
问题 Is it possible to keep the master machine running in Dataproc? Every time that I run the job after a while (~1 hour), I see the master node is stopped. It is not a real issue since I would easily start it again but I would like to know if there is a way to keep it awake. A possible way that occurs to me is to do a schedule job in the master machine, but want to know if there is more official way to achieve this. 回答1: Dataproc does not stop any cluster nodes (including master) when they are

Can't access Flask app running on 0.0.0.0 on GCE

家住魔仙堡 提交于 2019-12-24 10:01:01
问题 I set Firewall Rule for my local google compute instance at host '0.0.0.0' and port 7000. And I executed python server.py , it was running on https://0.0.0.0:7000 but when I enter https://external-ip:7000 on my local browser it did not work. So how can I run flask on google compute engine and open in my local computer browser? server.py from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World’ if __name__ == '__main__': app.run(debug=1,port=7000

Google Compute Engine: How to snapshot a VM's disk

為{幸葍}努か 提交于 2019-12-24 09:23:40
问题 I'm trying to follow these instructions: https://cloud.google.com/compute/docs/disks#creating_snapshots It's not obvious to me if I'm supposed to run the "gcloud compute disks snapshot DISK" command from my personal machine, or on the VM over SSH. I tried the former and I couldn't figure out an argument for DISK that worked. So I SSH'ed into the machine and ran $ gcloud compute disks snapshot / I left that running for several hours, without seeing any indication of progress. Now when I try to

Docker login to GCE using ansible 'Docker login' and _json_key

血红的双手。 提交于 2019-12-24 07:38:12
问题 I'm trying to write an ansible role that first does a docker login to a GCE instance before pulling images from the container registry. I need to do this because of the problem mentioned here. First I tried the code block below - name: Docker Login docker_login: registry: https://eu.gcr.io username: _json_key debug: true password: "{{ lookup('file', 'pulse-psg-863d9955d8a1.json')}}" The error I get with this is (private key modified) fatal: [en1-a-sftp-delivery-0]: FAILED! => { "changed":

I can connect to a google cloud deployed mongoDB from localhost but not from the same app when deploying on the app engine

穿精又带淫゛_ 提交于 2019-12-24 06:47:31
问题 My app is written in React and Express using Mongoose for the db. I deployed a bitnami mongoDB instance on google compute engine. Now I'm trying to deploy the server on the App engine. When I run my app locally it connects fine to the db (I can add stuff and see it). But when I do an npm start in the google cloud shell is get this error: 'failed to connect to server [35.196.182.249:27017] on first connect [MongoError: connection 0 to 35.196.182.249:27017 timed out]' } (node:1310)

Google Cloud - accessing Linux VM via private key

こ雲淡風輕ζ 提交于 2019-12-24 03:33:07
问题 I have created a linux VM in Google cloud, and right now I am trying to access the VM through SSH. I am able to SSH to the server, if I am loged-in to the console via the interface , However I am trying to generate a portable private key file (pem) which I can use it to remote to the server from anywhere . I can achieve this easily on AWS, or Azure during the VM creation, but this doesn't seem to be the case on GC. 回答1: I understand what you mean, but google do it in a bit more automatically.