...
| Code Block | ||||
|---|---|---|---|---|
| ||||
sudo /usr/local/omk/bin/ophad cmd consumer failover <Poller Cluster ID> |
If the target_dir is not /usr/local/omk but different, say /data/omk please suffix the command with the cli option --opha-cli-path /data/omk/bin/opha-cli.pl
| Code Block | ||||
|---|---|---|---|---|
| ||||
cd /usr/local/omk/bin
sudo /data/omk/bin/ophad cmd consumer failback --opha-cli-path /data/omk/bin/opha-cli.pl <Poller Cluster ID> |
Scenario 3 : Deleting the nats streams (Main Primary)
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
sudo systemctl restart ophad omkd opeventsd opchartsd |
Scenario 4 : Clearing datastorage of the nats streams (Main Primary)
All vms: (Main Pri, Sec Pri, Pollers, Mirrors)
Code Block sudo systemctl stop ophadMain Primary: Delete all streams
Code Block nats stream delete --user omkadmin --password op42opha42If jq is installed on Main Primary, this below snippet can be used to automate deletion of all nats streams:
Code Block for stream_name in $(nats stream list --user omkadmin --password op42opha42 --json | jq -r '.[]'); do nats stream rm --force --user omkadmin --password op42opha42 "$stream_name"; doneVerify to check if all streams have been deleted
Code Block nats stream info --user omkadmin --password op42opha42 nats: error: could not pick a Stream to operate on: no Streams are definedStop the nats-server on Main Primary, Sec Primary and the Arbiter Poller
Code Block sudo systemctl stop nats-serverDelete the storage directory
Code Block root@opha-dev7:/home/shankarn# cd /opt/nats/storage/ root@opha-dev7:/opt/nats/storage# ls -lrt total 4 drwx------ 4 root root 4096 Nov 26 11:51 jetstream root@opha-dev7:/opt/nats/storage# rm -rf jetstream/Start the nats-server on Main Primary, Sec Primary and the Arbiter Poller
Code Block sudo systemctl start nats-serverAll vms (Main Pri, Sec Pri, Pollers, Mirrors) - Restart the services for the changes made to opCommon.json to get reflected.
| Code Block | ||||
|---|---|---|---|---|
| ||||
sudo systemctl restart ophad omkd opeventsd opchartsd |
...