본문 바로가기
반응형

[AWS]354

[AWS] [그라파나 활용] re:Invent 2020: Introducing Amazon Managed Service for Grafana ## 그라파나 구축 데모 - Workspace 생성 - Grafana Workspace URL 생성 - 사전 SSO 사용자 추가 권장 (나중에 해도 됨) - [미사용 - 수동 생성시] URL 접속 --> Configuration --> Data Sources --> Add data source --> cloudwatch 선택 - [미사용] 수백개의 계정시 일일이 넣어줘야 함 - [사용] AWS Data Sources --> Data sources --> Cloudwatch --> 해당계정 선택 - 세부정보 자동 등록됨 - 사용지표 자동 등록 (EC2, EBS, Lambda, CloudWatch Logs, RDS) - IOT 모니터링 - 사용자 추가 ## 데모 2 https://www.youtube.com.. 2022. 3. 13.
[AWS] [활용] RDS SQL Server 생성 – 읽기 전용 복제본 생성편 https://docs.aws.amazon.com/ko_kr/AmazonRDS/latest/UserGuide/SQLServer.ReadReplicas.html#SQLServer.ReadReplicas.Limitations [중요] 읽기전용 복제본을 사용하려면... 다중AZ 사용하는 인스턴스만 가능하다. 결국 Enterprise Edition을 사용해야 제공되는 기능이다. 오래 걸린다. ㅠ.ㅠ. 주서버 역할의 인스턴스를 선택 하고 우측 Action 을 클릭, "Create read replica"를 클릭해서 생성한다. 아래 2개 옵션은 주서버를 선택하는 것이고 새로 만드는 복제본의 Identifier 이름을 입력한다. 생성이 완료되었다. 목록보기가 참 어렵게 되어있다. 어떤 인스턴스의 읽기전용인지 구분이 .. 2022. 3. 10.
[AWS] CentOS 7 부팅시 자동시작 스크립트 적용 리눅스 Centos 7 부팅시 명령어 자동실행 방법 자동으로 실행되게 하려면 '/etc/rc.d/rc.local' 파일을 이용하면 됩니다. rc.local 실행권한 허용 chmod +x /etc/rc.d/rc.local 실행스크립트 추가 vi /etc/rc.d/rc.local 상태 확인 systemctl status rc-local.service 실행 systemctl start rc-local.service 리부팅되어도 실행되게 서비스설정 enable 처리 vi /usr/lib/systemd/system/rc-local.service -> 아래내용 추가 [Install] WantedBy=multi-user.target systemctl enable rc-local.service systemctl sta.. 2022. 3. 8.
[AWS] Tomcat 서비스 등록, 삭제, 목록 확인 [Centos7] Tomcat 서비스 등록, 삭제, 목록 확인 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 [root@test ~]# systemctl list-units --type service UNIT LOAD ACTIVE SUB DESCRIPTION auditd.service loaded active running Security Auditing Service chronyd.service loaded active running NTP client/server crond.service loaded active running Command.. 2022. 3. 8.
[AWS] 키페어 가져오기 - Failed to import AWS Keypair into other region!!! If you see any error like Value for parameter PublicKeyMaterial is invalid. Length exceeds maximum of 2048 while importing PEM file from one region to other region, then we can generate key again from sshkeygen command and use the output while importing. Step 1: ssh-keygen -y -f pem-file-name.pem (기존 사용서버에서 할 것) Step 2: Copy the output and paste it in the AWS console import window. Step 3: Click.. 2022. 3. 7.
AWS Systems Manager | Run Command or Script in multiple EC2 Linux instances | Live Coding with SSM https://www.youtube.com/watch?v=5JnOVMb4lTs&t=1s 2022. 3. 7.
[AWS] SSM - System Manager - EC2에서 원격으로 command 실행 아래 내용은 링크의 내용을 기본으로 한다. EC2에 command를 실행할때(패치 업데이트, 프로그램 설치, 실행, 삭제 등) 매번 ssh로 접속해서 실행하는건 꽤 불편한 작업이다. 접속 정보를 기억하고 있어야 하고, PC 환경이 바뀌면서 방화벽에 막히거나, 인증정보 등이 없을수 있다. 게다가 같은 command를 여러개의 EC2에서 실행해야된다면 더욱 귀찮을수 밖에 없다. 이러한 불편함을 AWS System Manager 의 Run Command 기능이 해결해줄 수 있다. 이를 위해서는 다음을 수행해야 한다. EC2에 AWS System Manager Agent 설치 IAM Role 생성 (EC2가 System Manager에 정보를 전달하거나 받아올수 있도록) EC2에 Role 추가 Run Comma.. 2022. 3. 7.
15: GitLab CI Deploy to Remote Server over SSH 15:GitLab CI Deploy to Remote Server over SSH |Deploy Code to AWS EC2 Instance using SSH with GitLab https://www.fosstechnix.com/gitlab-ci-deploy-to-ec2-using-ssh/ GitLab CI Deploy to EC2 using SSH GitLab CI Deploy to EC2 using SSH | GitLab CI Deploy to Remote Server | Deploy Code to AWS EC2 Instance using SSH with GitLab CI/CD Pipeline www.fosstechnix.com stages: - deploy #In this we have only .. 2022. 3. 4.
[AWS] Powershell을 이용한 EC2 SSH 원격 접속 ## pem 키 권한 변경 필요 ## 상속 모두 해제 ## 소유자만 모든 권한 부여 ## Powershell 로 EC2 접속 성공 2022. 3. 4.
[AWS] [Tomcat] Tomcat에 war 배포하는 방법 war 파일은 Web Application aRchive의 약자로 웹 애플리케이션을 이루는 요소들을 한곳에 모아 배포하는데 사용되는 JAR 파일이다. 흔히들 이클립스를 사용하고 로컬에서 웹 애플리케이션을 실행한다면 이러한 배포를 별도로 진행하지 않을 것이다. 이는 이클립스에서 자동으로 등록된 톰캣 서버에 배포를 진행하기 때문이다. 그렇다면 IDE의 자동 배포가 아니라 직접 배포를 해야한다면 어떻게 하는지 알아볼 것이다. War 생성하기 우선 웹 애플리케이션의 war파일을 생성해야한다. 이클립스에서는 아주 간편하게 war파일을 생성해주는데 방법은 아래와 같다. 프로젝트 우클릭 -> export 클릭 -> war 검색 후 선택 -> war파일 이름과 저장 경로 선택 -> 생성 완료 이때 war파일명은 ROO.. 2022. 3. 4.
[AWS] EC2(Amazon Linux) JAVA 11 설치하기 / ec2 jdk11 설치 1. yum list java* 로 java 설치 가능 리스트 검색 java-11-amazon-corretto.x86_64 가 ec2에서 설치할 수 있는 java11 jdk이다. * Amazon Corretto 란 무료로 사용할 수 있는 Open Java Development Kit (OpenJDK) 의 프로덕션용 멀티플랫폼 배포판입니다. 2. 설치 : yum install java-11-amazon-corretto.x86_64 설치 완료 후 버전 확인 기존에 다른 버전의 java가 설치되어 있던 경우 java8 이 설치되어 있었음. java11 이후에 version 확인하면 그대로 8버전이므로 설정을 따로 해줄것. update-alternatives --config java 하고 2번 선택 update.. 2022. 3. 4.
[추천] [AWS Amazon Linux 2] Tomcat 8.5.64 컴파일 설치 & 서비스 등록 😉 Tomcat 컴파일 설치 yum과 같은 package manager 대신, 소스를 직접 다운받아 컴파일해서 설치 그런데, 톰캣은 컴파일 과정은 없고 소스파일만 받아다가 잘 위치해놓고 서비스 등록하는 것으로 끝! $ sudo yum install -y java-1.8.0-openjdk-devel.x86_64 $ mkdir /usr/local/tomcat8 $ cd /usr/local/tomcat8 $ wget https://downloads.apache.org/tomcat/tomcat-8/v8.5.64/bin/apache-tomcat-8.5.64.tar.gz $ tar xvfz apache-tomcat-8.5.64.tar.gz 😊 서비스 등록 $ vim /usr/lib/systemd/system/tom.. 2022. 3. 4.
SSH 접속 오류 : REMOTE HOST IDENTIFICATION HAS CHANGED - RSA key 오류 해결법 SSH 접속 오류 [ WARNING : REMOTE HOST IDENTIFICATION HAS CHANGED ] 리눅스 서버에서 서버간 통신을 위해 가장 많이 사용하는 서비스인 SSH를 사용하다보니, 상기 오류가 발생해 상당히 당황스러웠다. 그래도 많은 분들이 해당 오류에 대해 해결 법을 많이 적어두어, 그리 어렵지 않게 해결 한 오류 경고 메세지이기도 하다. 메세지 내용 (속독은 빨간 명령어만 보세용!) SSH 를 통해 위와 같이 192.168.0.2 접속 하려 하니, WARNING : REMOTE HOST IDENTIFICATION HAS CHANGED 메세지가 발생하며 당황케 만든다.... 그리고 눈에 보이는 MAN-IN-THE-MIDDLE ATTACK? ... 조금 두렵기도 하다. 이미지 속 내용.. 2022. 3. 3.
[AWS] Spring Boot로 ElastiCache 간단한 실습해보기 AWS ElastiCache 시작하기 이번 글에서는 AWS ElastiCache를 생성하고 아주 간단한 실습을 하는 것을 정리해보겠습니다. 이번 실습에서는 Redis를 사용해서 할 것이기 때문에 Redis를 체크하겠습니다. 위의 노드 유형을 t2.micro(프리티어)로 해야 합니다! (Default로 되어 있는 거 쓰면 좋은 성능이라 요금 많이 나옵니다..) 보안그룹은 따로 생성해서 지정해주어도 되고 기존이 6379 포트가 열려있는 보안그룹이 있다면 그것을 사용해도 됩니다.(저도 열려있는 보안그룹이 있기 때문에 그것을 사용하겠습니다.) 그리고 나머지는 Default로 놓고 생성하겠습니다. 그러면 위와 같이 생성이 되는데 5분 정도 기다려야 생성이 완료됩니다. EC2 접속 후 redis-cli 설치하기 #.. 2022. 3. 3.
sed 명령어 build: stage: build image: openjdk:12-alpine script: - sed -i "s/CI_PIPELINE_IID/$CI_PIPELINE_IID/" ./src/main/resources/application.yml - sed -i "s/CI_COMMIT_SHORT_SHA/$CI_COMMIT_SHORT_SHA/" ./src/main/resources/application.yml - sed -i "s/CI_COMMIT_BRANCH/$CI_COMMIT_BRANCH/" ./src/main/resources/application.yml - ./gradlew build - mv ./build/libs/cars-api.jar ./build/libs/$ARTIFACT_NAME artifa.. 2022. 3. 2.
65장. Assignment solution (오류 해결) ## gitlabci 계정 AWSElasticBeanstalk 정책 추가 ## .gitlab-ci.yml variables: ARTIFACT_NAME: cars-api-v$CI_PIPELINE_IID.jar APP_NAME: cars-api stages: - build - test - deploy build: stage: build image: openjdk:12-alpine script: - ./gradlew build - mv ./build/libs/cars-api.jar ./build/libs/$ARTIFACT_NAME artifacts: paths: - ./build/libs/ smoke test: stage: test image: openjdk:12-alpine before_script: - a.. 2022. 3. 2.
63장. AWS CLI를 사용하여 AWS Elastic Beanstalk에 Java 애플리케이션을 배포하는 방법 ## ElasticBeanstalk CLI 명령어 https://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/ elasticbeanstalk — AWS CLI 1.22.64 Command Reference Note: You are viewing the documentation for an older major version of the AWS CLI (version 1). AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click h.. 2022. 3. 2.
62장. GitLab CI에서 AWS S3로 파일을 업로드하는 방법 ## S3 CLI 명령어 https://docs.aws.amazon.com/cli/latest/reference/s3/ s3 — AWS CLI 1.22.64 Command Reference Note: You are viewing the documentation for an older major version of the AWS CLI (version 1). AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. F docs.aws.amazon.com ## Gitlab 용 CLI.. 2022. 3. 1.
[AWS] Monitoring - 2. CloudWatch Agent 설치[Memory/Disk 수집] 이번 글에서는 이전글에서 이야기 했듯이 CloudWatch는 기본적으로 Memory와 Disk에 대해서는 수집을 하지 못하기 때문에 수집을 하기 위해서는 CloudWatch Agent를 설치하고 설정해줘서 수집 및 대시보드로 구성해야 합니다. 이번 글에서는 CloudWatch Agent 설치[Linux OS]와 Dashboard 구성을 해보도록 하겠습니다. 1. IAM 역할 만들기 수집할 EC2 인스턴스가 CloudWatch Agent의 수집을 할 수 있도록 IAM의 역할[CloudWatchAgentServerPolicy]을 생성하도록 하겠습니다. 역할 선택 > 역할 만들기 를 클릭합니다. 일반 사용 사례 EC2 클릭 > 다음:권한 클릭합니다. 정책 필터에 cloudwatchagent > CloudWat.. 2022. 2. 28.
[AWS] AWS(아마존) EC2 (Linux,ubuntu,centos) Timezone 설정 # AWS(아마존) EC2 (Linux,ubuntu,centos) Timezone 설정 AWS EC2 에 새 인스턴스를 만들게 되면 시간(Timezone)을 변경해 주어야 한다 시간(Timezone)을 맞추지 않으면 미국 태평양 시간으로 표시가 되는데 글쓴이는 뼈속 까지 한국인이니 한국 표준시인 KST로 변경하기로 하고 변경 방법을 기록으로 남겨보자. Timezone 변경 // 현재 시간 (Timezone 확인) sudo date // localtime 삭제 sudo rm /etc/localtime // timezone Aisa/Seoul 로 변경 sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime // 변경된 시간 (Timezone) 확인 후 마무리 s.. 2022. 2. 28.
[AWS] GitLab CICD Pipelines with AWS EC2 and S3 https://www.youtube.com/watch?v=ab3Fca1HeEI 2022. 2. 28.
61장. GitLab 그룹 설정 ## cars-oky-test 버킷 생성 ## 깃랩 그룹 생성 - gitlab-course-oky - 그룹내 CI/CD --> Variables 에서 버킷 변수 지정 (그룹내 타프로젝트와 공유 가능) ================================== Because we want to use this service in Vietnam, it would make sense to copy his name and put it in a variable, wanted to point out that you can organize project in Gottleib in groups. Organizing project in groups has some advantages, for example, we c.. 2022. 2. 24.
60장. AWS S3 시작하기 ## 퍼블릭 엑세스 차단 후, 생성 https://aws.amazon.com/ko/s3/ 클라우드 스토리지 | 웹 스토리지| Amazon Web Services aws.amazon.com ================================= Let's go back to the AWB management console. And from here, we're going to go to all services in case this isn't opened, and we said that we want to use the S3 service and we'll find that under storage. You want to get started with us three, we need to create.. 2022. 2. 24.
59장. GitLab CI에서 AWS로 배포하는 방법 ## CLI 이용시 - Jar 파일 곧바로 Elastic Beanstalk 업로드 불가 (S3 활용 필요) ================================= Now, we have mainly deployed a job application and it's running into a w cloud infrastructure, but our goal of automation is to avoid any manual interaction. So we need to figure out a way how we can deploy our job application in the cloud directly from catalepsy. In order to do that, we have to follow .. 2022. 2. 24.
58장. AWS에 배포하는 방법(수동 업로드) - Elastic Beanstalk ## Elastic Beanstalk --> 애플리케이션 생성 - .jar 파일 수동 업로드 배포 성공 ## GUI 환경이 아니므로, Postman 에서 설정후, 테스트 ============================================== So let's get started using the A.W. has been stopped from the AWB management console. You can either search for service here or click on all services you'll see to the list of services is quite long. What we are needing is computing power. So for that reas.. 2022. 2. 24.
57장. AWS Elastic Beanstalk를 사용한 서버리스 컴퓨팅 ## JAVA, PHP, Docker, Node 개발소스 가능 Even if you use a cloud provider like Adewusi, you can still rent, to put it like that, a virtual machine that has a dedicated CPU memory and disk space. But this also means that you need to handle software updates or backups or handle any softer issues that may occur and that make your application run unstable. The U.S. Lastic Bienstock is a way to deploy an a.. 2022. 2. 23.
55장. Amazon Web Services(AWS)에 대한 간략한 소개 Amazon Web Services, or simply AWG, is a cloud platform offering over 170 services available in data centers all over the world. Such services include virtual servers, manage databases, file storage, content delivery and many others. Well, this section focuses on AWG, the principles presented here apply to any other providers. If you don't already have an AWB account, it's quite easy to create o.. 2022. 2. 23.
[AWS] Winsdows 서버 PowerShell 스크립트 자동 실행 방법 ## Route 설정 배치파일 생성 - route.bat 파일 생성 @ECHO OFF PowerShell.exe -Command "Import-Module c:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psm1 ; Add-Routes" PowerShell.exe -Command "& $Env:ProgramFiles\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1 -a fetch-config -m ec2 -c file:C:\Users\Administrator\Desktop\CWAgent\config.json -s" - C:\ProgramData\Microsoft\Windows\Start M.. 2022. 2. 23.
54장. CI/CD 파이프라인 요약 ===================================== Now we have an artifact or a package of software, we have tested it and we are ready for deployment. So what to do next? We want to have this somewhere where a client, either from a mobile app or from a web location, can access this car information to displayed for the end users. That leads to opposite direction in which you can go if you want to deploy some.. 2022. 2. 22.
53장. 테스트 단계 : Adding a smoke test (기초테스트) script: - java -jar ./build/libs/cars-api.jar & - sleep 30 - curl http://localhost:5000/actuator/health | grep "UP" ## Postman 에서 정보 확인 ## .gitlab-ci.yml stages: - build - test build: stage: build image: openjdk:12-alpine script: - ./gradlew build artifacts: paths: - ./build/libs/ smoke test: stage: test image: openjdk:12-alpine before_script: - apk --no-cache add curl script: - java -jar ./buil.. 2022. 2. 22.
반응형