跳到主要內容

發表文章

目前顯示的是 8月, 2018的文章

[GCP] gcloud command

登入GCP  - 開發專案如果權限沒有另外設定,依預設登入的google專案 ( Google Cloud SDK Shell ) ---2018/08/30 updated--- gcloud auth login gcloud auth application-default login gcloud config set project  {projId} big query 設定  Partition expiration bq update --time_partitioning_expiration [INTEGER] [PROJECT_ID]:[DATASET].[TABLE] [INTEGER]: second

[GCP] Google Cloud Platform 搬移 VM & cloud sql & datastore

建立同VM 同專案 VM  建立快照 --> 用快照建立新的VM 跨專案 VM  建立快照  --> 用快照建立映像檔 --> 用印象檔建立新的VM Notice  開機磁碟: 自訂映像檔->選擇印象檔 搬移cloud sql step 1. A SQL [Top option] '匯出' setting Bucket and formate is 'SQL' step 2. B SQL [Top option] '匯入' setting Bucket and formate is 'SQL' Bucket path: gs://{Bucket}/file.sql Notice   不同專案的gs要有權限讀取 搬移 datastore 詳細請參考: https://cloud.google.com/datastore/docs/export-import-entities   step 1. 'new' project [menu] 資料儲存庫 -> 啟用datastore step 2. gcloud terminal gcloud auth login  gcloud config set project <projectid> gcloud beta datastore export --kinds=" <KIND> " gs:// <BUCKET> gcloud config set project new-projectid gcloud datastore export gs:// <BUCKET> Notice  跨專案gs storage auth 需要新增  xxx@appspot.gserviceaccount.com  [storage BUCKET 讀取者] 權限

[command] Centos Nginx Install & Setting

作業環境: Centos 7 安裝  nginx 添加CentOS 7 Nginx yum资源库 rpm -Uvh  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 安裝 yum install nginx 配置 nginx mkdir -p /etc/nginx/config.d vim /etc/nginx/nginx.conf    #編輯如下 ........................ http {          include /etc/nginx/conf.d/*.conf;   #Nginx設定檔包含 config.d的所有conf檔 ....................... ....................... Nginx 設定專案的 conf vim /etc/nginx/config.d/<proj>.conf  server {       listen 80;         server_name unapy.test.com;     #對外的Url         location / {         proxy_pass http://127.0.0.1:5000;     #對應內網的Url     } } 啟動 Nginx   service nginx start 停止 Nginx   service nginx stop 設定開機自動啟動 Setting reboot auto start Nginx chkconfig nginx on chkconfig nginx on   #顯示N ote: Forwarding request to 'systemctl enable nginx.service'. 出現502錯誤,關閉 selinux sudo vim /etc/sysconfig/selinux sudo vim /etc/sysconfig/selinux 如果不