작성
·
71
0
user-data 스크립트를 복사하여 진행하였습니다. 깃 클론이 동작하지 않는것 같으며, 몇개의 인스턴스를 새로 만들어 보았으나 똑같은 상황이고, 직접 복사해서 터미널에 붙여 넣으니 정상적으로 클론 & 빌드 됩니다. 헤결해보려했으나 잘 안되서 질문드립니다.. 어디서 실수를 한것일까요?
---------------------------------------------------------
cat /var/log/cloud-init-output.log
Cloud-init v. 22.2.2 running 'init' at Wed, 25 Sep 2024 05:33:28 +0000. Up 5.06 seconds.
ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: | ens5 | True | 10.0.2.183 | 255.255.255.0 | global | 0a:46:c1:75:88:63 |
ci-info: | ens5 | True | fe80::846:c1ff:fe75:8863/64 | . | link | 0a:46:c1:75:88:63 |
ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . |
ci-info: | lo | True | ::1/128 | . | host | . |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: ++++++++++++++++++++++++++++Route IPv4 info+++++++++++++++++++++++++++++
ci-info: +-------+-------------+----------+-----------------+-----------+-------+
ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags |
ci-info: +-------+-------------+----------+-----------------+-----------+-------+
ci-info: | 0 | 0.0.0.0 | 10.0.2.1 | 0.0.0.0 | ens5 | UG |
ci-info: | 1 | 10.0.0.2 | 10.0.2.1 | 255.255.255.255 | ens5 | UGH |
ci-info: | 2 | 10.0.2.0 | 0.0.0.0 | 255.255.255.0 | ens5 | U |
ci-info: | 3 | 10.0.2.1 | 0.0.0.0 | 255.255.255.255 | ens5 | UH |
ci-info: +-------+-------------+----------+-----------------+-----------+-------+
ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: | Route | Destination | Gateway | Interface | Flags |
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: | 0 | fe80::/64 | :: | ens5 | U |
ci-info: | 2 | local | :: | ens5 | U |
ci-info: | 3 | multicast | :: | ens5 | U |
ci-info: +-------+-------------+---------+-----------+-------+
Generating public/private ed25519 key pair.
Your identification has been saved in /etc/ssh/ssh_host_ed25519_key
Your public key has been saved in /etc/ssh/ssh_host_ed25519_key.pub
The key fingerprint is:
SHA256:fpsHSruoIojFa8d8/mYqtdccZq0Cr3EmxaAgllKrGAI root@ip-10-0-2-183.eu-north-1.compute.internal
The key's randomart image is:
+--[ED25519 256]--+
|E . |
|.... |
|=oo . |
|=+ . . o |
|o. . S . |
| o oo. = . |
|o. + .o=+B.+ |
|+ + = o*O.+o. |
| o o.==Booo. |
+----[SHA256]-----+
Generating public/private ecdsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key
Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub
The key fingerprint is:
SHA256:/A37KFDhyVfBSIbDAullypcuJM8J98k4VrUgMrAgNBI root@ip-10-0-2-183.eu-north-1.compute.internal
The key's randomart image is:
+---[ECDSA 256]---+
|E= .o . ooo.. |
|+.+ o = *.. o |
|. = = B = . |
| o +. . |
| B O oS.. |
| O * . + |
| . o . o . |
| . o |
| .. . |
+----[SHA256]-----+
Cloud-init v. 22.2.2 running 'modules:config' at Wed, 25 Sep 2024 05:33:30 +0000. Up 7.27 seconds.
Cloud-init v. 22.2.2 running 'modules:final' at Wed, 25 Sep 2024 05:33:31 +0000. Up 7.97 seconds.
Amazon Linux 2023 repository 49 MB/s | 27 MB 00:00
Amazon Linux 2023 Kernel Livepatch repository 42 kB/s | 8.3 kB 00:00
Last metadata expiration check: 0:00:01 ago on Wed Sep 25 05:33:43 2024.
Dependencies resolved.
Nothing to do.
Complete!
Last metadata expiration check: 0:00:02 ago on Wed Sep 25 05:33:43 2024.
Dependencies resolved.
========================================================================================
Package Arch Version Repository Size
========================================================================================
Installing:
java-17-amazon-corretto-headless aarch64 1:17.0.12+7-1.amzn2023.1 amazonlinux 91 M
Installing dependencies:
alsa-lib aarch64 1.2.7.2-1.amzn2023.0.2 amazonlinux 492 k
cairo aarch64 1.17.6-2.amzn2023.0.1 amazonlinux 669 k
dejavu-sans-fonts noarch 2.37-16.amzn2023.0.2 amazonlinux 1.3 M
dejavu-sans-mono-fonts noarch 2.37-16.amzn2023.0.2 amazonlinux 467 k
dejavu-serif-fonts noarch 2.37-16.amzn2023.0.2 amazonlinux 1.0 M
fontconfig aarch64 2.13.94-2.amzn2023.0.2 amazonlinux 278 k
fonts-filesystem noarch 1:2.0.5-12.amzn2023.0.2 amazonlinux 9.5 k
freetype aarch64 2.13.2-5.amzn2023.0.1 amazonlinux 413 k
google-noto-fonts-common noarch 20201206-2.amzn2023.0.2 amazonlinux 15 k
google-noto-sans-vf-fonts noarch 20201206-2.amzn2023.0.2 amazonlinux 492 k
graphite2 aarch64 1.3.14-7.amzn2023.0.2 amazonlinux 93 k
harfbuzz aarch64 7.0.0-2.amzn2023.0.1 amazonlinux 843 k
javapackages-filesystem noarch 6.0.0-7.amzn2023.0.6 amazonlinux 12 k
langpacks-core-font-en noarch 3.0-21.amzn2023.0.4 amazonlinux 10 k
libX11 aarch64 1.7.2-3.amzn2023.0.4 amazonlinux 648 k
libX11-common noarch 1.7.2-3.amzn2023.0.4 amazonlinux 152 k
libXau aarch64 1.0.9-6.amzn2023.0.2 amazonlinux 32 k
libXext aarch64 1.3.4-6.amzn2023.0.2 amazonlinux 40 k
libXrender aarch64 0.9.10-14.amzn2023.0.2 amazonlinux 27 k
libbrotli aarch64 1.0.9-4.amzn2023.0.2 amazonlinux 316 k
libjpeg-turbo aarch64 2.1.4-2.amzn2023.0.5 amazonlinux 191 k
libpng aarch64 2:1.6.37-10.amzn2023.0.6 amazonlinux 121 k
libxcb aarch64 1.13.1-7.amzn2023.0.2 amazonlinux 231 k
pixman aarch64 0.40.0-3.amzn2023.0.3 amazonlinux 194 k
xml-common noarch 0.6.3-56.amzn2023.0.2 amazonlinux 32 k
Transaction Summary
========================================================================================
Install 26 Packages
Total download size: 99 M
Installed size: 273 M
Downloading Packages:
(1/26): dejavu-sans-fonts-2.37-16.amzn2023.0.2. 16 MB/s | 1.3 MB 00:00
(2/26): cairo-1.17.6-2.amzn2023.0.1.aarch64.rpm 6.4 MB/s | 669 kB 00:00
(3/26): alsa-lib-1.2.7.2-1.amzn2023.0.2.aarch64 4.5 MB/s | 492 kB 00:00
(4/26): dejavu-sans-mono-fonts-2.37-16.amzn2023 15 MB/s | 467 kB 00:00
(5/26): dejavu-serif-fonts-2.37-16.amzn2023.0.2 32 MB/s | 1.0 MB 00:00
(6/26): fonts-filesystem-2.0.5-12.amzn2023.0.2. 402 kB/s | 9.5 kB 00:00
(7/26): fontconfig-2.13.94-2.amzn2023.0.2.aarch 6.3 MB/s | 278 kB 00:00
(8/26): google-noto-fonts-common-20201206-2.amz 876 kB/s | 15 kB 00:00
(9/26): google-noto-sans-vf-fonts-20201206-2.am 19 MB/s | 492 kB 00:00
(10/26): freetype-2.13.2-5.amzn2023.0.1.aarch64 8.6 MB/s | 413 kB 00:00
(11/26): graphite2-1.3.14-7.amzn2023.0.2.aarch6 2.5 MB/s | 93 kB 00:00
(12/26): javapackages-filesystem-6.0.0-7.amzn20 602 kB/s | 12 kB 00:00
(13/26): langpacks-core-font-en-3.0-21.amzn2023 636 kB/s | 10 kB 00:00
(14/26): harfbuzz-7.0.0-2.amzn2023.0.1.aarch64. 14 MB/s | 843 kB 00:00
(15/26): libX11-common-1.7.2-3.amzn2023.0.4.noa 5.8 MB/s | 152 kB 00:00
(16/26): libX11-1.7.2-3.amzn2023.0.4.aarch64.rp 12 MB/s | 648 kB 00:00
(17/26): libXau-1.0.9-6.amzn2023.0.2.aarch64.rp 1.1 MB/s | 32 kB 00:00
(18/26): libXrender-0.9.10-14.amzn2023.0.2.aarc 1.5 MB/s | 27 kB 00:00
(19/26): libXext-1.3.4-6.amzn2023.0.2.aarch64.r 1.2 MB/s | 40 kB 00:00
(20/26): libbrotli-1.0.9-4.amzn2023.0.2.aarch64 6.1 MB/s | 316 kB 00:00
(21/26): libjpeg-turbo-2.1.4-2.amzn2023.0.5.aar 3.7 MB/s | 191 kB 00:00
(22/26): libpng-1.6.37-10.amzn2023.0.6.aarch64. 2.6 MB/s | 121 kB 00:00
(23/26): libxcb-1.13.1-7.amzn2023.0.2.aarch64.r 5.2 MB/s | 231 kB 00:00
(24/26): xml-common-0.6.3-56.amzn2023.0.2.noarc 1.7 MB/s | 32 kB 00:00
(25/26): pixman-0.40.0-3.amzn2023.0.3.aarch64.r 4.1 MB/s | 194 kB 00:00
(26/26): java-17-amazon-corretto-headless-17.0. 79 MB/s | 91 MB 00:01
--------------------------------------------------------------------------------
Total 69 MB/s | 99 MB 00:01
[ec2-user@ip-10-0-2-183 ~]$ vi /var/log/cloud-init-output.log
[ec2-user@ip-10-0-2-183 ~]$ ping github.com
PING github.com (140.82.121.3) 56(84) bytes of data.
64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=1 ttl=49 time=21.3 ms
64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=2 ttl=49 time=21.4 ms
64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=3 ttl=49 time=21.4 ms
^C
--- github.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 21.284/21.366/21.423/0.059 ms
[ec2-user@ip-10-0-2-183 ~]$ ls -l
total 0
[ec2-user@ip-10-0-2-183 ~]$
답변 2
0
안녕하세요 백종성님!
우선 로그에서는 깃이 제대로 설치되었는지 확인할 수 없어 버전 명령어로 확인해보면 좋을 것 같습니다.
git --version
추가적으로 스크립트를 통해 clone 된 프로젝트는 root 폴더에 생성되고 있습니다. 그래서 클론된 폴더를 확인하기 위해
ls -l /
명령어나
cd.. 를 통해 루트로 가서 ls -l 명령어로 확인해보시면 좋을 것 같습니다.
문제가 계속 발생된다면, user script로 입력한 스크립트를 포함해서 문의 남겨주시면 문제를 파악하는데 도움이 될 것 같습니다!
0
안녕하세요, 인프런 AI 인턴입니다. 백종성님,
사용자 데이터 스크립트를 적용한 후 EC2 인스턴스가 git clone 명령을 실행하지 못하는 문제에 대해 유사한 질문과 답변이 몇 가지 있습니다. 이를 바탕으로 해결 방법을 안내 드리겠습니다.
아래 링크의 답변들을 참고하여 문제를 해결해 보시기 바랍니다:
위 링크들을 통해 유사한 문제점과 해결 방안을 참고하시면 도움이 될 것으로 보입니다. 유저 데이터 스크립트 오류나 네트워크 설정 문제, 혹은 스크립트의 구문 오류 등이 원인일 수 있습니다.
저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.