cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1555
Views
0
Helpful
5
Replies

Setup HA in NSO nodes using RESTCONF

suvdeshm
Cisco Employee
Cisco Employee

How can we setup HA amongst NSO nodes via a curl command? We are using NSO 5.1

5 Replies 5

lmanor
Cisco Employee
Cisco Employee

So, need a little more information before we can help here:

 

Are you asking:

How to configure the tailf-hcc HA package from RESTCONF command(s)?

or 

How to control activate/deactivate tailf-hcc HA on the node via RESTCONF

or

You are not using tailf-hcc package at all and want to control NSO HA via the HA API via RESTCONF directly using an HA Framework that you are providing?

 

 

 

We are using tailf-hcc package. In our case, CLI will be turned off so want to know:-

 

How to configure the tailf-hcc HA package from RESTCONF command(s)? 

and/or

How to control activate/deactivate tailf-hcc HA on the node via RESTCONF

For Example these commands:-

In config mode:
ha token test
ha member XYZ address someipaddress1 default-ha-role master
ha member ABC address someipaddress2 default-ha-role slave failover-master true

Right,  you'd configure HA just like configuring any other NSO configuration in CDB... point your URI to config and provide the config data, in-line or in a data file:

 

$ curl -X POST -u admin:admin -T ha-cfg.json -H "Content-type:application/yang-data+json" http://127.0.0.1:8080/restconf/data

 

save your ha config data from CDB in json format to ha-cfg.json (need to remove the 'data' container from the resulting file)

 

To activate HA, it's an action so invoke from RESTCONF like other actions, point your URI at the action you want to invoke:

 

$ curl -X POST -u admin:admin -H "Content-type:application/yang-data+json" http://127.0.0.1:8080/restconf/operations/ha/commands/activate
{
"tailf-hcc:output": {
"status": "activated"
}
}

 

HA Status:

$ curl -X GET -u admin:admin -H "Content-type:application/yang-data+json" http://127.0.0.1:8080/restconf/data/ncs-state/ha
 
  <mode>master</mode>
  <node-id>CentOS64-1</node-id>
</ha>

 

<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">

  <error>

    <error-tag>access-denied</error-tag>

    <error-type>protocol</error-type>

  </error>

</errors>

This is what I get although I have restconf enabled and tcp port 8080 is enabled in ncs.conf.

That appears to be a quite different problem than how to config HA.

 

Seem's you'd have an access problem from any RESTCONF command toward NSO...

 

A few questions:

Did you restart NSO after setting changes in ncs.conf?

Are you attempting RESTCONF commands from the same server that NSO is running on?

If not, try the curl commands locally... any different results?

If from remote, does the NSO server have a firewall enabled, that may be rejecting the call?

Try using telnet to determine if the port is accessible from the remote node - should connect to NSO

$ telnet 192.168.56.101 8080

Trying 192.168.56.101...

Connected to 192.168.56.101.

Escape character is '^]'.

 

^]

telnet> quit

Connection closed.