Menu Search

Appendix H. BDB HA initial configuration

The section Section 5.1, “Introduction” provides an introduction into Broker-J initial configuration and how broker configuration can be created from initial configuration on first broker start-up. This appendix illustrates how to create a BDB HA group from an initial configuration file. For creation of BDB HA group using Web Management Console please refer Section 6.2, “Web Management Console”.

The BDB HA group usually consists of two or more nodes hosting a distributed virtual host.

When BDB HA node is created the following attributes has to be provided

  • groupName; a name of BDB HA group

  • nodeName; a name of BDB HA node

  • address; a node address as colon-separated pair of host name and port

  • helperAddress; an address of existing helper node. It is required when node joins an existing group.

  • helperNodeName; a name of existing helper node. It is required when node joins an existing group.

  • permittedNodes; an array containing all addresses of nodes allowed to join the group.

A node priority can be optionally specified for the node to influence master election among nodes with the most current set of data. An attribute priority is used to specify a priority as an integer number.

Apart from a group name and permitted nodes, the rest of node attribute values varies from node to node.

In order to use the same initial configuration for creation of BDB HA nodes, the context variable can be used for varying attribute values.

In the example of initial configuration illustrated in this apendix, the following context variables are defined.

  • ${ha.group_name}; used to pass an HA group name

  • ${ha.node_name}; used to pass a node name

  • ${ha.node_address}; used to pass a node address

  • ${ha.helper_address}; used to pass an address of helper node.

  • ${ha.helper_node_name}; used to pass an address of helper node.

  • ${ha.permitted_nodes}; used to pass a stringified json array containing permitted nodes for the group.

  • ${ha.priority}; used to pass a node priority.

H.1. Example of BDB HA 'Initial Configuration'

An example of 'Initial Configuration' for BDB HA:

Example H.1. BDB HA 'Initial configuration'

{
  "name": "${broker.name}",
  "modelVersion" : "9.0",
  "authenticationproviders" : [ {
    "name" : "plain",
    "type" : "Plain",
    "users" : [ {
    "name" : "guest",
    "type" : "managed",
    "password" : "guest"
  } ]
  } ],
  "brokerloggers" : [ {
    "name" : "logfile",
    "type" : "File",
    "fileName" : "${qpid.work_dir}${file.separator}log${file.separator}qpid.log",
    "brokerloginclusionrules" : [ {
      "name" : "Root",
      "type" : "NameAndLevel",
      "level" : "WARN",
      "loggerName" : "ROOT"
    }, {
      "name" : "Qpid",
      "type" : "NameAndLevel",
      "level" : "INFO",
      "loggerName" : "org.apache.qpid.*"
    }, {
      "name" : "Operational",
      "type" : "NameAndLevel",
      "level" : "INFO",
      "loggerName" : "qpid.message.*"
    }, {
      "name" : "Statistics",
      "type" : "NameAndLevel",
      "level" : "INFO",
      "loggerName" : "qpid.statistics.*"
    } ]
  }, {
    "name" : "memory",
    "type" : "Memory",
    "brokerloginclusionrules" : [ {
      "name" : "Root",
      "type" : "NameAndLevel",
      "level" : "WARN",
      "loggerName" : "ROOT"
    }, {
      "name" : "Qpid",
      "type" : "NameAndLevel",
      "level" : "INFO",
      "loggerName" : "org.apache.qpid.*"
    }, {
      "name" : "Operational",
      "type" : "NameAndLevel",
      "level" : "INFO",
      "loggerName" : "qpid.message.*"
    }, {
      "name" : "Statistics",
      "type" : "NameAndLevel",
      "level" : "INFO",
      "loggerName" : "qpid.statistics.*"
    } ]
  } ],
  "ports" : [  {
    "name" : "AMQP",
    "port" : "${qpid.amqp_port}",
    "authenticationProvider" : "plain",
    "virtualhostaliases" : [ {
      "name" : "nameAlias",
      "type" : "nameAlias"
    }, {
      "name" : "defaultAlias",
      "type" : "defaultAlias"
    }, {
      "name" : "hostnameAlias",
      "type" : "hostnameAlias"
    } ]
  }, {
  "name" : "HTTP",
    "port" : "${qpid.http_port}",
    "authenticationProvider" : "plain",
    "protocols" : [ "HTTP" ]
  }],
  "virtualhostnodes" : [ {
    "name" : "${ha.node_name}",
    "type" : "BDB_HA",
    "address" : "${ha.node_address}",
    "groupName" : "${ha.group_name}",
    "helperAddress" : "${ha.helper_address}",
    "helperNodeName" : "${ha.helper_node_name}",
    "permittedNodes" : "${ha.permitted_nodes}",
    "priority" : "${ha.priority}",
    "defaultVirtualHostNode" : "true",
    "virtualHostInitialConfiguration" : "${qpid.initial_config_virtualhost_config}"
  } ],
  "plugins" : [ {
    "type" : "MANAGEMENT-HTTP",
    "name" : "httpManagement"
  } ]
}