Wednesday, August 2, 2023
Friday, June 30, 2023
Oracle Database 23C - Interesting Features
Oracle Database 23C - Interesting Features:
JSON:
JSON-relational duality views combine the advantages of using JSON documents with the advantages of the relational model, while avoiding the limitations of each.
Simple SQL
Interesting features on how SQL is used and made lot of syntax and enhancements with the applications and user support for the database access.
Graph Support
Support for the graph and relationship in oracle database.
Useful link - https://docs.oracle.com/en/database/oracle/oracle-database/23/nfcoa/#Oracle%C2%AE-Database
JSON - https://blogs.oracle.com/database/post/json-relational-duality-app-dev#:~:text=The%20new%20feature%20in%20Oracle,a%20JSON%20Relational%20Duality%20View.&text=Using%20Duality%20Views%2C%20data%20is,JSON%20documents%20(figure%202).
Friday, March 10, 2023
Oracle EBS - How to setup DMZ HTTP Reverse Proxy Server
Oracle EBS - How to setup DMZ HTTP Reverse Proxy Server
1. Install apache on reverse proxy server.
1.1 Download apache source file : http://apr.apache.org/download.cgi
httpd-2.4.34.tar.gz
mkdir -p /opt/app/software
copy all install packages to /opt/app/software
1.2 Download apache dependent files apr & apr-utility :
apr-1.6.3.tar.gz
apr-util-1.6.1.tar.gz
1.3 Download PCRE ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
pcre2-10.31.tar.gz
pcre-8.42.tar.gz
1.4 Before apache install, check C, C++, Libtools, expat-devel and apr-devel compilers.
yum install -y mlocate
updatedb
yum list installed libgcc
yum remove libgcc.i686
yum install -y libgcc.x86_64 gcc-c++.x86_64 gcc.x86_64 compat-gcc-44.x86_64 compat-gcc-44-c++.x86_64
1.5 Download and install openssl which is used by apache
openssl-1.0.2o.tar.gz
Untar file in /opt/app/software
cd openssl-1.0.2o
./config --prefix=/usr/local/openssl -fPIC
make
make install
which openssl -- /bin/openssl
openssl, exit
1.6 Extract and install autoconf
Pre requisite rpms for autoconf : m4.x86_64, perl-ExtUtils-MakeMaker, Data-Dumper-2.161.tar.gz
yum install -y m4.x86_64
yum install -y perl-ExtUtils-MakeMaker
cd /opt/app/software/Data-Dumper-2.161
perl Makefile.PL
make
make install
cd ../autoconf-2.69
./configure --prefix=/usr/local/autoconf
make
make install
which autoconf
1.7 Install libtool
yum install -y libtool.x86_64
1.8 Extract and Install apr, apr-util & pcre.
Untar files in /opt/app/software and rename files by removing version numbers.
tar -xvzf apr-1.6.3.tar.gz
tar -xvzf apr-util-1.6.1.tar.gz
tar -xvzf pcre-8.42.tar.gz
mv apr-1.6.3 apr
mv apr-util-1.6.1 apr-util
mv pcre-8.42 pcre
cd ./apr
./configure
make clean
make
make install
cd ../apr-util
yum install -y imlib.x86_64
yum install -y expat-devel.x86_64 expat.x86_64
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make clean
make
make install
cd ../pcre
./configure --prefix=/usr/local/pcre
make clean
make
make install
1.9 Apache Installation
cd /opt/app/software/httpd-2.4.34
./buildconf
./configure --prefix=/opt/app/dmz --with-including-apr --with-pcre=/usr/local/pcre --with-ssl=/usr/local/openssl --enable-so --enable-mods-shared="ssl proxy proxy_http proxy_ftp proxy_connect headers"
make clean
make
make install
For some reason, if you run into issues during cnfiguring/make , run below buildconf to run configure command again otherwise latest changes won't be affective.
./buildconf
2.0 mod_security for apache Installation:
Download and Install modsecurity-2.9.0.tar.gz
Prerequisites:
yum install libtool.x86_64 -- already installed
yum install -y libxml2-devel.x86_64
Untar and Install
mkdir -p /opt/app/dmz/mod_security
cd /opt/app/software
tar -zxvf modsecurity-2.9.0.tar.gz
cd modsecurity-2.9.0
export PATH=/usr/local/openssl:/usr/local/autoconf/bin:/usr/local/libtool/bin:$PATH
./autogen.sh
./configure --prefix=/opt/app/dmz/mod_security --with-apxs=/opt/app/dmz/bin/apxs
make
make install
2.1 Make sure mod_security2.so files generated in apache directory.
cd /opt/app/dmz/modules
ls -lrt mod_security2.so
cd /opt/app/dmz/mod_security
ls -lrt
Start the apache and check.
cd /opt/app/dmz/bin
ps -ef|grep httpd
./apachectl start
ps -ef|grep httpd
./apachectl stop
1.7.6. Enable mod_security module in httpd.conf.
LoadModule security2_module modules/mod_security2.so
1.8. Now start the services and make sure there are no issues.
2. Add proxy pass entries to httpd.conf
Note: Disable below SSL parameters:
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
3. Setup url_fw.conf from external node to proxy ${APACHE_HOME}/conf.
4. Enable only Isupplier related url's in url_fw.conf.
Friday, February 24, 2023
Kubernetes Cheat Sheet
Kubernetes cheat sheet
Listing the below commands which will be useful for administering the kubernetes environment.
Version:
# Get kubernetes version: The Server Version line indicates the version of Kubernetes that is running on the Kubernetes cluster.
kubectl version
Pods:
# Get the details of all pods in one namespace
kubectl get pods -n <namespace>
# Get the details of all pods in all namespaces
kubectl get pods --all-namespaces
# Get the details of all pods in the current namespace, with more details
kubectl get pods -o wide
Deployments:
# Get all the deployments
kubectl get deployments
# Check the history of deployments including the revision
Kubectl rollout history deployment <deployment name>
# Rolling restart of the deployment
Kubectl rollout restart deployment <deployment name>
Interacting with pods:
# Login to pod
Kubectl exec -it <podname> -- bash
#Run the commands in the pod
Kubectl exec <podname> -- ls /
configmap :
# Get all configmap in current namespace
Kubectl get cm
# Edit configmap
Kubectl edit cm <configmap name>
Secrets:
# Display all the secrets
Kubectl get secrets
# Display all the secrets
Kubectl get secrets --all-namespaces
Services:
# Display all the services
Kubectl get svc
# List Services Sorted by Name
kubectl get services --sort-by=.metadata.name
Logs:
# Check the logs of the pod
kubectl logs <podname>
# Tail the logs of the pod
kubectl logs -f <podname>
Copy :
# copy the data from local directory to the pod
kubectl cp $HOME/data <pod>:/opt/app/data
Storage:
# List all PersistentVolumes
kubectl get pv
# List all PersistentVolumes sorted by capacity
kubectl get pv --sort-by=.spec.capacity.storage
# Describe specific persistent volume
kubectl describe pv <pv_name>
# List all persistent volumes claims
kubectl get pvc
# Describe specific persistent volume claim
kubectl describe pvc <pvc_name>
Create/Delete resources:
# Create specific resource
kubectl apply -f <deployment>.yaml
# Create specific resource using URL
kubectl apply -f https://gcs.io/pod
# Describe specific persistent volume claim
kubectl delete -f <deployment>.yaml
Formatting output:
# Append the following to command to get output in json format
-o json
# Append the following to command to get output in yaml format
-o yaml
# Append the following to command to get output in plain text format with additional information for pods.
-o wide
# Print a table using a comma separated list of custom columns
-o=custom-columns=<spec>
Cluster details:
# Display the cluster details
kubectl cluster-info
Below bash alias are more useful:
alias k="kubectl"
alias allpods="kubectl get pods --all-namespaces"
alias kc="kubectl create -f"
alias kg="kubectl get"
alias pods="kubectl get pods"
alias ktop="kubectl top nodes"
alias rcs="kubectl get rc"
alias sv="kubectl get services"
alias dep="kubectl get deployment"
alias kd="kubectl describe"
alias kdp="kubectl describe pod "
alias kds="kubectl describe service "
alias nodes="kubectl get nodes"
alias klogs="kubectl logs"
alias ns="kubectl get ns"
alias deploys="kubectl get deployment"
alias events="kubectl get events"
alias kexec="kubectl exec -it "
alias sec="kubectl get secrets"
Tuesday, January 31, 2023
OCI Cloud - Top 10 things to consider when deploying applications.
Deploying applications on Oracle Cloud Infrastructure (OCI) involves several best practices to ensure efficiency, scalability, security, and reliability. Here are some key practices for OCI cloud deployments:
1. Well-Architected Framework:
Reliability, Performance, Security: Follow OCI's well-architected framework principles to design and implement your solutions for reliability, performance, and security.
2. Resource Planning and Optimization:
Right Sizing: Properly size compute, storage, and networking resources to meet application demands while avoiding unnecessary costs.
Utilize Autoscaling: Configure auto-scaling policies to dynamically adjust resources based on traffic patterns.
Cost Management: Leverage Oracle's tools for cost management and monitoring to optimize expenses.
3. Security Best Practices:
Identity and Access Management (IAM): Implement least privilege access control, utilize IAM policies, and regularly review permissions.
Network Security: Use Virtual Cloud Networks (VCNs), security lists, and security groups to control network traffic.
Data Encryption: Encrypt data at rest and in transit using encryption services provided by OCI.
4. High Availability and Fault Tolerance:
Multi-Availability Domains (ADs) and Regions: Deploy across multiple availability domains and regions to ensure high availability and disaster recovery.
Load Balancing: Use Load Balancers to distribute traffic across multiple instances for fault tolerance.
5. Automated Deployments:
Infrastructure as Code (IaC): Use tools like Terraform or Oracle's Resource Manager to define and provision infrastructure, ensuring consistency and repeatability.
CI/CD Pipelines: Implement continuous integration and deployment pipelines for automated testing and deployment.
6. Monitoring and Logging:
Monitoring Services: Use OCI Monitoring and Notifications to set up alerts and monitor resources, enabling proactive issue resolution.
Logging: Centralize logs using OCI Logging to facilitate troubleshooting and security auditing.
7. Backup and Disaster Recovery:
Backup Strategies: Implement regular backups of critical data and ensure their integrity.
Disaster Recovery Plans: Have well-defined plans for disaster recovery, including backup restoration and failover procedures.
8. Compliance and Governance:
Compliance Standards: Adhere to relevant compliance standards (e.g., GDPR, HIPAA) and regularly audit configurations.
Governance Policies: Establish governance policies for resource tagging, naming conventions, and access controls.
9. Performance Optimization:
Content Delivery Networks (CDN): Utilize OCI's CDN for caching and delivering content closer to end-users, enhancing performance.
Optimize Database Performance: Utilize OCI's database tuning and optimization features for improved performance.
10. Documentation and Training:
Documentation: Maintain detailed documentation of configurations, deployments, and best practices.
Training and Knowledge Sharing: Continuously educate and train teams on new features, best practices, and security measures within OCI.
Implementing these best practices will help in creating robust, secure, and efficient deployments on Oracle Cloud Infrastructure. Tailor these practices based on specific application requirements and stay updated with OCI's latest features and improvements for continual enhancement.