SequoiaDB資料庫之叢集管理

buptdream發表於2013-11-26

1.1    叢集中新增主機

1.安裝好與其他主機相同的作業系統,並配置好IP地址;

2.按照系統配置需求一節配置好主機名/核心引數並將其他的主機名和IP對應關係加入到

/etc/hosts中;

3.修改每臺叢集主機上/etc/hosts檔案,將新增的主機IP地址與主機對應關係加入到/etc/hosts

檔案中;

4.按照系統配置需求一節驗證配置的正確性。

5.按照SequoiaDB伺服器安裝一節,安裝SequoiaDB軟體。安裝時,注意配置管理服務埠與現有系統的埠保持一致。

  下面對上面環境增加一臺主機

1:對新安裝的作業系統按照上面提到的圖形介面安裝或者文字安裝,安裝好資料庫軟體

2:配置IP地址為192.168.25.156

3:配置hostname,可以直接在作業系統中執行:hostname sdbserver4

4:修改host檔案

     vi  /etch/hosts

      192.168.25.156  sdbserver4 sdbserver4

192.168.25.151  sdbserver1 sdbserver1

192.168.25.152  sdbserver2 sdbserver2

192.168.25.153  sdbserver3 sdbserver3

wq!,進行儲存退出

在其他節點上同樣修改host檔案,保證所有的節點host檔案一致。

   5:在192.168.25.156中增加新的資料節點

sdbserver4:~ # /opt/sequoiadb/bin/sdb

Welcome to SequoiaDB shell!

help() for help, Ctrl+c or quit to exit

> var db = new Sdb("192.168.25.156",50000)

(nofile):0 uncaught exception: -15  ----------------報錯提示不明確

Takes 0.536s.

> var db = new Sdb("192.168.25.151",50000) 

Takes 0.9074s.

> var datarg = db.getRG("datagroup1")

Takes 0.2140s.

> var datarg = db.getRG("datagroup1")

Takes 0.2196s.

> node3= =datarg.createNode("sdbserver4",51000,"/opt/sequoiadb/database/data/51000")

sdbserver4:51000

Takes 0.21246s.

> node3.start()

Takes 7.26959s.

啟動節點後,用shell命令查詢節點情況:

> db.listReplicaGroups();

{

  "Group": [

    {

      "dbpath": "/opt/sequoiadb/database/cata/30000",

      "HostName": "sdbserver1",

      "Service": [

        {

          "Type": 0,

          "Name": "30000"

        },

        {

          "Type": 1,

          "Name": "30001"

        },

        {

          "Type": 2,

          "Name": "30002"

        },

        {

          "Type": 3,

          "Name": "30003"

        }

      ],

      "NodeID": 1

    },

    {

      "HostName": "sdbserver2",

      "dbpath": "/opt/sequoiadb/database/cata/30000",

      "Service": [

        {

          "Type": 0,

          "Name": "30000"

        },

        {

          "Type": 1,

          "Name": "30001"

        },

        {

          "Type": 2,

          "Name": "30002"

        },

        {

          "Type": 3,

          "Name": "30003"

        }

      ],

      "NodeID": 4

    },

    {

      "HostName": "sdbserver3",

      "dbpath": "/opt/sequoiadb/database/cata/30000",

      "Service": [

        {

          "Type": 0,

          "Name": "30000"

        },

        {

          "Type": 1,

          "Name": "30001"

        },

        {

          "Type": 2,

          "Name": "30002"

        },

        {

          "Type": 3,

          "Name": "30003"

        }

      ],

      "NodeID": 5

    },

    {

      "HostName": "sdbserver4",

      "dbpath": "/opt/sequoiadb/database/cata/30000",

      "Service": [

        {

          "Type": 0,

          "Name": "30000"

        },

        {

          "Type": 1,

          "Name": "30001"

        },

        {

          "Type": 2,

          "Name": "30002"

        },

        {

          "Type": 3,

          "Name": "30003"

        }

      ],

      "NodeID": 6

    }

  ],

  "GroupID": 1,

  "GroupName": "SYSCatalogGroup",

  "PrimaryNode": 1,

  "Role": 2,

  "Status": 1,

  "Version": 8,

  "_id": {

    "$oid": "526e1ae519b8314ddc83b1f4"

  }

}

{

  "Group": [

    {

      "HostName": "sdbserver1",

      "dbpath": "/opt/sequoiadb/database/data/51000",

      "Service": [

        {

          "Type": 0,

          "Name": "51000"

        },

        {

          "Type": 1,

          "Name": "51001"

        },

        {

          "Type": 2,

          "Name": "51002"

        }

      ],

      "NodeID": 1000

    },

    {

      "HostName": "sdbserver2",

      "dbpath": "/opt/sequoiadb/database/data/51000",

      "Service": [

        {

          "Type": 0,

          "Name": "51000"

        },

        {

          "Type": 1,

          "Name": "51001"

        },

        {

          "Type": 2,

          "Name": "51002"

        }

      ],

      "NodeID": 1001

    },

    {

      "HostName": "sdbserver3",

      "dbpath": "/opt/sequoiadb/database/data/51000",

      "Service": [

        {

          "Type": 0,

          "Name": "51000"

        },

        {

          "Type": 1,

          "Name": "51001"

        },

        {

          "Type": 2,

          "Name": "51002"

        }

      ],

      "NodeID": 1002

    },

    {

      "HostName": "sdbserver4",

      "dbpath": "/opt/sequoiadb/database/data/51000",

      "Service": [

        {

          "Type": 0,

          "Name": "51000"

        },

        {

          "Type": 1,

          "Name": "51001"

        },

        {

          "Type": 2,

          "Name": "51002"

        }

      ],

      "NodeID": 1003

    }

  ],

  "GroupID": 1000,

  "GroupName": "datagroup1",

  "PrimaryNode": 1002,

  "Role": 0,

  "Status": 1,

  "Version": 5,

  "_id": {

    "$oid": "526e1d4519b8314ddc83b1f5"

  }

}

Return 2 row(s).

Takes 0.3383s.

 

從上面Sequoiadb Shell命令列結果中,檢查分割槽組配置情況,可以看到資料組新增了一個資料節點。

在監控頁面中,我們更加清晰的看到物理裝置中新增了一臺sdbserver4的主機。



上面為新增加的節點資訊。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10701850/viewspace-1061118/,如需轉載,請註明出處,否則將追究法律責任。

相關文章