If your LogServer is co-hosted with a Controller, moving it to a dedicated appliance is recommended. You can migrate the LogServer away from the Controller and bring the existing audit logs with it.
Appliances queue logs when they cannot reach the LogServer, but only when a LogServer is configured. Minimize the time window during which no LogServer is configured to avoid losing logs.
You will need browser access to the admin UI and terminal access to both appliances.
Sign in to the admin UI as an administrator.
Go to Appliances and create a new appliance (Appliance B), which will become the new LogServer.
Go to Appliances, select the appliance that is currently acting as the LogServer (Appliance A), uncheck the LogServer function, and Save.
SSH to Appliance A:
ssh cz@applianceA.address.Switch to root:
sudo suGo to the OpenSearch directory:
cd /mnt/data/elasticsearch5Compress the OpenSearch data directory:
tar zcvf es_data.tar.gz data/Copy the compressed data file to Appliance B:
scp es_data.tar.gz cz@applianceB.address:
SSH to Appliance B:
ssh cz@applianceB.addressSwitch to root:
sudo suMove the compressed file to the OpenSearch directory:
mv es_data.tar.gz /mnt/data/elasticsearch5Go to the OpenSearch directory and extract the file:
cd /mnt/data/elasticsearch5; tar zxvf es_data.tar.gzSet the correct permissions:
chown -R czd:czd *
In the admin UI, go to Appliances, select Appliance B, select the LogServer function, and Save.
Migrating from LogServer to LogForwarder
If you use the LogServer and want to migrate to an enterprise log management system, use the LogForwarder.
LogForwarders support high availability (HA) operation using two or more appliances and can export logs by Site to different destinations. You can configure multiple export protocols simultaneously, including one for the ELK stack. If your enterprise environment requires the ELK stack, deploy it outside the AppGate ZTNA Collective and forward logs there while also exporting log data to an enterprise-class logging system.
You can migrate from the LogServer to the LogForwarder without losing audit logs already accumulated on the LogServer.
Disable the LogServer function and enable the LogForwarder function on the LogServer appliance. The appliance becomes a LogForwarder.
SSH to the LogForwarder and run the following command to generate the OpenSearch configuration:
sudo cz-config set -j runOpensearch true
Wait for OpenSearch to reach
greenstatus. This cmay take some time depending on the size of the database. To check the status, run:
es-tools -c cluster-health
When OpenSearch is ready, the output looks like the following:
{
"cluster_name": "appgate",
"status": "green",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"active_primary_shards": 6,
"active_shards": 6,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 100
}Use
es-exportto export all log indexes from OpenSearch and forward them tocz-logdas if they were from any other appliance. Run the following command:
es-export --forward_logd true
The output confirms each index as it completes:
Current index: logstash-2021-02-23 Done
Stop OpenSearch and remove the temporary OpenSearch configuration from the LogForwarder:
sudo cz-config set -j runOpensearch false
Optionally, remove the OpenSearch database:
sudo rm -rf /mnt/data/elasticsearch5/data/