Creating ONOS Cluster 2.0.0

ONOS adalah software defined networking controller yang mendukung high availability. Artikel ini membantu untuk membuat ONOS Cluster

Berikut adalah spesifikasi untuk Atomix Cluster yang akan dibangun :

  • zu-atomix1 ( 10.150.150.10)
  • zu-atomix2 (10.150.150.20)
  • zu-atomix3 (10.150.150.30)

Dan berikut adalah spesifikasi untuk ONOS Cluster :

  • zu-onos1 (10.150.150.40)
  • zu-onos2 (10.150.150.50)
  • zu-onos3 (10.150.150.60)

 

Pembentukan Atomix Cluster

tambahkan konfigurasi berikut di setiap atomix Cluster (sesuaikan dengan hostname masing-masing)

sudo nano /etc/hosts
10.150.150.10 zu-atomix1
10.150.150.20 zu-atomix2
10.150.150.30 zu-atomix3
10.150.150.40 zu-onos1
10.150.150.50 zu-onos2
10.150.150.60 zu-onos3

Install Java

apt install git zip curl unzip python-minimal openjdk-8-jdk -y

Unduh atomix pada semua node atomix

mkdir ~/atomix && cd ~/atomix
wget https://oss.sonatype.org/content/repositories/releases/io/atomix/atomix-dist/3.1.0-beta2/atomix-dist-3.1.0-beta2.tar.gz
tar -xvf atomix-dist-3.1.0-beta2.tar.gz

buat konfigurasi atomix (conf/atomix.conf).

pada atomix 1:

cluster {
  cluster-id: onos
  node {
    id: zu-atomix1
    address: "10.150.150.10:5679"
  }
  discovery {
    type: bootstrap
    nodes.1 {
      id: zu-atomix1
      address: "10.150.150.10:5679"
    }
    nodes.2 {
      id: zu-atomix2
      address: "10.150.150.20:5679"
    }
    nodes.3 {
      id: zu-atomix3
      address: "10.150.150.30:5679"
    }
  }
}
 
management-group {
  type: raft
  partitions: 1
  storage.level: disk
  members: [zu-atomix1, zu-atomix2, zu-atomix3]
}
 
partition-groups.raft {
  type: raft
  partitions: 3
  storage.level: disk
  members: [zu-atomix1, zu-atomix2, zu-atomix3]
}

pada atomix 2:

cluster {
  cluster-id: onos
  node {
    id: zu-atomix2
    address: "10.150.150.20:5679"
  }
  discovery {
    type: bootstrap
    nodes.1 {
      id: zu-atomix1
      address: "10.150.150.10:5679"
    }
    nodes.2 {
      id: zu-atomix2
      address: "10.150.150.20:5679"
    }
    nodes.3 {
      id: zu-atomix3
      address: "10.150.150.30:5679"
    }
  }
}
 
management-group {
  type: raft
  partitions: 1
  storage.level: disk
  members: [zu-atomix1, zu-atomix2, zu-atomix3]
}
 
partition-groups.raft {
  type: raft
  partitions: 3
  storage.level: disk
  members: [zu-atomix1, zu-atomix2, zu-atomix3]
}

pada atomix 3:

cluster {
  cluster-id: onos
  node {
    id: zu-atomix3
    address: "10.150.150.30:5679"
  }
  discovery {
    type: bootstrap
    nodes.1 {
      id: zu-atomix1
      address: "10.150.150.10:5679"
    }
    nodes.2 {
      id: zu-atomix2
      address: "10.150.150.20:5679"
    }
    nodes.3 {
      id: zu-atomix3
      address: "10.150.150.30:5679"
    }
  }
}
 
management-group {
  type: raft
  partitions: 1
  storage.level: disk
  members: [zu-atomix1, zu-atomix2, zu-atomix3]
}
 
partition-groups.raft {
  type: raft
  partitions: 3
  storage.level: disk
  members: [zu-atomix1, zu-atomix2, zu-atomix3]
}

Jalankan Atomix

./bin/atomix-agent

Pembentukan ONOS Cluster

tambahkan konfigurasi berikut di setiap ONOS Cluster (sesuaikan dengan hostname masing-masing)

sudo nano /etc/hosts

10.150.150.10 zu-atomix1
10.150.150.20 zu-atomix2
10.150.150.30 zu-atomix3
10.150.150.40 zu-onos1
10.150.150.50 zu-onos2
10.150.150.60 zu-onos3

install ONOS disemua node ONOS, kamu bisa mengikuti tutorial ini, sesuaikan saja versi ONOSnya, tambahkan file ini disemua node ONOS (sesuaikan IP dan ID onos pada konfigurasi dibawah):

sudo -u sdn mkdir /opt/onos/config
sudo -u sdn nano /opt/onos/config/cluster.json
{
  "name": "onos",
  "node": {
    "id": "zu-onos1",
    "ip": "10.150.150.40",
    "port": 9876
  },
  "storage": [
    {
      "id": "zu-atomix1",
      "host": "zu-atomix1",
      "port": 5679
    },
    {
      "id": "zu-atomix2",
      "host": "zu-atomix2",
      "port": 5679
    },
    {
      "id": "zu-atomix3",
      "host": "zu-atomix3",
      "port": 5679
    }
  ]
}
systemctl restart onos

Buka ONOS Dashboard

kamu dapat membuka melalui IP Addres semua controller ONOS.

 

Comments are closed.