Home » Posts tagged "console"

GCP 的 f1-micro 的使用心得...

這幾天在弄備援跳板機,不想弄在日本 (latency),所以就想到 Google Cloud Platform (GCP) 在台灣有機房,而 Compute Enginef1-micro,類似 AWSEC2 提供的 t2.nano 的機器。而這兩天玩了玩,大概有些事情值得記錄起來。

CPU 相關的部份:

  • EC2 的 t2 系列可以透過 API 或是在 web console 看到 CPU credit 剩下多少,GCE 沒找到在哪邊可以看。
  • EC2 的 t2 系列在 CPU credit 用完後是變慢運行,除非你打開 T2 Unlimited 同意 AWS 多收錢。而 GCE 的則是沒得選,相當於一定要開 T2 Unlimited。
  • GCE 的 f1-micro 是 0.2 vCPU,但我在上面跑 Ubuntu 18.04,平常沒事就已經是 15% 左右。這數字比預期的高不少,還在找是什麼原因...

網路相關的部份:

  • 因為要用台灣的機房,網路的部份只有 Premium 等級可以選 (Standard 等級目前只在美國有),也就是會先走 Google 佈建的網路再出去,所以流出的費用會隨著 destination 地區而有差異 (i.e. 封包送到美國與送到中國是不同計價)。
  • 但 Premium 等級實測品質真的很不一樣,到香港居然在 15ms 以下,以前在固網機房內沒看過這個數字...

其他的部份:

  • 硬碟空間方面,Standard provisioned space 比 EBSgp2 便宜不少,而且還包括了 i/o 費用 (AWS 會另外收費)
  • 連續使用就會有 discount 了,也可以 commit 買一年或是三年取得更深的 discount。而 AWS 則是得買 Reserved Instance 拿到 discount。

來看看一個月會有多少帳單產生吧...

Amazon ECS 的 Service Discovery

AWS 宣佈了 Amazon ECS 也支援 Route 53 提供的 Service Discovery 了:「Introducing Service Discovery for Amazon ECS」。

也就是說現在都整合好了... 比較一下先前需要自己包裝起來套用的方式會少不少功夫:

Previously, to ensure that services were able to discover and connect with each other, you had to configure and run your own service discovery system or connect every service to a load balancer. Now, you can enable service discovery for your containerized services with a simple selection in the ECS console, AWS CLI, or using the ECS API.

AWS 在 2016 年的時候有寫一篇「Service Discovery for Amazon ECS Using DNS」在講怎麼透過事件的觸發配合 AWS Lambda 把服務掛上去或是移除掉:

Recently, we proposed a reference architecture for ELB-based service discovery that uses Amazon CloudWatch Events and AWS Lambda to register the service in Amazon Route 53 and uses Elastic Load Balancing functionality to perform health checks and manage request routing. An ELB-based service discovery solution works well for most services, but some services do not need a load balancer.

現在看起來都可以改用 Auto Naming API 了...

Command Line 的 HTTP 操作工具

忘記在哪邊翻到的:「HTTP Tools Roundup」,裡面有提到一些 Command Line 下操作 HTTP 內容的工具。

其中一個是 HTTPie,這個有時後會拿來用,不過大多數的時候還是習慣用 curl 了 (因為 curl 幾乎都會裝,HTTPie 要另外裝):

另外一個是 http-console,這是第一次看到... 用過後覺得還不錯,應該會記起來用一陣子看看 XD

gslin@home [~] [17:24/W5] http-console --ssl https://emma.pixnet.cc:443/
> http-console 0.6.4
> Welcome, enter .help if you're lost.
> Connecting to emma.pixnet.cc on port 443.

https://emma.pixnet.cc:443/> GET /robots.txt
HTTP/1.1 200 OK
Date: Sat, 11 Nov 2017 09:24:11 GMT
Last-Modified: Tue, 16 Sep 2014 06:45:02 GMT
Etag: "2b-50329173d7780"
Accept-Ranges: bytes
Content-Length: 43
Vary: Accept-Encoding,User-Agent
P3p: CP="CURa ADMa DEVa PSAo PSDo OUR IND UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
X-Farmid: ba2629de4a01c1a81a0ad72ff1f11c5d2ae5ed0782561f591105c5a669e4ea49
Access-Control-Allow-Origin: *
Connection: close
Content-Type: text/plain

# emma.pixnet.cc
User-agent: *
Disallow: /
https://emma.pixnet.cc:443/>

然後再下 GET /glossary/twzipcode 又可以拉出其他東西。

Amazon ECS 可以跑 cron job 了...

Amazon ECS 上面固定時間跑某些東西,以前得自己用 AWS Lambda 帶 (或是自己架,不過這樣就要自己考慮 High Availability 架構了),現在則是直接支援:「Amazon ECS Now Supports Time and Event-Based Task Scheduling」。

Previously, you could start and stop Amazon ECS tasks manually, but running tasks on a schedule required writing and integrating an external scheduler with the Amazon ECS API.

Now you can schedule tasks through the Amazon ECS console on fixed time intervals (e.g.: number of minutes, hours, or days). Additionally, you can now set Amazon ECS as a CloudWatch Events target, allowing you to launch tasks by using CloudWatch Events.

結果 AWS Console 對 EC2 的 IAM Role 被拔掉了...

在 console 上發現不見了,跑去 forum 上看看是不是有其他人遇到同樣的問題,結果發現被拔掉了:「Attach IAM Role to existing EC2 instance in console not available」。

On Friday, Feb 24th, we were made aware that under certain conditions, the feature was not working for customers using the EC2 console. As a result, we have temporarily removed this capability from the EC2 console, but we will enable this feature when this issue has been resolved.

Ouch... 只好先用 CLI 了...

AWS 的稽核報告服務:AWS Artifact

以往要取得 AWS 的稽核報告都必須簽署 NDA 並透過 support ticket 取得 (或是找窗口拿),現在 AWS 把這件事情做成一個服務:「Introducing AWS Artifact: Speeding Access to Compliance Reports」。

服務叫做 AWS Artifact,還是要簽保密協議,不過電子化了:

You can start downloading the audit reports in the AWS Management Console today. Many of the documents are confidential and require you to accept Amazon’s confidentiality terms and conditions, but after you review and agree to those terms, you will be granted instant access to review documents.

這樣取得資料就可以透過系統直接拉出來了:

To document the current and historical compliance of the AWS infrastructure and services, many AWS customers provide compliance reports—including those for ISO, SOC, and PCI—to their auditors or regulators.

Terminal 下操作 VMware 的 vSphere

Twitter 上看到 zmx 提到:

其中 Ruby vSphere Console (rvc) 被標成 deprecated:

Note: This Fling is deprecated, so the download is no longer available, and it will not be updated. Also, feedback is no longer monitored.

Python vSphere Client with a dialog(1) interface (pvc) 看起來比較新:

不過我自己測試後發現死在 SSL certificate 上,之後再來研究要怎麼閃開吧...

Archives