Service Resource Management¶
To manage service resources you can use a set of scripts provided with NetEye. These scripts are wrappers of the PCS and DRBD APIs.
Adding a Service Resource to a Cluster¶
Service resources can be added by modifying an existing template,
located under the /usr/share/neteye/cluster/templates/
directory, then copying it to a suitable location, and finally using
it in a script.
For example, consider the Services-core-nats-server.conf.tpl
template.
{
"volume_group": "vg00",
"ip_pre" : "192.168.1",
"Services": [
{
"name": "nats-server",
"ip_post": "48",
"drbd_minor": 23,
"drbd_port": 7810,
"folder": "/neteye/shared/nats-server/",
"collocation_resource": "cluster_ip",
"size": "1024"
}
]
}
Copy it, then edit it:
# cd /usr/share/neteye/cluster/templates/
# cp Services-core-nats-server.conf.tpl /tmp/Services-core-nats-server.conf
# vi /tmp/Services-core-nats-server.conf
Hint
You can copy the edited file to any other location, to be used for reference or in case you need to change settings at any point in the future.
In the file, make sure to change the following values to match your infrastructure network:
ip_pre: the corporate network address of the node (i.e., the first three octets).
ip_post: the IP address of the node (only the last octet)
Once done, make sure that the JSON file you saved is valid syntactically, for example by using the jq utility:
# jq . /tmp/Services-core-nats-server.conf
A valid file will be displayed on, but if there is some syntactic mistake in the file, an explanatory message will provide a hint to fix the problem. Some possible message is shown next.
parse error: Expected separator between values at line 7, column 21
parse error: Objects must consist of key:value pairs at line 12, column 10
Note
Only one error message is shown at a time, so always run
jq
until you see the content of the file.
Finally, let the cluster pick up the changes and configuration.
# cd /usr/share/neteye/scripts/cluster
# ./cluster_service_setup.pl -c /tmp/Services-core-nats-server.conf