Archlinux Installation in Oracle Cloud

인스턴스 생성 / 이미지 및 구성 / 이미지 소스에서 Archlinux image 선택 후 이미지 선택

SSH 키 추가하고

사용자정의 부트 볼륨 크기 지정

고급옵션표시 / Cloud-init 스크립트 붙여넣기 아래 내용 입력
Oracle Cloud 에이전트에서 플러그인 선택해제후 생성

system_info: 
  default_user: 
    name: arch 
    lock_passwd: True 
    gecos: arch Cloud User 
    groups: [wheel, adm] 
    sudo: ["ALL=(ALL) NOPASSWD:ALL"] 
    shell: /bin/bash 
#cloud-config 
users: 
- name: arch 
  ssh_authorized_keys:
    ssh-rsa AAAAB3N……

생성되었으면
1분정도 뒤 ssh로 접속

[arch@instance-20230128-1123 pacman.d]$ sudo -i
[root@instance-20230128-1123 ~]# echo "Server = http://mirror.premi.st/archlinux/$repo/os/$arch" > mirrorlist
[root@instance-20230128-1123 ~]pacman -Sy archlinux-keyring
[root@instance-20230128-1123 ~]pacman-key --refresh-keys
[root@instance-20230128-1123 ~]pacman -Syu && yes | paman -Scc
[root@instance-20230128-1123 ~]pacman -S vi

OCI CLI Object Storage

  • Bucket의 Object 조회
yongsub_yu@cloudshell:~ (ap-seoul-1)$ oci os object list -ns cnsbwisrzyoz -bn storage
{
"data": [
{
"archival-state": null,
"etag": "f99d8e28-1cae-48c6-af7d-b9fc8de33e52",
"md5": "YSvTrFJcP6fHtig88uPGvQ==",
"name": "NPKI.zip",
"size": 10102,
"storage-tier": "Standard",
"time-created": "2020-12-09T04:38:05.645000+00:00",
"time-modified": "2020-12-09T04:38:05.663000+00:00"
}
],
"prefixes": []
}
  • Bucket에 Object 업로드
yongsub_yu@cloudshell:~ (ap-seoul-1)$ oci os object put -ns cnsbwisrzyoz -bn storage --file .bashrc
{
"etag": "06ec70dd-84d9-4118-aeba-e5501b1fcc93",
"last-modified": "Wed, 11 Aug 2021 00:10:12 GMT",
"opc-content-md5": "4fMsu5L917P9e9Q7y0uvAQ=="
}

Oracle cloud shell

oracle cloud 서버에 접속하기 위해 cloud shell에 접속환경을 만들었다.

ssh key 생성

아래와 같이 private key, public key 생성

yongsub_yu@cloudshell:~ (ap-seoul-1)$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/yongsub_yu/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/yongsub_yu/.ssh/id_rsa.
Your public key has been saved in /home/yongsub_yu/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
+---[RSA 2048]----+
|      .o   .+    |
|     .. = +=o.  o|
|      .B BEoo+ +.|
|    ..+o=.=.. =  |
|     o.oSo o + . |
|     ...o . . +  |
|      ..   o .   |
|        . o +... |
|         . =ooo.+|
+----[SHA256]-----+

접속대상 서버의 .ssh/autorized_key 파일에 위에서 생성된 public_key 등록

접속할 서버 .ssh/config 에 등록

yongsub_yu@cloudshell:~ (ap-seoul-1)$ cat .ssh/config
Host
HostName
User
IdentityFile ~/.ssh/id_rsa
Host
HostName
User
IdentityFile ~/.ssh/id_rsa
Host
HostName
User
IdentityFile ~/.ssh/id_rsa
Host sbg
HostName
User
IdentityFile ~/.ssh/id_rsa

cloud shell의 Public IP 조회

cloud shell에서 아래와 같이 Public IP를 조회하고

yongsub_yu@cloudshell:~ (ap-seoul-1)$ curl ipecho.net/plain
132.145.85.85

firewall 정책 추가

Oracle cloud free tier vm benchmark

Oracle cloud free tier Ampere Arm A1 를 설치하고 기존 E2.1.Micro 머신과 성능면에서 어떤 차이가 있는지 테스트 해보았다.

