Skip to content

nirs/visitor

Repository files navigation

visitor

Helper for demonstrating disaster recovery flows.

The visitor listens to port 8000, reporting the number of visitors and the address of the host.

Example output:

Screenshot

Using during failover or relocate

  1. Wait until the next replication completes
  2. Visit http://host-address-on-cluster1:service-port
  3. Wait until the next replication completes
  4. Start failover or relocate
  5. Wait until the virtual machine is running on the other cluster
  6. Visit http://host-address-on-cluster2:service-port

Check the visitor count and server address. The last visit will be reported on original cluster address.

The visitor.json file

The visitor stores the last visit info at visitor.json in the directory where the server is started.

When running as a Linux service, the visitor.json file is located in /var/lib/visitor.

To clear the visitor state, delete the file.

Cluster config

To report the actual cluster name, create the file /mnt/config/cluster. The content of the file will be used as the cluster name in the visitor page.

Installing on Linux

Install the rpm package:

sudo dnf install visitor-0.3.0-1.x86_64.rpm

Enable and start the service:

sudo systemctl enable visitor --now

To allow remote access open port 8000. Example for firewalld:

sudo firewall-cmd --add-port=8000/tcp --permanent
sudo firewall-cmd --reload

Installing on Windows

Configure Windows firewall

To allow remote access:

  1. Open the Firewall and network security system setting
  2. Click "Allow an app through firewall"
  3. Click "Allow another app..."
  4. Click "Browse..." and find visitor.exe
  5. Click "Network types..." and enable both public and private networks
  6. Click "Add"

Using as Windows service

Create a service:

sc.exe create visitor start= auto binPath= "C:\Users\Administrator\Visitor\visitor.exe"

Start the service:

sc.exe start visitor

When running as a service, the visitor.json file is stored in the directory where the executable is installed.

Stop the service:

sc.exe stop visitor

Delete the service:

sc.exe delete visitor

License

visitor is under the Apache 2.0 license

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published