DevOps EC2 CloudFormation Troubleshooting Urgent
Budget: $10 – $30 AUD
I'm urgently seeking an experienced DevOps professional to help troubleshoot a critical issue with my EC2 provisioning using CloudFormation.
In the below UserData section line " sudo ./mount_fs_efs.sh script_server" not working..
==========
#!/bin/bash
module=$1
tar_env=$(cat /u01/env)
echo "current environment: ${tar_env}"
efs_ip=$(python3 get_efs_ip.py ${tar_env})
efs_fs_id=$(python3 get_efs_fs_id.py ${tar_env})
echo "efs ip: ${efs_ip}"
echo "efs fs-id: ${efs_fs_id}"
sudo printf "\n${efs_ip} ${efs_fs_id}.efs.ap-southeast-2.amazonaws.com" >> /etc/hosts
if test "${module}" == "script_server"; then
#sudo echo "${efs_fs_id}:/${module} /efs/u01/${tar_env} efs nofail,tls,_netdev 0 0" >> /etc/fstab
# mount the EFS file system
systemctl daemon-reload
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/script_server /efs/u01/$tar_env
#echo "${batch_file_system}.efs.ap-southeast-2.amazonaws.com:/ $batch_mount nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/${module} /efs/u01/${tar_env} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
fi
if test "${module}" == "app_server"; then
#sudo echo "${efs_fs_id}:/fs /akmefs/fs efs nofail,tls,_netdev 0 0" >> /etc/fstab
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/fs /akmefs/fs
#echo "${batch_file_system}.efs.ap-southeast-2.amazonaws.com:/ $batch_mount nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/fs /akmefs/fs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
fi
#sudo echo "${efs_fs_id}:/${module} /u01/${tar_env} efs nofail,tls,_netdev 0 0" >> /etc/fstab
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/$module /u01/$tar_env
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/${module} /u01/${tar_env} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
#sudo echo "${efs_fs_id}:/efs_share /efs_share efs nofail,tls,_netdev 0 0" >> /etc/fstab
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/efs_share /efs_share
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/efs_share /efs_share nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
#mount -a -t efs defaults
#sudo chown -R siebuser:siebapp /u01/${tar_env}/
sudo chown root:root /u01/${tar_env}/
echo "job completed"
==========================================
UserData:
Fn::Base64: !Sub |
#!/bin/bash
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
set -x
echo BEGIN
date '+%Y-%m-%d %H:%M:%S'
sudo service ctmagentv8 start
aws s3 cp s3://${s3installbkt}/host_keys/${EnvLower}/ssh_host_keys.tar.gz /tmp
tar -zxf /tmp/ssh_host_keys.tar.gz --directory /etc/ssh/ --overwrite
#sudo su - siebel
export RESOLV_MULTI=off
cd /tmp/siebel_install
sleep 30
sudo ./mount_fs_efs.sh script_server
sudo /tmp/siebel_install/ad_userdata.sh
sudo /tmp/siebel_install/ad_userdata.sh
sudo rm -rf /u01/siebel/oraclient/db/product/12.2.0/client_1/jdk
sudo rm -rf /u01/siebel/Siebel/ses/jdk
sudo rm -rf /u01/siebel/installables/sieb_install_image/15.0.0.0/Linux/Server/Siebel_Enterprise_Server/Disk1/stage/ORACLE_LDAP_Client/enu/deinstall/jre
echo END
- The problem is centered around a User-Data shell script within the CloudFormation stack that is not running correctly. In particular, the stack is failing to execute some of the commands in the shell script.
Ideal Skills and Experience:
- Proficient in AWS CloudFormation: Candidate should have a good understanding of AWS CloudFormation and its template structure.
- Strong DevOps background: Previous experience in troubleshooting similar issues in a DevOps environment is critical.
- Scripting expertise: A good grasp of shell scripting is necessary to identify and rectify the issues in the User-Data script.
The project is time-sensitive, and I need someone who can resolve the problem ASAP. If you have the right expertise and can commit to a quick turnaround, please get in touch.
In the below UserData section line " sudo ./mount_fs_efs.sh script_server" not working..
==========
#!/bin/bash
module=$1
tar_env=$(cat /u01/env)
echo "current environment: ${tar_env}"
efs_ip=$(python3 get_efs_ip.py ${tar_env})
efs_fs_id=$(python3 get_efs_fs_id.py ${tar_env})
echo "efs ip: ${efs_ip}"
echo "efs fs-id: ${efs_fs_id}"
sudo printf "\n${efs_ip} ${efs_fs_id}.efs.ap-southeast-2.amazonaws.com" >> /etc/hosts
if test "${module}" == "script_server"; then
#sudo echo "${efs_fs_id}:/${module} /efs/u01/${tar_env} efs nofail,tls,_netdev 0 0" >> /etc/fstab
# mount the EFS file system
systemctl daemon-reload
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/script_server /efs/u01/$tar_env
#echo "${batch_file_system}.efs.ap-southeast-2.amazonaws.com:/ $batch_mount nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/${module} /efs/u01/${tar_env} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
fi
if test "${module}" == "app_server"; then
#sudo echo "${efs_fs_id}:/fs /akmefs/fs efs nofail,tls,_netdev 0 0" >> /etc/fstab
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/fs /akmefs/fs
#echo "${batch_file_system}.efs.ap-southeast-2.amazonaws.com:/ $batch_mount nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/fs /akmefs/fs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
fi
#sudo echo "${efs_fs_id}:/${module} /u01/${tar_env} efs nofail,tls,_netdev 0 0" >> /etc/fstab
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/$module /u01/$tar_env
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/${module} /u01/${tar_env} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
#sudo echo "${efs_fs_id}:/efs_share /efs_share efs nofail,tls,_netdev 0 0" >> /etc/fstab
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $efs_fs_id.efs.ap-southeast-2.amazonaws.com:/efs_share /efs_share
echo "${efs_fs_id}.efs.ap-southeast-2.amazonaws.com:/efs_share /efs_share nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0" >> /etc/fstab
systemctl daemon-reload
#mount -a -t efs defaults
#sudo chown -R siebuser:siebapp /u01/${tar_env}/
sudo chown root:root /u01/${tar_env}/
echo "job completed"
==========================================
UserData:
Fn::Base64: !Sub |
#!/bin/bash
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
set -x
echo BEGIN
date '+%Y-%m-%d %H:%M:%S'
sudo service ctmagentv8 start
aws s3 cp s3://${s3installbkt}/host_keys/${EnvLower}/ssh_host_keys.tar.gz /tmp
tar -zxf /tmp/ssh_host_keys.tar.gz --directory /etc/ssh/ --overwrite
#sudo su - siebel
export RESOLV_MULTI=off
cd /tmp/siebel_install
sleep 30
sudo ./mount_fs_efs.sh script_server
sudo /tmp/siebel_install/ad_userdata.sh
sudo /tmp/siebel_install/ad_userdata.sh
sudo rm -rf /u01/siebel/oraclient/db/product/12.2.0/client_1/jdk
sudo rm -rf /u01/siebel/Siebel/ses/jdk
sudo rm -rf /u01/siebel/installables/sieb_install_image/15.0.0.0/Linux/Server/Siebel_Enterprise_Server/Disk1/stage/ORACLE_LDAP_Client/enu/deinstall/jre
echo END
- The problem is centered around a User-Data shell script within the CloudFormation stack that is not running correctly. In particular, the stack is failing to execute some of the commands in the shell script.
Ideal Skills and Experience:
- Proficient in AWS CloudFormation: Candidate should have a good understanding of AWS CloudFormation and its template structure.
- Strong DevOps background: Previous experience in troubleshooting similar issues in a DevOps environment is critical.
- Scripting expertise: A good grasp of shell scripting is necessary to identify and rectify the issues in the User-Data script.
The project is time-sensitive, and I need someone who can resolve the problem ASAP. If you have the right expertise and can commit to a quick turnaround, please get in touch.
Related categories:
Linux
Cloud Computing
Amazon Web Services
Network Administration
Amazon CloudFormation