In this deployment configuration, WSO2 API-M is set up in an Active-Active configuration within a single node environment. This architecture utilizes two WSO2 API Manager containers, effectively distributing the workload and ensuring redundancy for high availability. These containers work together smoothly and talk to a central MySQL server, which stores all the important data.
Official Documentation.
When changing the hostname, it is necessary to create a new keystore and import it into the client-truststore.jks file to avoid issues.
keytool -genkey -alias apimcert -keyalg RSA -keysize 2048 -keystore apimwso2.jks -validity 730 -dname "CN=api.am.wso2.com, OU=WSO2,O=WSO2,L=SL,S=WS,C=LK" -storepass wso2carbon -keypass wso2carbon
keytool -export -alias apimcert -keystore apimwso2.jks -file apimwso2.pem -storepass wso2carbon
keytool -import -alias apimcert -file apimwso2.pem -keystore client-truststore.jks -storepass wso2carbon
Official Documentation.
sudo openssl genrsa -des3 -out apimssl.key 2048
sudo openssl req -new -key apimssl.key -out apimserver.csr
sudo cp apimssl.key apimssl.key.org
sudo openssl rsa -in apimssl.key.org -out apimssl.key
sudo openssl x509 -req -days 365 -in apimserver.csr -signkey apimssl.key -out apim.crt
Wildcard domains can be used as a common name (CN). For example, CN=*.am.wso2.com
sudo apt install nginx -y
sudo mkdir /etc/nginx/ssl
Add apimssl.key and apim.crt files into the /etc/nginx/ssl directory.
Place the nginx.conf file into the /etc/nginx/conf.d directory.
Create the locations to save access_log and error_log and set correct permissons.
sudo mkdir /etc/nginx/log/am/https
sudo mkdir /etc/nginx/log/gw/https
vim or nano /etc/hosts.
[ip-address] api.am.wso2.com
[ip-address] gw.am.wso2.com
Run nginx service.
sudo systemctl start nginx
sudo systemctl restart nginx
sudo systemctl status nginx
Give execute permisson chmod +x docker-build.sh and run Bash Script.
sh docker-build.sh
Deploy two API-M containers and a MySQL container by using the service.yaml file.
sudo docker-compose -f service.yaml up