ITPub博客

首页 > 数据库 > NoSQL > SequoiaDB数据库之集群管理

SequoiaDB数据库之集群管理

原创 NoSQL 作者:buptdream 时间:2013-11-26 14:00:17 0 删除 编辑

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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-12-04

  • 博文量
    25
  • 访问量
    335700