Install GoldenGate Microservices 21c in silent mode
In some environments we don’t have the option to use Graphical User Interface (GUI) and for that reason all programs have to be installed using command line. In this case we need to install GoldenGate Microservices 21c.
Downloading GoldenGate Software
The GoldenGate software can be downloaded from https://edelivery.oracle.com or download the latest version of GoldenGate 21.9 from oracle support page. Search for patch 34958369 that contains the complete install:
Preparing environment to install GoldenGate
I’m using a compute instance on Oracle Cloud Infrastructure (OCI) with Oracle Linux 8. All databases source and target servers should be resolvable from GoldenGate server.
Installing Java
sudo yum install java
Set JAVA_HOME:
export JAVA_HOME=/usr/java/jdk-11.0.10
Let’s start by creating all folders and open all GoldenGate ports that we need:
mkdir -p /u01/stage/oggsc
sudo chown opc:opc -R /u01/
sudo mkdir -p /u02/deployments/ServiceManager
sudo mkdir -p /u02/deployments/ogg21c
sudo chown -R opc:opc /u02
sudo firewall-cmd --permanent --add-port=9000/tcp
sudo firewall-cmd --permanent --add-port=9001/tcp
sudo firewall-cmd --permanent --add-port=9002/tcp
sudo firewall-cmd --permanent --add-port=9003/tcp
sudo firewall-cmd --permanent --add-port=9004/tcp
sudo firewall-cmd --permanent --add-port=9005/udp
sudo firewall-cmd --reload
sudo firewall-cmd --list-ports
Upload into home directory (in my case /home/opc) the GoldenGate software, and both response files. I put available the response file in my Github repository.
The oggcore.rsp installs GoldenGate software and ResponseFile_Deployment.rsp creates GoldenGate deployment, please copy the file and adapt for your own installation.
Some changes that should be done on ResponseFile_Deployment:
- OGG_SCHEMA should be set with GoldenGate database username.
- SERVER_WALLET should be set with the folder hostname.
Creating certificates for secure deployment
Since we are going to create a secure deployment, we have to create the certificates. In case you have already your own certificates, you can skip this step.
#Create a Self-Signed Trusted (Root) Certificate
./orapki wallet create -wallet ~/wallet_ogg/root_ca -auto_login -pwd welcome123
./orapki wallet add -wallet ~/wallet_ogg/root_ca -dn "CN=RootCA" -addext_basic_cons -pathlen 10 -keysize 2048 -self_signed -validity 7300 -pwd welcome123 -sign_alg sha256
./orapki wallet export -wallet ~/wallet_ogg/root_ca -dn "CN=RootCA" -cert ~/wallet_ogg/rootCA_Cert.pem -pwd welcome123
#Create Server Certificates
./orapki wallet create -wallet ~/wallet_ogg/$(hostname) -auto_login -pwd welcome123
./orapki wallet add -wallet ~/wallet_ogg/$(hostname) -dn "CN=$(hostname)" -keysize 2048 -pwd welcome123
./orapki wallet export -wallet ~/wallet_ogg/$(hostname) -dn "CN=$(hostname)" -request ~/wallet_ogg/servername_req.pem -pwd welcome123
./orapki cert create -wallet ~/wallet_ogg/root_ca -request ~/wallet_ogg/servername_req.pem -cert ~/wallet_ogg/servername_Cert.pem -serial_num 20 -validity 375 -sign_alg sha256
./orapki wallet add -wallet ~/wallet_ogg/$(hostname) -trusted_cert -cert ~/wallet_ogg/rootCA_Cert.pem -pwd welcome123
./orapki wallet add -wallet ~/wallet_ogg/$(hostname) -user_cert -cert ~/wallet_ogg/servername_Cert.pem -pwd welcome123
#Create a Client Certificate
./orapki wallet create -wallet ~/wallet_ogg/dist_client -auto_login -pwd welcome123
./orapki wallet add -wallet ~/wallet_ogg/dist_client -dn "CN=dist_client" -keysize 2048 -pwd welcome123
./orapki wallet export -wallet ~/wallet_ogg/dist_client -dn "CN=dist_client" -request ~/wallet_ogg/dist_client_req.pem -pwd welcome123
./orapki cert create -wallet ~/wallet_ogg/root_ca -request ~/wallet_ogg/dist_client_req.pem -cert ~/wallet_ogg/dist_client_Cert.pem -serial_num 30 -validity 375 -pwd welcome123
./orapki wallet add -wallet ~/wallet_ogg/dist_client -trusted_cert -cert ~/wallet_ogg/rootCA_Cert.pem -pwd welcome123
./orapki wallet add -wallet ~/wallet_ogg/dist_client -user_cert -cert ~/wallet_ogg/dist_client_Cert.pem -pwd welcome123
Installing GoldenGate
Unzip GoldenGate software:
unzip p34958369_219000OGGRU_Linux-x86-64.zip
cp oggcore.rsp /home/opc/fbo_ggs_Linux_x64_Oracle_services_shiphome/Disk1/oggcore.rsp
cd fbo_ggs_Linux_x64_Oracle_services_shiphome/Disk1
./runInstaller -silent -nowait -responseFile /home/opc/fbo_ggs_Linux_x64_Oracle_services_shiphome/Disk1/response/oggcore.rsp
In case you find this error:
The java.library.path system variable is missing or invalid
Install this library:
sudo yum install libnsl.x86_64
And run again the above command to install Goldengate.
Creating Deployment
cd /u01/stage/oggsc/bin
./oggca.sh -silent -responseFile /home/opc/ogg21c.rsp
[opc@gg-silent-installation bin]$ ./oggca.sh -silent -responseFile /home/opc/ogg21c.rsp
The output:
As part of the process of registering Service Manager as a system daemon, the following steps will be performed:
1- The deployment will be stopped before registering the Service Manager as a daemon.
2- A new popup window will show the details of the script used to register the Service Manager as a daemon.
3- After the register script is executed, the Service Manager daemon will be started in the background and the deployment will be automatically restarted.
Click "OK" to continue.
In order to register Service Manager as a system service/daemon, as a "root" user, execute the following script:
(1). /u02/deployments/ServiceManager/bin/registerServiceManager.sh
To execute the configuration scripts:
1.Open a terminal window
2.Login as "root"
3.Run the script
Successfully Setup Software.
####
Don't forget to run the command "sudo /u02/deployments/ServiceManager/bin/registerServiceManager.sh "
####
[opc@gg-silent-installation bin]$ sudo /u02/deployments/ServiceManager/bin/registerServiceManager.sh
Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
----------------------------------------------------
Oracle GoldenGate Install As Service Script
----------------------------------------------------
OGG_HOME=/u01/stage/oggsc
OGG_CONF_HOME=/u02/deployments/ServiceManager/etc/conf
OGG_VAR_HOME=/u02/deployments/ServiceManager/var
OGG_USER=opc
Running OracleGoldenGateInstall.sh...
Created symlink /etc/systemd/system/multi-user.target.wants/OracleGoldenGate.service → /etc/systemd/system/OracleGoldenGate.service.
[opc@gg-silent-installation bin]$
Installing Nginx
Now, we need to install Nginx:
sudo yum -y install nginx
cd $OGG_HOME/lib/utl/reverseproxy
./ReverseProxySettings -u <username> -P <password> -o ogg.conf https://localhost:9000
sudo mv ogg.conf /etc/nginx/conf.d/nginx.conf
sudo chown opc:opc /etc/nginx/conf.d/nginx.conf
sudo sh /usr/bin/make-dummy-cert /etc/nginx/ogg.pem
#Validate Nginx
sudo nginx -t
#Reload Nginx
sudo nginx -s reload
On Oracle Linux 8 I have to enable this parameter to have reverse proxy working:
sudo setsebool -P httpd_can_network_connect 1
Now, access to your GoldenGate Microservices:
https://<IP or hostname>
I hope this helps. If you have any doubt, please reach out to me through LinkedIn or Medium.