Creating ONOS 1.14 Cluster

mulai versi owl, ONOS merubah desain cluster dimana memisahkan  cluster management, service discovery, dan persistent data storage dari node onos itu sendiri. Fungsi-fungsi itu dipisah kedalam sebuah atomix cluster.

Berikut adalah spesifikasi untuk Atomix Cluster yang akan dibangun :

  • Atomix 1 ( 192.168.123.66)
  • Atomix 2 (192.168.123.127)
  • Atomix 3 (192.168.123.72)

Dan berikut adalah spesifikasi untuk ONOS Cluster :

  • ONOS 1 (192.168.123.105)
  • ONOS 2 (192.168.123.69)
  • ONOS 3 (192.168.123.112)

Pembentukan Atomix Cluster

Install Java

sudo apt-get update
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default curl -y

pada semua node, unduh terlebih dahulu atomix packagenya

curl -o atomix-dist-3.0.7.tar.gz -XGET https://oss.sonatype.org/content/repositories/releases/io/atomix/atomix-dist/3.0.7/atomix-dist-3.0.7.tar.gz
tar -xvf atomix-dist-3.0.7.tar.gz

edit atomix cluster configuration (conf/atomix.conf) :

  • Atomix 1
cluster {
  cluster-id: onos
  node {
    id: atomix-1
    address: "192.168.123.66:5679"
  }
  discovery {
    type: bootstrap
    nodes.1 {
      id: atomix-1
      address: "192.168.123.66:5679"
    }
    nodes.2 {
      id: atomix-2
      address: "192.168.123.127:5679"
    }
    nodes.3 {
      id: atomix-3
      address: "192.168.123.72:5679"
    }
  }
}
 
management-group {
  type: raft
  partitions: 1
  storage.level: disk
  members: [atomix-1, atomix-2, atomix-3]
}
 
partition-groups.raft {
  type: raft
  partitions: 3
  storage.level: disk
  members: [atomix-1, atomix-2, atomix-3]
}
  • Atomix 2
cluster {
  cluster-id: onos
  node {
    id: atomix-2
    address: "192.168.123.127:5679"
  }
  discovery {
    type: bootstrap
    nodes.1 {
      id: atomix-1
      address: "192.168.123.66:5679"
    }
    nodes.2 {
      id: atomix-2
      address: "192.168.123.127:5679"
    }
    nodes.3 {
      id: atomix-3
      address: "192.168.123.72:5679"
    }
  }
}
 
management-group {
  type: raft
  partitions: 1
  storage.level: disk
  members: [atomix-1, atomix-2, atomix-3]
}
 
partition-groups.raft {
  type: raft
  partitions: 3
  storage.level: disk
  members: [atomix-1, atomix-2, atomix-3]
}
  • Atomix 3
cluster {
  cluster-id: onos
  node {
    id: atomix-3
    address: "192.168.123.72:5679"
  }
  discovery {
    type: bootstrap
    nodes.1 {
      id: atomix-1
      address: "192.168.123.66:5679"
    }
    nodes.2 {
      id: atomix-2
      address: "192.168.123.127:5679"
    }
    nodes.3 {
      id: atomix-3
      address: "192.168.123.72:5679"
    }
  }
}
 
management-group {
  type: raft
  partitions: 1
  storage.level: disk
  members: [atomix-1, atomix-2, atomix-3]
}
 
partition-groups.raft {
  type: raft
  partitions: 3
  storage.level: disk
  members: [atomix-1, atomix-2, atomix-3]
}

Jalankan Atomix Cluster

./bin/atomix-agent

Pembentukan ONOS Cluster

untuk menginstall onos, lihat artikel sebelumnya. Pembentukan cluster cukup mudah, tambahkan konfigurasi ini di /opt/onos/config/cluster.json dan restart ONOS (sesuaikan ip pada ONOS dan IDnya).

sudo -u sdn nano /opt/onos/config/cluster.json

{
  "name": "onos",
  "node": {
    "id": "onos-1",
    "ip": "192.168.123.105",
    "port": 9876
  },
  "storage": [
    {
      "id": "atomix-1",
      "ip": "192.168.123.66",
      "port": 5679
    },
    {
      "id": "atomix-2",
      "ip": "192.168.123.127",
      "port": 5679
    },
    {
      "id": "atomix-3",
      "ip": "192.168.123.72",
      "port": 5679
    }
  ]
}

restart ONOS

systemctl restart onos

 

Comments are closed.