{"id":315,"date":"2022-11-30T07:26:51","date_gmt":"2022-11-30T07:26:51","guid":{"rendered":"https:\/\/santosh-shah.com\/blog\/?p=315"},"modified":"2024-05-15T06:36:26","modified_gmt":"2024-05-15T06:36:26","slug":"re-installing-codedeploy-agent-in-linux-sever","status":"publish","type":"post","link":"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/","title":{"rendered":"Re-Installing codedeploy agent in linux sever"},"content":{"rendered":"\n<p>Login to you linux server <\/p>\n\n\n\n<p>Check if codedeploy agent installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo codedeoploy-agent status<\/code><\/pre>\n\n\n\n<p>Remove any existing if already installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> sudo yum erase codedeploy-agent<\/code><\/pre>\n\n\n\n<p>Remove any remaining logs at opt folder<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\nsudo rm -r codedeploy-agent\/\n\ncd \/etc\/init.d \nsudo rm -r codedeploy-agent<\/code><\/pre>\n\n\n\n<p>Install wget and codedeploy agent on instance using <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/codedeploy-agent-operations-install-linux.html\" target=\"_blank\" rel=\"noreferrer noopener\">aws document<\/a>. You can change the region as per your own region.  You need to make sure the code deploy-agent is uninstalled completely if you are reinstalling.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum -y install wget\nwget https:\/\/aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com\/latest\/install\n\nsudo chmod +x .\/install\nsudo .\/install auto<\/code><\/pre>\n\n\n\n<p>Without having to re-install you can also delete all logs at deployment-root folder and restart the codedeploy-agent again.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/codedeploy-agent\/deployment-root\nsudo rm -r -f *\n\nsudo service codedeploy-agent status\nsudo service codedeploy-agent stop\nsudo service codedeploy-agent start<\/code><\/pre>\n\n\n\n<p>To check codedeploy logs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\ncd \/opt\/codedeploy-agent\/deployment-root\/deployment-logs\ncat codedeploy-agent-deployments.log<\/code><\/pre>\n\n\n\n<p>To see log data in <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/deployments-view-logs.html#deployments-view-logs-instance\" target=\"_blank\" rel=\"noreferrer noopener\">windows server<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\ProgramData\\Amazon\\CodeDeploy\\log\\codedeploy-agent-log.txt<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=sXZVkOH6hrA\">Youtube ref<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Login to you linux server Check if codedeploy agent installed. Remove any existing if already installed. Remove any remaining logs at opt folder Install wget and codedeploy agent on instance using aws document. You can change the region as per your own region. You need to make sure the code deploy-agent is uninstalled completely if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[16,17,15],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-aws","tag-aws-ec2","tag-codedeploy-agent","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Re-Installing codedeploy agent in linux sever - Santosh Kumar Shah<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Re-Installing codedeploy agent in linux sever - Santosh Kumar Shah\" \/>\n<meta property=\"og:description\" content=\"Login to you linux server Check if codedeploy agent installed. Remove any existing if already installed. Remove any remaining logs at opt folder Install wget and codedeploy agent on instance using aws document. You can change the region as per your own region. You need to make sure the code deploy-agent is uninstalled completely if [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/\" \/>\n<meta property=\"og:site_name\" content=\"Santosh Kumar Shah\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-30T07:26:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-15T06:36:26+00:00\" \/>\n<meta name=\"author\" content=\"Santosh Kumar Shah\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Santosh Kumar Shah\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/\",\"url\":\"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/\",\"name\":\"Re-Installing codedeploy agent in linux sever - Santosh Kumar Shah\",\"isPartOf\":{\"@id\":\"https:\/\/santosh-shah.com\/blog\/#website\"},\"datePublished\":\"2022-11-30T07:26:51+00:00\",\"dateModified\":\"2024-05-15T06:36:26+00:00\",\"author\":{\"@id\":\"https:\/\/santosh-shah.com\/blog\/#\/schema\/person\/b17cb45bdd5f518e74a08ad2c6c4b39f\"},\"breadcrumb\":{\"@id\":\"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/santosh-shah.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Re-Installing codedeploy agent in linux sever\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/santosh-shah.com\/blog\/#website\",\"url\":\"https:\/\/santosh-shah.com\/blog\/\",\"name\":\"Santosh Kumar Shah\",\"description\":\"JavaScript Developer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/santosh-shah.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/santosh-shah.com\/blog\/#\/schema\/person\/b17cb45bdd5f518e74a08ad2c6c4b39f\",\"name\":\"Santosh Kumar Shah\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/santosh-shah.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cf46c57219d897547f3204b6b302169b3302b17507ccc902946b622a78d0b98b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cf46c57219d897547f3204b6b302169b3302b17507ccc902946b622a78d0b98b?s=96&d=mm&r=g\",\"caption\":\"Santosh Kumar Shah\"},\"description\":\"I am JavaScript developer.\",\"sameAs\":[\"https:\/\/santosh-shah.com\/blog\"],\"url\":\"https:\/\/santosh-shah.com\/blog\/author\/sks7yu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Re-Installing codedeploy agent in linux sever - Santosh Kumar Shah","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/","og_locale":"en_US","og_type":"article","og_title":"Re-Installing codedeploy agent in linux sever - Santosh Kumar Shah","og_description":"Login to you linux server Check if codedeploy agent installed. Remove any existing if already installed. Remove any remaining logs at opt folder Install wget and codedeploy agent on instance using aws document. You can change the region as per your own region. You need to make sure the code deploy-agent is uninstalled completely if [&hellip;]","og_url":"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/","og_site_name":"Santosh Kumar Shah","article_published_time":"2022-11-30T07:26:51+00:00","article_modified_time":"2024-05-15T06:36:26+00:00","author":"Santosh Kumar Shah","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Santosh Kumar Shah","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/","url":"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/","name":"Re-Installing codedeploy agent in linux sever - Santosh Kumar Shah","isPartOf":{"@id":"https:\/\/santosh-shah.com\/blog\/#website"},"datePublished":"2022-11-30T07:26:51+00:00","dateModified":"2024-05-15T06:36:26+00:00","author":{"@id":"https:\/\/santosh-shah.com\/blog\/#\/schema\/person\/b17cb45bdd5f518e74a08ad2c6c4b39f"},"breadcrumb":{"@id":"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/santosh-shah.com\/blog\/re-installing-codedeploy-agent-in-linux-sever\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/santosh-shah.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Re-Installing codedeploy agent in linux sever"}]},{"@type":"WebSite","@id":"https:\/\/santosh-shah.com\/blog\/#website","url":"https:\/\/santosh-shah.com\/blog\/","name":"Santosh Kumar Shah","description":"JavaScript Developer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/santosh-shah.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/santosh-shah.com\/blog\/#\/schema\/person\/b17cb45bdd5f518e74a08ad2c6c4b39f","name":"Santosh Kumar Shah","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/santosh-shah.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cf46c57219d897547f3204b6b302169b3302b17507ccc902946b622a78d0b98b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf46c57219d897547f3204b6b302169b3302b17507ccc902946b622a78d0b98b?s=96&d=mm&r=g","caption":"Santosh Kumar Shah"},"description":"I am JavaScript developer.","sameAs":["https:\/\/santosh-shah.com\/blog"],"url":"https:\/\/santosh-shah.com\/blog\/author\/sks7yu\/"}]}},"_links":{"self":[{"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":7,"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":441,"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions\/441"}],"wp:attachment":[{"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/santosh-shah.com\/blog\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}