Now we gone install artifact locally in our machine
For that we need jdk and maven installed in our machine,if you follow our pre requisition and download all the tool you can skip this part now.
To download artifact go to gitbasah
Go to our repo--->cd vprofile-project---->cd src---->cd main---->cd resources (inside resources folder we have application file we are going to change this).
vi application file
Change db01:3306 to db01.vprofile.in:3360
Change mc01 to mc01.vprofile.in:11211
Change rmq01 to rmq01.vproject.in.5672.
#JDBC Configutation for Database Connection
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://db01:3306(db01.vprofile 1.in:3306)/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
jdbc.username=admin
jdbc.password=admin123
#Memcached Configuration For Active and StandBy Host
#For Active Host
memcached.active.host=mc01(mc01.vprofile 1.in)
memcached.active.port=11211
#For StandBy Host
memcached.standBy.host=127.0.0.2
memcached.standBy.port=11211
#RabbitMq Configuration
rabbitmq.address=rmq01(rmq01.vprofile 1.in)
rabbitmq.port=5672
rabbitmq.username=test
rabbitmq.password=test
#Elasticesearch Configuration
elasticsearch.host =192.168.1.85
elasticsearch.port =9300
elasticsearch.cluster=vprofile
elasticsearch.node=vprofilenode
press esc and try :wq to come out from vim file
To check everything is working fine try cat application properties
Now go to ec2 ----->Go to route 53 to verify the name what we gave is right before we build artifact.------>If everything is fine ----> go to gitbash.
we gonna build our source code into artifact
Check where is pom.xml file----Try the below command
cd vprofile-project ------>ls
Try this command to build artifact
mavn install
we gonna store this artifact to s3 backet
we gonna create IAM to use awscli
IAM ---->USER ---> USER NAME : vprofile-s3-admin------>Access type: Programmatic Access ----> Attachhed Exiting Policy-----> Amazon s3 full service ---------->Download Crediional file.
After this go to Gitbash----->root user---->configure aws---->aws configure----->Aws access key ID------>Give this information from the creditional downloaded ------->Security key----->Default region name--------->default output format----->
Now time to create s3 bucket
aws s3 mb s3://<vprofile-artifact-storage> we can give any name for our bucket.
cd vprofile-project---->ls ----->cd target---->ls (inside this we have vprofile-artifact)------>Now we cp artifact to war file--->Try this command
--------> aws s3 cp vprofile-v2.war s3 vprofile-artifact-storage/vprofile-v2.war---------> aws s3 ls s3 vprofile-artifact-storage
Load Balncer and Auto scalling