If you want to change only the DNS name or if you want to change both the IP address and DNS name of the Primary Server after installing ZENworks, and if the certificate’s CN has fully qualified DNS configured, use the following steps to change only the DNS name or to change both the IP address and DNS name of the Primary Server.
The following two scenarios are supported:
Take a reliable backup of the following on all the Primary Servers in the Management Zone:
Content-Repo Directory: The content-repo directory is located by default in the %ZENSERVER_HOME%\work\ directory on Windows and in the /var/opt/microfocus/zenworks/on Linux.
Ensure that the images directory located within the content-repo directory has been successfully backed up.
Certificate Authority: For detailed information on how to back up the certificate authority, see Section 1.3, Backing Up the Certificate Authority.
Embedded Database: For detailed information on how to back up the embedded database, see the ZENworks Database Management Reference.
ZENworks Server: For detailed information on how to back up the ZENworks Server, see Section 1.0, Backing Up and Restoring the ZENworks Server and Certificate Authority.
Change the DNS name or the DNS name and IP address.
If the database is located on the Primary Server whose IP address you changed in Step 2.
Change the database server address on all the second Primary Servers. On all the second Primary Servers, change the value of database server address in the %ZENSERVER_HOME%\conf\datamodel\zdm.xml to point to the new IP address of the first Primary Server.
Change the audit database server address on all the second Primary Servers. On all the second Primary Servers, change the value of audit database server address in the %ZENSERVER_HOME%\conf\datamodel\zenaudit.xml to point to the new IP address of the first Primary Server.
Run the microfocus-zenworks-configure -c GenerateOSPProperties configure action.
(Conditional) If ZooKeeper or Kafka is configured
Update database with new DNS. For more information, see SQL Query for Updating DNS in the Database.
Update ZooKeeper or/and Kafka properties files with new DNS using shell script or bat file on Primary Servers. For more information on running script, see Creating the Replace DNS Script.
NOTE:To know if ZooKeeper, Kafka or Vertica is configured, run the following query:
select d.zuid, d.hostname, r.roles from zzenserverroles r, zdevice d where r.id = d.zuid and r.roles in ('ZooKeeper', 'Kafka', 'Vertica')
(Conditional) If Vertica is configured, update zenvertica.xml with new DNS using shell script or bat file on all primary servers.
(Conditional) On a Linux Primary Server, you need to remove the Docker container for the modified hostname to take effect. To remove the container:
Stop all ZENworks services.
Remove the docker containers using the command docker container prune -f.
Restart all ZENworks services.
Remint the server certificate. For information, see Reminting Server Certificates
in the ZENworks SSL Management Reference.
(Conditional) If Multizone is configured with this server (whose IP address and DNS name is changed) as Publisher, then after replacing the First Primary Server with the Second Primary Server, update the new IP address and DNS name of this server for all its Subscribers. Perform the following to update the new IP address and DNS name:
Log in to ZENworks Control Center (ZCC) of subscribers.
Navigate to Subscribe And Share > Subscriptions > <subscription_name> > Remote Server > Base URL>Edit.
Update the IP address or Hostname with new IP address or Hostname of the Primary Server (Publisher).
To update the new certificate:
Navigate to Subscribe And Share > Subscriptions > <subscription_name> > Remote Server > Update Certificate.
Update the certificate.
If you want to change only the DNS name or if you want to change both the IP address and the DNS name of the Primary Server after installing ZENworks 2020, and if the certificates CN has fully qualified DNS configured, perform the following steps to change only the DNS name or to change both the IP address and the DNS name of the Primary Server.
Take a reliable backup of the following on all the Primary Servers in the Management Zone:
Content-Repo Directory: The content-repo directory is located by default in the %ZENSERVER_HOME%\work\ directory on Windows and in the /var/opt/microfocus/zenworks/ on Linux.
Ensure that the images directory located within the content-repo directory has been successfully backed up.
Certificate Authority: For detailed information on how to backup certificate authority, see Section 1.3, Backing Up the Certificate Authority.
Embedded Database: For detailed information on how to back up the embedded database, see the ZENworks Database Management Reference.
ZENworks Server: For detailed information on how to back up the ZENworks Server, see Section 1.0, Backing Up and Restoring the ZENworks Server and Certificate Authority.
Change the DNS name or the DNS name and IP address.
If the database is located on the Primary Server whose IP address you changed.
Change the database server address on all the second Primary Servers. On all the second Primary Servers, change the value of database server address in the %ZENSERVER_HOME%\conf\datamodel\zdm.xml to point to the new IP address of the first Primary Server.
Change the audit database server address on all the second Primary Servers. On all the second Primary Servers, change the value of audit database server address in the %ZENSERVER_HOME%\conf\datamodel\zenaudit.xml to point to the new IP address of the first Primary Server.
Run the microfocus-zenworks-configure -c GenerateOSPProperties configure action.
(Conditional) If ZooKeeper or kafka is configured
Update database with new DNS. For more information, see SQL Query for Updating DNS in the Database.
Update ZooKeeper or/and Kafka properties files with new DNS using shell script or bat file on Primary Servers. For more information, see Creating the Replace DNS Script.
NOTE:To know if ZooKeeper, Kafka or Vertica is configured, run the following query:
select d.zuid, d.hostname, r.roles from zzenserverroles r, zdevice d where r.id = d.zuid and r.roles in ('ZooKeeper', 'Kafka', 'Vertica')
(Conditional) On a Linux Primary Server, you need to remove the Docker container for the modified hostname to take effect. To remove the container:
Stop all ZENworks services.
Remove the docker containers using the command docker container prune -f.
Restart all ZENworks services.
(Conditional) If Vertica is configured, update zenvertica.xml with new DNS using shell script or bat file on all Primary Servers.
Remint the server certificate. For information, see Reminting Server Certificates
in the ZENworks SSL Management Reference.
(Conditional) If your zone includes Intel AMT devices, unprovision and provision the devices.
For more information about unprovisioning and provisioning Intel AMT devices, see Introducing Intel Active Management Technology
in the ZENworks Out-of-Band Management Reference.
(Conditional) If Multizone is configured with this server (whose IP address and DNS name is changed) as Publisher, then after replacing the First Primary Server with the Second Primary Server, update the new IP address and DNS name of this server for all its Subscribers. Perform the following to update the new IP address and DNS name:
Log in to ZENworks Control Center (ZCC) of subscribers.
Navigate to Subscribe And Share > Subscriptions > <subscription_name> > Remote Server > Base URL>Edit.
Update the IP address or Hostname with new IP address or Hostname of the Primary Server (Publisher).
To update the new certificate:
Navigate to Subscribe And Share > Subscriptions > <subscription_name> > Remote Server > Update Certificate.
Update the certificate.
The following script replaces the old DNS with the new DNS. Ensure that you update the parameters accordingly and then run the script file.
Create a .bat file and add the following content.
@echo off set "oldDNS=PutOldDnsHere" set "newDNS=PutNewDnsHere" setlocal EnableExtensions EnableDelayedExpansion set "SOURCEFILE=%ZENSERVER_HOME%\conf\zookeeper.properties" set "TEMPFILE=test_out.txt" for /f "delims=" %%A in ('type "%SOURCEFILE%"') do ( set "string=%%A" set "modified=!string:%oldDNS%=%newDNS%!" echo !modified!>>"%TEMPFILE%" ) del "%SOURCEFILE%" move "%TEMPFILE%" "%SOURCEFILE%" endlocal
After creating the script file, update the PutOldDnsHere and PutNewDnsHere, and then execute the bat file.
Create a .sh file and then add the following content.
#!/bin/bash oldDns=PutOldDnsHere; newDns=PutNewDnsHere; echo $oldDns echo $newDns #zookeeper.properties file=/etc/opt/microfocus/zenworks/zookeeper.properties if test -f $file; then sed -i "s/$oldDns/$newDns/" $file fi # kafka-service-config.properties file=/etc/opt/microfocus/zenworks/kafka-service-config.properties if test -f $file; then sed -i "s/$oldDns/$newDns/" $file fi #kafka.properties file=/etc/opt/microfocus/zenworks/kafka/zenworks-kafka-server.properties if test -f $file; then sed -i "s/$oldDns/$newDns/" $file fi # schema-registry.properties file=/etc/opt/microfocus/zenworks/kafka/zenworks-schema-registry.properties if test -f $file; then sed -i "s/$oldDns/$newDns/" $file fi # kafka-connect.properties file=/etc/opt/microfocus/zenworks/kafka/zenworks-connect-avro-distributed.properties if test -f $file; then sed -i "s/$oldDns/$newDns/" $file fi # vertica-datamodel file=/etc/opt/microfocus/zenworks/datamodel/zenvertica.xml if test -f $file; then sed -i "s/$oldDns/$newDns/" $file fi
After creating the script file, update the PutOldDnsHere and PutNewDnsHere, and then execute the script file.
Depending on the database configured in the zone, ensure that you run the following SQL query to update the DNS in the database.
CREATE OR REPLACE FUNCTION replaceDNS(guid character varying,oldDns character varying, newDns character varying ) RETURNS void AS $$ DECLARE actualValue varchar(1024); updatedValue varchar(1024); guidAsBytea bytea; BEGIN select decode(guid, 'hex') into guidAsBytea; raise notice '%', guidAsBytea; select data into actualValue from zzenserverroles where id=guidAsBytea and roles = 'ZooKeeper'; raise notice '%', actualValue; updatedValue := REPLACE(actualValue, oldDns, newDns ); raise notice '%', updatedValue; update zzenserverroles set data=updatedValue where id=guidAsBytea and roles = 'ZooKeeper'; -- update zopaquedata for kafka cluster IF EXISTS (select 1 from zopaquedata where name = 'kafka.cluster.config') THEN select data into actualValue from zopaquedata where name = 'kafka.cluster.config'; raise notice '%', actualValue; updatedValue := REPLACE(actualValue, oldDns, newDns ); raise notice '%', updatedValue; update zopaquedata set data=updatedValue where name = 'kafka.cluster.config'; END IF; END; $$ LANGUAGE plpgsql; -- language specification
Execute function/procedures in the database, for postgresql to run the following function: select replaceDNS(server_guid, oldDns ,newDns);
Example:
select replaceDNS('c79de1490818e00f55c82cd6b28e157c', 'oldDns.novell.com','newDns.microfocus.com');
CREATE PROCEDURE replaceDNS @guid nvarchar(100),@oldDns nvarchar(1024), @newDns nvarchar(1024) AS BEGIN declare @actualValue nvarchar(1024), @updatedValue nvarchar(1024); select @actualValue=data from zzenserverroles where id=@guid and roles = 'ZooKeeper'; print 'Actual value: ' + @actualValue; set @updatedValue = REPLACE(@actualValue, @oldDns, @newDns ); print 'update value: ' + @updatedValue; update zzenserverroles set data=@updatedValue where id=@guid and roles = 'ZooKeeper'; -- update zopaquedata for kafka cluster IF EXISTS (select 1 from zopaquedata where name = 'kafka.cluster.config') BEGIN select @actualValue=data from zopaquedata where name = 'kafka.cluster.config'; print 'Actual value: ' + @actualValue; set @updatedValue = REPLACE(@actualValue, @oldDns, @newDns ); print 'update value: ' + @updatedValue; update zopaquedata set data=@updatedValue where name = 'kafka.cluster.config'; END END;
Execute function/procedures in the database, for MS SQL to run the following function: exec replaceDNS guid, oldDns, newDns
Example:
exec replaceDNS 0xc79de1490818e00f55c82cd6b28e157c, 'oldDns.novell.com','newDns.microfocus.com';
CREATE OR REPLACE PROCEDURE replaceDNS(guid in varchar2,oldDns in varchar2, newDns in varchar2 ) as actualValue varchar2(1024); updatedValue varchar2(1024); BEGIN select data into actualValue from zzenserverroles where id=guid and roles = 'ZooKeeper'; dbms_output.put_line('Actual value: ' || actualValue); updatedValue := REPLACE(actualValue, oldDns, newDns ); dbms_output.put_line('update value: ' || updatedValue); update zzenserverroles set data=updatedValue where id=guid and roles = 'ZooKeeper'; -- update zopaquedata for kafka cluster BEGIN select data into actualValue from zopaquedata where name = 'kafka.cluster.config'; dbms_output.put_line('Actual value: ' || actualValue); updatedValue := REPLACE(actualValue, oldDns, newDns ); dbms_output.put_line('update value: ' || updatedValue); update zopaquedata set data=updatedValue where name = 'kafka.cluster.config'; EXCEPTION WHEN NO_DATA_FOUND THEN NULL; END; END;
Execute function/procedures in the database, for Oracle to run the following function: select replaceDNS (guid, oldDns, newDns)
Example:
select replaceDNS('C79DE1490818E00F55C82CD6B28E157C', 'oldDns.novell.com' ,'newDns.microfocus.com');