Skip to content

How to install CB Spider on WSL2's Ubuntu under 공유기(in the private Network)

ByoungSeob Kim edited this page Oct 10, 2024 · 2 revisions

#WSL #공유기

============== In this case: Ubuntu 20.04.2 LTS on WSL2 under 공유기 환경

$ sudo apt update; sudo apt install -y make gcc;
$ wget https://golang.org/dl/go1.17.linux-amd64.tar.gz
$ sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
$ go version
      go version go1.17 linux/amd64
  • build CB-Spider source
$ cd $HOME/go/src/github.com/cloud-barista/cb-spider; make;
        [CB-Spider] build ./interface/spctl...
        [CB-Spider] build ./bin/cb-spider....
  • start CB-Spider server
$ cd $CBSPIDER_ROOT/bin; ./start.sh;

              [CB-Spider] Driver Plugin Mode: Static Builtin Mode

      ubuntu@POWERKIM-YOGA:bin# [CB-SPIDER].[INFO]: 2021-08-22 04:06:46 nutsdb-driver.go:36, github.com/cloud-barista/cb-store/store-drivers/nutsdb-driver.initialize() - ######## dbfile: /home/ubuntu/go/src/github.com/cloud-barista/cb-spider/meta_db/dat
      [CB-SPIDER].[INFO]: 2021-08-22 04:06:46 nutsdb-driver.go:36, github.com/cloud-barista/cb-store/store-drivers/nutsdb-driver.initialize() - ######## dbfile: /home/ubuntu/go/src/github.com/cloud-barista/cb-spider/meta_db/dat
      [CB-SPIDER].[INFO]: 2021-08-22 04:06:46 nutsdb-driver.go:36, github.com/cloud-barista/cb-store/store-drivers/nutsdb-driver.initialize() - ######## dbfile: /home/ubuntu/go/src/github.com/cloud-barista/cb-spider/meta_db/dat
      [CB-SPIDER].[INFO]: 2021-08-22 04:06:46 nutsdb-driver.go:36, github.com/cloud-barista/cb-store/store-drivers/nutsdb-driver.initialize() - ######## dbfile: /home/ubuntu/go/src/github.com/cloud-barista/cb-spider/meta_db/dat
      [CB-SPIDER].[INFO]: 2021-08-22 04:06:46 nutsdb-driver.go:36, github.com/cloud-barista/cb-store/store-drivers/nutsdb-driver.initialize() - ######## dbfile: /home/ubuntu/go/src/github.com/cloud-barista/cb-spider/meta_db/dat
      [CB-SPIDER].[INFO]: 2021-08-22 04:06:48 CBSpiderRuntime.go:342, github.com/cloud-barista/cb-spider/api-runtime/rest-runtime.ApiServer() - **** Rest Auth Disabled ****

        <CB-Spider> Multi-Cloud Infrastructure Federation Framework
           - AdminWeb: http://121.183.128.96:1024/spider/adminweb
           - Swagger UI: http://121.183.128.96.123:1024/spider/api
  • check the health of CB-Spider server
$ curl -sX GET http://localhost:1024/spider/cloudos |json_pp

      [CB-SPIDER].[INFO]: 2021-08-22 04:07:07 CIMRest.go:28, github.com/cloud-barista/cb-spider/api-runtime/rest-runtime.ListCloudOS() - call ListCloudOS()
      [CB-SPIDER].[INFO]: 2021-08-22 04:07:07 CloudOSList.go:62, github.com/cloud-barista/cb-spider/cloud-info-manager.ListCloudOS() - {[ALIBABA AWS AZURE CLOUDIT CLOUDTWIN DOCKER GCP IBM MOCK OPENSTACK]}
      {"time":"2021-08-22T04:07:07.3046753+09:00","id":"","remote_ip":"127.0.0.1","host":"localhost:1024","method":"GET","uri":"/spider/cloudos","user_agent":"curl/7.68.0","status":200,"error":"","latency":435200,"latency_human":"435.2µs","bytes_in":0,"bytes_out":100}
      {
         "cloudos" : [
            "ALIBABA",
            "AWS",
            "AZURE",
            "CLOUDIT",
            "CLOUDTWIN",
            "DOCKER",
            "GCP",
            "IBM",
            "MOCK",
            "OPENSTACK"
         ]
      }

==> 아직은 AdminWeb으로는 접속이 안됨.

==> SERVICE_ADDRESS 설정이 필요.


  • CB-Spider Server 운영 중인 Ubuntu의 IP 확인
$ ifconfig
      eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
              inet 172.28.107.143  netmask 255.255.240.0  broadcast 172.28.111.255
              inet6 fe80::215:5dff:fe5f:80a4  prefixlen 64  scopeid 0x20<link>
              ether 00:15:5d:5f:80:a4  txqueuelen 1000  (Ethernet)
              RX packets 352752  bytes 512305843 (512.3 MB)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 42967  bytes 3450481 (3.4 MB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

      lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
              inet 127.0.0.1  netmask 255.0.0.0
              inet6 ::1  prefixlen 128  scopeid 0x10<host>
              loop  txqueuelen 1000  (Local Loopback)
              RX packets 21  bytes 2060 (2.0 KB)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 21  bytes 2060 (2.0 KB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  • Service_Address 설정 방법

    - Browser는 Ubutu가 아닌 host OS인 Windows에서 실행되므로,
    - Windows에서 접속 가능한 Ubuntu IP인 172.28.107.143로 설정
    
    • vi $CBSPIDER_ROOT/setup.env 에서 다음과 같이 설정

      export SERVICE_ADDRESS="172.28.107.143:1024"

  • restart CB-Spider Server

$ cd $CBSPIDER_ROOT/bin; ./stop.sh;
$ cd $CBSPIDER_ROOT/bin; ./start.sh;
      ... 중략...
     <CB-Spider> Multi-Cloud Infrastructure Federation Framework
        - AdminWeb: http://121.183.128.96:1024/spider/adminweb
        - Swagger UI: http://121.183.128.96.123:1024/spider/api

Table of contents



Clone this wiki locally