생성한 인스턴스는 3개이다.

E2 머신은 2개까지 생성할 수 있으며 각각 1 OCPU, 1GB MEM 이다.

A1 머신은 arm 4 OCPU, 24GB MEM이다.

그리고 스토리지는 200GB까지 제공된다.

E2.1.Micro 2*50GB, A1.Flex 100GB

sysbench 테스트 결과

왼쪽 A1.Flex(threads=4), 오른쪽 E2.1.Micro(threads=2)

CPU Test
Memory Test
Fileio Test

geekbench 테스트 결과

A1.Flex
E2.1.Micro
Compare : A1.Flex vs E2.1.Micro

Internet speed test

A1.Flex

ubuntu@joseph.home.kg:~$ speedtest-cli --server 6527
Retrieving speedtest.net configuration...
Testing from Oracle Cloud (146.56.135.248)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by kdatacenter.com (Seoul) [1.72 km]: 126.767 ms
Testing download speed................................................................................
Download: 327.15 Mbit/s
Testing upload speed......................................................................................................
Upload: 286.66 Mbit/s

E2.1.Micro

ubuntu@joseph.ml:~$ speedtest-cli --server 6527
Retrieving speedtest.net configuration...
Testing from Oracle Cloud (132.226.174.165)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by kdatacenter.com (Seoul) [1.72 km]: 25.31 ms
Testing download speed................................................................................
Download: 47.77 Mbit/s
Testing upload speed......................................................................................................
Upload: 49.24 Mbit/s

GCP e2-micro (2 vCPUs, 1 GB memory)

sysbench

ubuntu@seobi.ga:~/.ssh$ sysbench cpu --threads=2 run
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 2
Initializing random number generator from current time
Prime numbers limit: 10000
Initializing worker threads...
Threads started!
CPU speed:
    events per second:  1434.84
General statistics:
    total time:                          10.0006s
    total number of events:              14352
Latency (ms):
         min:                                    1.25
         avg:                                    1.39
         max:                                    1.75
         95th percentile:                        1.42
         sum:                                19993.78
Threads fairness:
    events (avg/stddev):           7176.0000/0.00
    execution time (avg/stddev):   9.9969/0.00
ubuntu@seobi.ga:~/.ssh$ sysbench memory --threads=2 run
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 2
Initializing random number generator from current time
Running memory speed test with the following options:
  block size: 1KiB
  total size: 102400MiB
  operation: write
  scope: global
Initializing worker threads...
Threads started!
Total operations: 60038571 (6002657.69 per second)
58631.42 MiB transferred (5861.97 MiB/sec)
General statistics:
    total time:                          10.0001s
    total number of events:              60038571
Latency (ms):
         min:                                    0.00
         avg:                                    0.00
         max:                                    0.53
         95th percentile:                        0.00
         sum:                                11801.23
Threads fairness:
    events (avg/stddev):           30019285.5000/13537.50
    execution time (avg/stddev):   5.9006/0.00
ubuntu@seobi.ga:~/.ssh$ sysbench fileio --file-test-mode=seqwr --threads=2 run
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 2
Initializing random number generator from current time
Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing sequential write (creation) test
Initializing worker threads...
Threads started!
File operations:
    reads/s:                      0.00
    writes/s:                     11316.04
    fsyncs/s:                     14504.31
Throughput:
    read, MiB/s:                  0.00
    written, MiB/s:               176.81
General statistics:
    total time:                          10.0106s
    total number of events:              258266
Latency (ms):
         min:                                    0.01
         avg:                                    0.08
         max:                                    7.62
         95th percentile:                        0.12
         sum:                                19870.63
Threads fairness:
    events (avg/stddev):           129133.0000/1827.00
    execution time (avg/stddev):   9.9353/0.00

geekbench

speedtest

yongsub_yun@instance-1:~/tmp$ speedtest-cli --server 35180
Retrieving speedtest.net configuration...
Testing from Google Cloud (35.233.201.214)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by Ziply Fiber (Seattle, WA) [239.62 km]: 7.884 ms
Testing download speed................................................................................
Download: 2262.39 Mbit/s
Testing upload speed......................................................................................................
Upload: 869.60 Mbit/s