νλ‘μ νΈλͺ
μ ProjYj2024
, μ¬μ©μλ projyj
λΌκ³ κ°μ£Όνκ³ μ€λͺ
ν¨
μ κ· κ°λ°ν ProjYj2024
, κΈ°μ‘΄μ κ°λ°λ ProjYjSvr
(ProjYj
) νλ‘μ νΈμ λͺ¨λ μ μν μ μλλ‘ κ΅¬μ±ν¨
ProjYj2024
λ ProjYjSvr
μ API λ₯Ό μ¬μ©
Oracel/MySQL μμ§
μλ²
OS : CentOs Stream 9
IP : 192.168.1.999 / PORT : 22
ID : root / PW : password$$
ID : root / PW : password$$
1-3. ν¬νΈλ³ μ μ μ 보
μ΄κΈ° ν¨μ€μλ : 070b01f500e94ca1b1a3c3fa01b0c911
Admin User μ 보
πΆ Installation Destination
μ μ₯μ ꡬμ±μ λ³κ²½νμ§ μκ³ κΈ°λ³ΈμΌλ‘ μ€μΉνμμ
πΆ μννΈμ¨μ΄ μ ν
μ€μΉνκ³ μΆμ νκ²½μ μ ν ν Done
μΌλ°μ μΌλ‘ ν
μ€νΈ λͺ©μ μΌλ‘ Server with GUI νκ²½μΌλ‘ μ€μΉ
μ΄λλ·μ΄ μ μΌμ Έμλμ§ νμΈ ν Done
CentOs Stream 9 λΆν
> root κ³μ μΌλ‘ μ μ > IP νμΈ
[root@localhost ~ ]$ hostname -I
192.168.1.999
Putty
λ‘ ssh μ μνμ¬ κ³μ μ§ν
[root@localhost ~ ]# cat /etc/os-release
NAME=" CentOS Stream"
VERSION=" 9"
ID=" centos"
ID_LIKE=" rhel fedora"
VERSION_ID=" 9"
PLATFORM_ID=" platform:el9"
PRETTY_NAME=" CentOS Stream 9"
ANSI_COLOR=" 0;31"
LOGO=" fedora-logo-icon"
CPE_NAME=" cpe:/o:centos:centos:9"
HOME_URL=" https://centos.org/"
BUG_REPORT_URL=" https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT=" Red Hat Enterprise Linux 9"
REDHAT_SUPPORT_PRODUCT_VERSION=" CentOS Stream"
μ무 μΈμμμ΄ hostnamectl
μ€ν μ > μμ€ν
μ νΈμ€νΈλͺ
, Chassis, Machine ID, Boot ID, κ°μν, 컀λ λ²μ λ±μ μ 보λ₯Ό μΆλ ₯
νΈμ€νΈλͺ
λ³κ²½ μ : set-hostname κ³Ό λ³κ²½ν νΈμ€νΈλͺ
μ μ
λ ₯ (hostnamectl set-hostname [λ³κ²½ν νΈμ€νΈλͺ
])
[root@localhost ~ ]# hostnamectl
Static hostname: (unset)
Transient hostname: localhost
Icon name: computer-desktop
Chassis: desktop π₯οΈ
Machine ID: aea36b66c60547078fd6d43ffc1a4736
Boot ID: afece10043164066a0a98a689a500628
Operating System: CentOS Stream 9
CPE OS Name: cpe:/o:centos:centos:9
Kernel: Linux 5.14.0-427.el9.x86_64
Architecture: x86-64
Hardware Vendor: Micro-Star International Co., Ltd.
Hardware Model: MS-7D22
Firmware Version: 1.30
[root@localhost ~ ]# fdisk -l
Disk /dev/nvme0n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 970 EVO Plus 500GB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3B8AB5CB-8566-4D97-AB1B-9596BE837479
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1230847 1228800 600M EFI System
/dev/nvme0n1p2 1230848 3327999 2097152 1G Linux filesystem
/dev/nvme0n1p3 3328000 976773119 973445120 464.2G Linux LVM
Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HDN724040AL
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 42B2D9E1-D9F9-4E97-A835-008CB7AC2269
Device Start End Sectors Size Type
/dev/sda1 2048 7814035455 7814033408 3.6T Microsoft basic data
Disk /dev/mapper/cs-root: 70 GiB, 75161927680 bytes, 146800640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/cs-swap: 15.65 GiB, 16806576128 bytes, 32825344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/cs-home: 378.52 GiB, 406432251904 bytes, 793812992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
λΈλ‘ μ₯μΉλ₯Ό λμ΄ : lsblk
-f
: λμ€ν¬μ λν μΆκ° μ 보 νμΈ κ°λ₯
Linux μ»΄ν¨ν°μ λμ€ν¬μ νν°μ
μ λ³Ό μ μμ
[root@localhost ~ ]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 3.6T 0 disk
ββsda1 8:1 0 3.6T 0 part
nvme0n1 259:0 0 465.8G 0 disk
ββnvme0n1p1 259:1 0 600M 0 part /boot/efi
ββnvme0n1p2 259:2 0 1G 0 part /boot
ββnvme0n1p3 259:3 0 464.2G 0 part
ββcs-root 253:0 0 70G 0 lvm /
ββcs-swap 253:1 0 15.7G 0 lvm [SWAP]
ββcs-home 253:2 0 378.5G 0 lvm /home
[root@localhost ~ ]# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
ββsda1 ntfs μ λ³Όλ₯¨ E4E8BF2DE8BEFD3C
nvme0n1
ββnvme0n1p1 vfat FAT32 933D-493E 591.3M 1% /boot/efi
ββnvme0n1p2 xfs b4540b96-808f-4545-8966-77d007090acf 654.4M 32% /boot
ββnvme0n1p3 LVM2_member LVM2 001 5JEvcU-09gj-HmWW-FznL-mQ7n-oKBq-je5vqM
ββcs-root xfs 9548f8c3-cb9a-4d44-918d-a24064024222 62.8G 10% /
ββcs-swap swap 1 e291fe33-1624-46e7-ac50-4a0d6548e92a [SWAP]
ββcs-home xfs 3d3e737e-3c9d-438e-ad4b-0a87558a061c 375.7G 1% /home
νλμ¨μ΄ μ 보 νμΈ : hwinfo
νλμ¨μ΄, νΉν μ μ₯ λμ€ν¬μ λν μ 보λ₯Ό 보λ λ° μ μ©
# λμ€ν¬ λλ ν΄λΉ νν°μ
μ λν μ 보
[root@localhost ~ ]# sudo hwinfo --disk
# λΈλ‘ μ₯μΉμ κ°μ
[root@localhost ~ ]# sudo hwinfo --short --block
# λͺ¨λ λμ€ν¬μ μμ½
[root@localhost ~ ]# sudo hwinfo --disk --short
Logical Volume μν : lvdisplay
LVM(Logical Volume Manager) : 물리μ νκ³μ μ μ½λ°μ§ μκ³ λμ€ν¬λ₯Ό ν¨μ¨μ μΌλ‘ λΆν νμ¬ μ¬μ© κ°λ₯
LV λ‘ λλ νν°μ
μ μ΅μ’
μ μΌλ‘ νμΌ μμ€ν
μ ν λΉλ°κ³ νΉμ λλ ν 리μ λ§μ΄νΈ λ μ μμ
[root@localhost ~ ]# lvdisplay
--- Logical volume ---
LV Path /dev/cs/swap
LV Name swap
VG Name cs
LV UUID 1PJ2Bq-YVVQ-bWwC-Mcc5-GXNG-may4-IzfLRw
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2024-03-15 09:41:23 +0900
LV Status available
# open 2
LV Size 15.65 GiB
Current LE 4007
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/cs/home
LV Name home
VG Name cs
LV UUID DNN5i1-x5Gy-j4jH-7nOd-n3sC-bg4n-pH1Y6K
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2024-03-15 09:41:23 +0900
LV Status available
# open 1
LV Size < 378.52 GiB
Current LE 96901
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/cs/root
LV Name root
VG Name cs
LV UUID Nbo7SF-68jP-2IsP-Sd4e-K4kt-vAXa-4baXqc
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2024-03-15 09:41:23 +0900
LV Status available
# open 1
LV Size 70.00 GiB
Current LE 17920
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
πΆ bash: hwinfo: command not found...
μλ λͺ
λ Ήμ΄λ‘ μ€μΉλΆν° μ§ν
sudo apt install hwinfo [On Debian, Ubuntu and Mint]
sudo yum install hwinfo [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
sudo emerge -a sys-apps/hwinfo [On Gentoo Linux]
sudo pacman -S hwinfo [On Arch Linux]
sudo zypper install hwinfo [On OpenSUSE]
πΆ μ μ₯ κ³΅κ° νμΈ
μ μ₯ κ³΅κ° νμΈ : df [μ΅μ
] [λλ ν 리 λλ λ§μ΄νΈ μ§μ ]
-h
: human-readable μ΅μ
μ μ¬μ©νλ©΄ μ©λμ 보기 μ¬μ΄ νμμΌλ‘ μΆλ ₯
λλ ν 리 λλ λ§μ΄νΈ μ§μ : νΉμ λλ ν 리λ λ§μ΄νΈ μ§μ μ νμΌ μμ€ν
μ λ³΄λ§ νμ
[root@localhost ~ ]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 6.2G 18M 6.2G 1% /run
/dev/mapper/cs-root 70G 7.2G 63G 11% /
/dev/nvme0n1p2 960M 306M 655M 32% /boot
/dev/mapper/cs-home 379G 2.7G 376G 1% /home
/dev/nvme0n1p1 599M 7.5M 592M 2% /boot/efi
Linux λ°μ€ν¬ν± μ»΄ν¨ν° > GUI(κ·Έλν½ μ¬μ©μ μΈν°νμ΄μ€) μ ν리μΌμ΄μ
> λμ€ν¬ λͺ©λ‘μ νμΈ κ°λ₯
μμ€ν
λ©λ΄ > λμ€ν¬ μ ν리μΌμ΄μ
κ²μ > λμ€ν¬μ ν΄λΉ νν°μ
μ νμΈ
2-3. νλλμ€ν¬ νν°μ
partedλ‘ νν°μ
ν
μ΄λΈ 보기 : parted /dev/sda1
[root@localhost ~ ]# parted /dev/sda1
GNU Parted 3.5
Using /dev/sda1
Welcome to GNU Parted! Type ' help' to view a list of commands.
(parted) print
Error: /dev/sda1: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/sda1: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:
(parted)
νν°μ
μν νμΈ : fdisk -l
Physical Volume κΉμ§ μμ±λ¨
[root@localhost ~ ]# fdisk -l /dev/sda1
Disk /dev/sda1: 3.64 TiB, 4000785104896 bytes, 7814033408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x73736572
[root@localhost ~ ]# vgcreate VG01 /dev/sda1
Physical volume " /dev/sda1" successfully created.
Volume group " VG01" successfully created
[root@localhost ~ ]# lvcreate --size 900GB --name lv01cargo VG01
Logical volume " lv01cargo" created.
[root@localhost ~ ]# lvcreate --size 900GB --name lv02cargo VG01
Logical volume " lv02cargo" created.
[root@localhost ~ ]# lvcreate --size 900GB --name lv01vm VG01
Logical volume " lv01vm" created.
[root@localhost ~ ]# lvcreate --size 900GB --name lv02vm VG01
Logical volume " lv02vm" created.
[root@localhost ~ ]#
[root@localhost ~ ]# vgdisplay VG01
--- Volume group ---
VG Name VG01
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size < 3.64 TiB
PE Size 4.00 MiB
Total PE 953861
Alloc PE / Size 921600 / < 3.52 TiB
Free PE / Size 32261 / < 126.02 GiB
VG UUID 1A8hCi-yvbQ-1IRg-yIkr-724H-LONA-7y2yVY
Volume ν λΉ κ³΅κ° νμΈ
[root@localhost ~ ]# pvs -a
PV VG Fmt Attr PSize PFree
/dev/nvme0n1p3 cs lvm2 a-- 464.17g 0
/dev/sda1 VG01 lvm2 a-- < 3.64t < 126.02g
[root@localhost ~ ]# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv01cargo VG01 -wi-a----- 900.00g
lv01vm VG01 -wi-a----- 900.00g
lv02cargo VG01 -wi-a----- 900.00g
lv02vm VG01 -wi-a----- 900.00g
home cs -wi-ao---- < 378.52g
root cs -wi-ao---- 70.00g
swap cs -wi-ao---- 15.65g
νμΌ μμ€ν
κ³Ό λ§μ΄νΈ
mkfs.xfs /dev/VG01/lv01cargo
, mkfs.xfs /dev/VG01/lv02cargo
, mkfs.xfs /dev/VG01/lv01vm
, mkfs.xfs /dev/VG01/lv02vm
[root@localhost ~ ]# mkfs.xfs /dev/VG01/lv01cargo
meta-data=/dev/VG01/lv01cargo isize=512 agcount=4, agsize=58982400 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1 nrext64=0
data = bsize=4096 blocks=235929600, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=115200, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
λλ ν 리 μμ± λ° λ§μ΄νΈ
[root@localhost ~ ]# mkdir /cargo1
[root@localhost ~ ]# mkdir /cargo2
[root@localhost ~ ]# mkdir /vm1
[root@localhost ~ ]# mkdir /vm2
[root@localhost ~ ]# mount /dev/VG01/lv01cargo /cargo1
[root@localhost ~ ]# mount /dev/VG01/lv02cargo /cargo2
[root@localhost ~ ]# mount /dev/VG01/lv01vm /vm1
[root@localhost ~ ]# mount /dev/VG01/lv02vm /vm2
λλ ν 리 ꡬμ±κ³Ό μ€μ μ¬μ©νλ νμΌμμ€ν
ν¬κΈ° νμΈ
[root@localhost ~ ]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 6.2G 18M 6.2G 1% /run
/dev/mapper/cs-root xfs 70G 7.2G 63G 11% /
/dev/nvme0n1p2 xfs 960M 306M 655M 32% /boot
/dev/mapper/cs-home xfs 379G 2.7G 376G 1% /home
/dev/nvme0n1p1 vfat 599M 7.5M 592M 2% /boot/efi
/dev/mapper/VG01-lv01cargo xfs 900G 6.4G 894G 1% /cargo1
/dev/mapper/VG01-lv02cargo xfs 900G 6.4G 894G 1% /cargo2
/dev/mapper/VG01-lv01vm xfs 900G 6.4G 894G 1% /vm1
/dev/mapper/VG01-lv02vm xfs 900G 6.4G 894G 1% /vm2
πΆ Partition does not start on physical sector boundary
μ°Έκ³ : Partition does not start on physical sector boundary
Partition 4 does not start on physical sector boundary.
: νν°μ
μ μμμ΄ μΉν°μ κ²½κ³μμ μμνμ§ μλλ€λ λ»
Sector size
> λ
Όλ¦¬μΉν° 512 bytesμ 물리μΉν° 4096 byteμ ν¬κΈ°κ° λ§μ§ μμ μκΈ°λ μ€λ₯
[root@localhost ~ ]# fdisk -l /dev/sd*
Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HDN724040AL
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 42B2D9E1-D9F9-4E97-A835-008CB7AC2269
Device Start End Sectors Size Type
/dev/sda1 2048 7814035455 7814033408 3.6T Microsoft basic data
Disk /dev/sda1: 3.64 TiB, 4000785104896 bytes, 7814033408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x73736572
Device Boot Start End Sectors Size Id Type
/dev/sda1p1 1920221984 3736432267 1816210284 866G 72 unknown
/dev/sda1p2 1936028192 3889681299 1953653108 931.6G 6c unknown
/dev/sda1p3 0 0 0 0B 0 Empty
/dev/sda1p4 27722122 27722568 447 223.5K 0 Empty
Partition 4 does not start on physical sector boundary.
Partition table entries are not in disk order.
μμ λ§μ΄νΈ λ¨κ³κΉμ§ μννκ³ λ€μ μ‘°νν΄λ³΄λ©΄ ν΄λΉ λ΄μ©μ λ¨μ§ μμ
λ€μμλ² λ° λλ©μΈ μ§μ μν μ ν΄μ£Όλ μ€μ νμΌ
νμ¬ λ€νΈμν¬λ μ°κ²°λμ΄ μμ§λ§ DNF(μλ) ν¨ν€μ§ μ€μΉ μ¦, μΈλΆ λλ©μΈ λ―Έλ¬ μ¬μ΄νΈλ₯Ό μ°ΎκΈ° μν΄ νΉμ ISP(μΈν°λ·μ μ 곡νλ κ°μΈμ΄λ κΈ°μ
)μ 미리 μ§μ ν΄μ£Όλ κ² μ’μ
resolv.conf
νμΌ μμ
nameserver
: λ΄κ° μ¬μ©ν λλ©μΈμλ² IP μ£Όμ (리λ
μ€λ μ΅λ 3κ°κΉμ§ μΈμ κ°λ₯)
search
: λλ©μΈ λͺ
μ μ§μ (λλΆλΆ νΈμ€νΈλͺ
κ³Ό λλ©μΈλͺ
μ ν¨κ» μ¬μ©νλ, νΉλ³νκ² νΈμ€νΈλͺ
λ§ μ¬μ©λμμ λ μ¬μ©νκ² λ κΈ°λ³Έ λλ©μΈ λͺ
)
[root@localhost ~ ]# vi /etc/resolv.conf
# Generated by NetworkManager
nameserver 210.94.0.73
nameserver 210.220.163.82
nameserver 192.168.1.999
search localdomain.com
Generated by NetworkManager
: λ€νΈμν¬λ₯Ό μ¬μμνλ©΄ NM(NetworkManager)μ μν΄ μ΄ νμΌμ΄ λ°λκΈ° λλ¬Έμ μ΄κΈ°ν λ μ μμ
λ€νΈμν¬λ₯Ό μ¬μμνκΈ° μ μ chattr +i /etc/resolv.conf
λͺ
λ Ήμ΄ μν
리λΆν
μμ resolv.conf
νμΌμ΄ μ΄κΈ°ν λλλ°, write(μ°κΈ°-νΈμ§)λ₯Ό λͺ»νκ² λ³΄νΈνλ λͺ
λ Ήμ΄
ν΄μ λ chattr -i /etc/resolv.conf
μ΄ν λ€νΈμν¬λ₯Ό μ¬μμνμ¬ μ μ© : systemctl restart network
λλ service network restart
μ¬μμ νμλ μ¬μ ν /etc/resolv.conf
νμΌμ΄ μ΄κΈ°ν λμ§ μκ³ μ΄μμλ κ² νμΈ
νμ¬ μ€μΉλμ΄μλ μ 체 ν¨ν€μ§μ 컀λμ μ
κ·Έλ μ΄λ
보μμ μν΄ νλ λΆλΆμΌλ‘ μ무κ²λ μ€μΉλμ΄ μμ§ μλ μνμμ νλ κ²μ κΆκ³
μ΄λ―Έ λμκ°κ³ μλ μλ²μμ νκ² λλ©΄ λΆν
μ€ν¨λ μ₯μ λ°μ κ°λ₯μ± μμ
μ€μΉκ° μλ£λ κ²½μ° μλ‘ μ€μΉλ κ²κ³Ό μ
λ°μ΄νΈν ν¨ν€μ§κ° 리μ€νΈμ λμ€κ² λ¨
[root@localhost ~ ]# dnf update
Last metadata expiration check: 2:16:12 ago on Wed 20 Mar 2024 03:20:24 PM KST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
kernel x86_64 5.14.0-430.el9 baseos 44 k
Upgrading:
NetworkManager x86_64 1:1.47.2-1.el9 baseos 2.3 M
# ########### (μ€λ΅) ############
Transaction Summary
=============================================================================================================================================================
Install 5 Packages
Upgrade 41 Packages
Total download size: 147 M
Is this ok [y/N]: y
Downloading Packages:
(1/46): kernel-5.14.0-430.el9.x86_64.rpm 0% [ ] --- B/s | 0 B --:-- ETA
# ########### (μ€λ΅) ############
(46/46): kernel-devel-5.14.0-430.el9.x86_64.rpm 973 kB/s | 16 MB 00:16
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 5.3 MB/s | 147 MB 00:27
CentOS Stream 9 - BaseOS 1.6 MB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : " CentOS (CentOS Official Signing Key) <[email protected] >"
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Running scriptlet: selinux-policy-targeted-38.1.35-2.el9.noarch 1/1
Preparing : 1/1
Upgrading : selinux-policy-38.1.35-2.el9.noarch 1/87
Running scriptlet: selinux-policy-38.1.35-2.el9.noarch 1/87
Running scriptlet: container-selinux-3:2.230.0-1.el9.noarch 87/87
Running scriptlet: tzdata-2024a-1.el9.noarch 87/87
πΆ selinux λΉνμ±ν
μΌμ’
μ 보μμ μ±
μΌλ‘ λͺ¨λ νλ‘μΈμ€λ νΉμ κ°μ²΄μ λνμ¬ κ΄λ¦¬ κ·μ μ μ§μ μ μμ
κΈ°λ³Έμ μΌλ‘ νμ±(enforcing)λμ΄ μμ > μλ² μ΄μ μ€ λ€νΈμν¬ λ°©νλ²½ λ° νΉμ νλ‘μΈμ€κ° λ§νκ±°λ ꡬλμ΄ λμ§ μλ μν©μ΄ λ°μν μ μμ
λΉνμ±(disabled) μ μ© ν μ¬λΆν
νμ¬ λ°©μ§ν μ μμ
[root@localhost ~ ]# vi /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# SELINUX=enforcing
SELINUX=disabled
πΆ IPTABLES λ°©νλ²½ μ¬μ© (π«Firewall μ¬μ© μμλ μλ΅)
CentOS 7λΆν°λ iptables
λ₯Ό μ¬μ©νμ§ μκ³ Firewall
λ°©μμ λμ
λλ¬Έμ /etc/sysconfig/iptables
νμΌμ΄ μ‘΄μ¬νμ§ μμ
κΈ°μ‘΄ iptables
λ₯Ό μ¬μ©νλ κ²½μ°μλ§ μλ λ΄μ© μ§ν
systemd κΈ°λ°μΌλ‘ μλλκΈ° λλ¬Έμ systemctl λͺ
λ Ήμ΄ μ΄μ©ν΄μΌ ν¨
[root@localhost ~ ]# systemctl stop firewalld [Firewalld λ°©νλ²½ μ€μ§]
[root@localhost ~ ]# systemctl mask firewalld [Firewalld μλμ€ν μ€μ§]
[root@localhost ~ ]# yum install -y iptables-services [iptables μλΉμ€ κ΄λ ¨ ν¨ν€μ§ μ€μΉ]
[root@localhost ~ ]# systemctl enable iptables [iptablesκΈ°λ³Έ μ¬μ© μ€μ ]
[root@localhost ~ ]# systemctl start iptables [iptablesμλΉμ€ μμ]
[root@localhost ~ ]# iptables -nL [μλ νμΈ]
[root@localhost ~ ]# /etc/sysconfig/iptables [μ€μ νμΌ μμΉ]
2-5. CentOS ν¨ν€μ§ νμ₯
[root@localhost /]# yum repolist
repo id repo name
appstream CentOS Stream 9 - AppStream
baseos CentOS Stream 9 - BaseOS
epel Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264 Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
epel-next Extra Packages for Enterprise Linux 9 - Next - x86_64
extras-common CentOS Stream 9 - Extras packages
Docker λμ Podman μ€μΉ (RedHat κΈ°μ€)
ν¨ν€μ§ νμ₯μ μν΄ HDD νν°μ
μμ
μ ν > LVM μΌλ‘ 컨ν
μ΄λ, VM, DB κ³΅κ° ν보
/vm1 : ν
μ€νΈμ© κ°μ λ¨Έμ μ€μΉ
/vm2 : 컨ν
μ΄λ μ€μΉ
/cargo1, /cargo2 : DBMS μ¬μ©μ ν
μ΄λΈ 곡κ°
λ¨μμλ 곡κ°μ μ¬λΆλ°°
3. μ격 λ°μ€ν¬ν± μ°κ²°
3-1. xrdpλ₯Ό ν΅ν΄ μ격 λ°μ€ν¬ν± μ°κ²° (Windows -> CentOS)
μ°Έκ³ : μ격 λ°μ€ν¬ν±μΌλ‘ μ°κ²°νλ λ°©λ² / firewall-cmd λͺ
λ Ήμ΄λ‘ λ°©νλ²½ κ΄λ¦¬νκΈ°
RDP(Remote Desktop Protocol, μ격 λ°μ€ν¬ν± νλ‘ν μ½)
ν°λ―Έλ μλ²μ ν°λ―Έλ μλ² ν΄λΌμ΄μΈνΈ κ°μ ν΅μ μ μ¬μ©
TCP λ΄μμ μΊ‘μνλκ³ μνΈνλμ΄ μ 보 μ λ¬
xrdp
리λ
μ€ μμ€ν
μμ μ격 λ°μ€ν¬ν± μ μμ μ 곡νλ μ€ν μμ€ νλ‘μ νΈ (리λ
μ€ μλ²λ₯Ό μ격μΌλ‘ κ΄λ¦¬ν λ μ¬μ©)
xrdpλ RDPλ₯Ό μ¬μ©νμ¬ μ격 ν΄λΌμ΄μΈνΈκ° 리λ
μ€ μμ€ν
μ μ μνμ¬ GUIλ₯Ό μ¬μ©ν μ μλλ‘ ν¨
πΆ κΈ°λ³Έ νκ²½ μ€μΉ
# μ
κ·Έλ μ΄λ
[root@localhost ~ ]# yum update
Last metadata expiration check: 3:32:45 ago on Thu 21 Mar 2024 05:35:46 AM KST.
Dependencies resolved.
Nothing to do.
Complete!
[root@localhost ~ ]# yum upgrade
Last metadata expiration check: 3:32:52 ago on Thu 21 Mar 2024 05:35:46 AM KST.
Dependencies resolved.
Nothing to do.
Complete!
# epel repository μ€μΉ
$ yum install -y epel-release
Last metadata expiration check: 3:32:59 ago on Thu 21 Mar 2024 05:35:46 AM KST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
epel-release noarch 9-7.el9 extras-common 19 k
Installing weak dependencies:
epel-next-release noarch 9-7.el9 extras-common 8.1 k
# ########### (μ€λ΅) ############
Complete!
# xrdp λ° tigervnc μ€μΉ
$ yum install -y xrdp tigervnc-server
Extra Packages for Enterprise Linux 9 - x86_64 6.0 MB/s | 21 MB 00:03
Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64 335 B/s | 2.5 kB 00:07
Extra Packages for Enterprise Linux 9 - Next - x86_64 487 kB/s | 1.4 MB 00:02
Last metadata expiration check: 0:00:01 ago on Thu 21 Mar 2024 09:09:15 AM KST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
tigervnc-server x86_64 1.13.1-8.el9 appstream 224 k
xrdp x86_64 1:0.9.24-1.el9 epel 459 k
# ########### (μ€λ΅) ############
Complete!
πΆ 3389 Port μμ νμ©
λ°©νλ²½μ 3389 Portλ₯Ό μμ νμ©μΌλ‘ λ±λ‘ λ° μ¬μ€ν
[root@localhost ~ ]# sudo firewall-cmd --permanent --zone=public --add-port=3389/tcp
success
[root@localhost ~ ]# sudo firewall-cmd --reload
success
[root@localhost ~ ]# sudo firewall-cmd --list-port
3389/tcp
πΆ xrdp μλΉμ€ λ±λ‘ λ° κ΅¬λ νμΈ
[root@localhost ~ ]# sudo systemctl enable xrdp.service
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp.service β /usr/lib/systemd/system/xrdp.service.
[root@localhost ~ ]# sudo systemctl start xrdp.service
[root@localhost ~ ]# systemctl status xrdp.service
β xrdp.service - xrdp daemon
Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; preset: disabled)
Active: active (running) since Thu 2024-03-21 09:41:57 KST; 6s ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Main PID: 345161 (xrdp)
Tasks: 1 (limit: 202223)
Memory: 1.0M
CPU: 4ms
CGroup: /system.slice/xrdp.service
ββ345161 /usr/sbin/xrdp --nodaemon
Mar 21 09:41:57 localhost.localdomain systemd[1]: Started xrdp daemon.
Mar 21 09:41:57 localhost.localdomain xrdp[345161]: [INFO ] starting xrdp with pid 345161
Mar 21 09:41:57 localhost.localdomain xrdp[345161]: [INFO ] address [0.0.0.0] port [3389] mode 1
Mar 21 09:41:57 localhost.localdomain xrdp[345161]: [INFO ] listening to port 3389 on 0.0.0.0
Mar 21 09:41:57 localhost.localdomain xrdp[345161]: [INFO ] xrdp_listen_pp done
πΆ ν¬νΈ μν λ° μ μν IP νμΈ
3389 ν¬νΈ μν νμΈ
[root@localhost ~ ]# netstat -nap | grep 3389
tcp6 0 0 :::3389 :::* LISTEN 345161/xrdp
[root@localhost ~ ]# ifconfig
eno1: flags=4163< UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.999 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::dabb:c1ff:fe4d:c443 prefixlen 64 scopeid 0x20< link>
ether d8:bb:c1:4d:c4:43 txqueuelen 1000 (Ethernet)
RX packets 1140040 bytes 860949800 (821.0 MiB)
RX errors 0 dropped 110087 overruns 0 frame 0
TX packets 201157 bytes 16165519 (15.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xa1200000-a1220000
lo: flags=73< UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10< host>
loop txqueuelen 1000 (Local Loopback)
RX packets 65 bytes 5351 (5.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 65 bytes 5351 (5.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
πΆ firewall public zone μν νμΈ
[root@localhost ~ ]# sudo firewall-cmd --zone=public --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eno1
sources:
services: cockpit dhcpv6-client ssh
ports: 3389/tcp
protocols:
forward: yes
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
3-2. Windows μμ CentOS μ격 μ°κ²°
μμ > μ격 λ°μ€ν¬ν± μ°κ²° > 192.168.1.999
μ¬μ©μ μ΄λ¦
λ±λ‘νμ§ μκ³ λ°λ‘ μ°κ²°ν κ²
root κ³μ μ μμ μλλλ‘ μ€μ λμ΄ μμ
μλ λ΄μ© μνν΄λ λμ§ μμμ 보λ₯
πΆ root κ³μ μ μ νμ©/ν΄μ
sshd_config
νμΌμ μμ
[root@localhost ssh]# cd /etc/ssh/
[root@localhost ssh]# vi sshd_config
PermitRootLogin
: root κ³μ μΌλ‘ λ‘κ·ΈμΈ μ νμ© μ¬λΆλ₯Ό μ€μ νλ κ°
(...)
# Authentication:
# LoginGraceTime 2m
# PermitRootLogin prohibit-password
PermitRootLogin yes
# StrictModes yes
# MaxAuthTries 6
# MaxSessions 10
(...)
PermitRootLogin
μ€μ κ°μ λ³κ²½ νμλ λ°λ‘ root κ³μ λ‘κ·ΈμΈ μ νμ΄ λμ§ μμ
μ ν μ€μ μ μ μ©νκΈ° μν΄μλ sshdλ₯Ό μ¬μμ
[root@localhost ssh]# service sshd restart
3-3. μλ² μ£Όμ μλ λ³κ²½
μ€μΉ μ μλμΌλ‘ ν λΉ λ°μ μ£Όμλ₯Ό μλμΌλ‘ μ¬μ§μ
μ격 λ°μ€ν¬ν± > μλ¨ λ€νΈμν¬ μμ΄μ½ > Settings
Network > Wired > Connected - 100 Mb/s
μΌκΈ° λ° μ€μ λ²νΌ ν΄λ¦
IPv4
ν ν΄λ¦νμ¬ κ³ μ IP μ€μ
IPv4 Method : Manual (μλ)
Address : μ£Όμ, λ·λ§μ€ν¬, κ²μ΄νΈμ¨μ΄ μ£Όμ μ
λ ₯ (192.168.1.999
, 255.255.255.0
, 192.168.1.1
)
DNS > Automatic ν΄μ
DNS : 210.94.0.73, 210.220.163.82
(μ¬λ¬ κ°μ DNSλ₯Ό μ
λ ₯ν κ²½μ° μΌνλ‘ κ΅¬λΆ)
[root@localhost ~ ]# vi /etc/resolv.conf
nameserver 210.94.0.73
nameserver 210.220.163.82
μλ¨μ μ μ© λ²νΌ ν΄λ¦ (ν°λ―Έλμ systemctl restart network
μ λμΌν ν¨κ³Ό)
4-1. RHEL 9, Cockpit μΉ μ½μ μ€μ
κ°μλ¨Έμ μ κ΄λ¦¬νκΈ° μν μΉ μ½μ κ°μλ¨Έμ νλ¬κ·ΈμΈ μ€μΉ
μΉ μ½μμ΄ μμ€ν
μ μ€μΉλμ΄ νμ±νλμ΄ μλμ§ νμΈ
[root@localhost /]# systemctl status cockpit.socket
β cockpit.socket - Cockpit Web Service Socket
Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; disabled; preset: disabled)
Active: inactive (dead)
Triggers: β cockpit.service
Docs: man:cockpit-ws(8)
Listen: [::]:9090 (Stream)
cockpit-machines
νλ¬κ·ΈμΈμ μ€μΉ
[root@localhost /]# dnf install cockpit-machines
Last metadata expiration check: 1:33:14 ago on Thu 21 Mar 2024 12:44:55 PM KST.
Dependencies resolved.
============================================================================================================================================================
Package Architecture Version Repository Size
============================================================================================================================================================
Installing:
cockpit-machines noarch 308-1.el9 appstream 1.1 M
# ########### (μ€λ΅) ############
Total download size: 37 M
Installed size: 153 M
Is this ok [y/N]: y
# ########### (μ€λ΅) ############
Complete!
[root@localhost /]# systemctl enable cockpit.socket
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket β /usr/lib/systemd/system/cockpit.socket.
[root@localhost /]# systemctl start cockpit.socket
πΆ μΉ μ½μμ μ‘μΈμ€
μ°Έκ³ : CentOS/RHEL 8μ KVMμ μ€μΉνλ λ°©λ²
KVM(컀λ κΈ°λ° κ°μ λ¨Έμ ) : Linuxμ κΈ΄λ°νκ² ν΅ν©λ μ€ν μμ€μ΄μ μ¬μ€μμ νμ€ κ°μν μ루μ
https://localhost:9090 μ λ‘κ·ΈμΈ
Unable to connect - Firefox canβt establish a connection to the server at localhost:9090.
Windows > https://192.168.1.999:9090/
λ‘ μ μνμ¬ νμΈ
μ νλ μ κ·Ό ν΄μ > μνΈ μ
λ ₯ ν μΈμ¦ λ²νΌ ν΄λ¦ > κ΄λ¦¬ μ‘μΈμ€ λͺ¨λλ‘ λ°λ
libvirt Hypervisor λλΌμ΄λ²λ₯Ό μ€ννλλ‘ μ€μ λμ΄ μλμ§ νμΈ
[root@localhost /]# virt-host-validate
QEMU: Checking for hardware virtualization : PASS
QEMU: Checking if device /dev/kvm exists : PASS
QEMU: Checking if device /dev/kvm is accessible : PASS
QEMU: Checking if device /dev/vhost-net exists : PASS
QEMU: Checking if device /dev/net/tun exists : PASS
QEMU: Checking for cgroup ' cpu' controller support : PASS
QEMU: Checking for cgroup ' cpuacct' controller support : PASS
QEMU: Checking for cgroup ' cpuset' controller support : PASS
QEMU: Checking for cgroup ' memory' controller support : PASS
QEMU: Checking for cgroup ' devices' controller support : PASS
QEMU: Checking for cgroup ' blkio' controller support : PASS
QEMU: Checking for device assignment IOMMU support : WARN (No ACPI DMAR table found, IOMMU either disabled in BIOS or not supported by this hardware platform)
QEMU: Checking for secure guest support : WARN (Unknown if this platform has Secure Guest support)
kvm λͺ¨λμ΄ μ»€λμ λ‘λλμλμ§ νμΈ
[root@localhost /]# lsmod | grep kvm
kvm_intel 442368 0
kvm 1335296 1 kvm_intel
irqbypass 16384 1 kvm
λ°©νλ²½ μνλ cockpit κΉμ§ μ΄λ €μμ (λ§μ½ μΈλΆ μ μμ΄ νμ©λμ΄ μμ§ μλ€λ©΄, λ°©νλ²½μ cockpit μλΉμ€ μΆκ°)
[root@localhost /]# firewall-cmd --add-service=cockpit --permanent
Warning: ALREADY_ENABLED: cockpit
success
[root@localhost /]# firewall-cmd --reload
success
https://192.168.1.999:9090/
λ‘ μ μνμ¬ νμΈ
root κ³μ μ μμ΄ μλμ΄, μ¬μ©μ κ³μ μΌλ‘ λ‘κ·ΈμΈ ν¨
CentOS 8 λ²μ λΆν° Docker λμ Podman μ΄ κΈ°λ³Έ Container API μ
Centosμ Podman μ€μΉνκΈ° - Podman 컨ν
μ΄λ κΈ°μ΄
Windows > https://192.168.1.999:9090/
λ‘ μ μ
μ’μΈ‘ λͺ©λ‘μμ Podman Container ν΄λ¦
'ν¬λ맨 μλΉμ€κ° λμνμ§ μμ΅λλ€.' > λΆνΈ μ μλμΌλ‘ podman μμ
ν΄λ¦
5-1. Podman νκ²½ ꡬμ±
[root@localhost /]# view /etc/containers/registries.conf
unqualified-search-registries = [" registry.access.redhat.com" , " registry.redhat.io" , " docker.io" ]
# ########### (μ€λ΅) ############
insecure = false
blocked = false // νμμ λ°λΌ μ°¨λ¨ λ±λ‘μ νλ€
νμ¬ redhat κ³μ μ μμΌλ―λ‘ μ€μ λ‘ pulling ν μ μμ (docker.io λ§ κ°λ₯ν¨)
repoμμ μ ν©ν mysql μ°Ύμ보기
πΆ Podman κΈ°λ³Έ μ 보
λ²μ λ° μ€μΉ νκ²½ μ 보 νμΈ
[root@localhost system-connections]# podman -v
podman version 4.9.3-dev
[root@localhost system-connections]# podman info
kernel: 5.14.0-430.el9.x86_64
remoteSocket:
exists: false
path: /run/podman/podman.sock
store:
configFile: /etc/containers/storage.conf
graphRoot: /var/lib/containers/storage
imageCopyTmpDir: /var/tmp
runRoot: /run/containers/storage
volumePath: /var/lib/containers/storage/volumes
version:
APIVersion: 4.9.3-dev
Built: 1707216158
BuiltTime: Tue Feb 6 19:42:38 2024
GitCommit: " "
GoVersion: go1.21.3
Os: linux
OsArch: linux/amd64
Version: 4.9.3-dev
πΆ podman-compose λ²μ
podman-compose μ€μΉ λ° λ²μ νμΈ
[root@localhost ~ ]# podman-compose version
bash: podman-compose: command not found...
Install package ' podman-compose' to provide command ' podman-compose' ? [N/y] y
* Waiting in queue...
* Loading list of packages....
The following packages have to be installed:
gvisor-tap-vsock-6:0.7.3-2.el9.x86_64 Go replacement for libslirp and VPNKit
podman-compose-1.0.6-3.el9.noarch Run docker-compose.yml using podman
podman-plugins-2:5.0.0-1.el9.x86_64 Plugins for podman
python3-click-8.0.3-1.el9.noarch Simple wrapper around optparse for powerful command line utilities
python3-dotenv-0.19.2-3.el9.noarch Read key-value pairs from a .env file and set them as environment variables
python3-dotenv+cli-0.19.2-3.el9.noarch Metapackage for python3-dotenv: cli extras
Proceed with changes? [N/y] y
* Waiting in queue...
* Waiting for authentication...
* Waiting in queue...
* Downloading packages...
* Requesting data...
* Testing changes...
* Installing packages...
podman-compose version: 1.0.6
[' podman' , ' --version' , ' ' ]
using podman version: 4.9.4-dev
podman-compose version 1.0.6
podman --version
podman version 4.9.4-dev
exit code: 0
[root@localhost ~ ]# podman-compose version
podman-compose version: 1.0.6
[' podman' , ' --version' , ' ' ]
using podman version: 4.9.4-dev
podman-compose version 1.0.6
podman --version
podman version 4.9.4-dev
exit code: 0
νμ¬ Java λ μ΄λ―Έ μ€μΉλμ΄ μμ
11 λ€μ΄λ‘λ λͺ
λ Ήμ΄ : yum install java-11-openjdk-devel.x86_64
1.8.0 λ€μ΄λ‘λ λͺ
λ Ήμ΄ : yum install java-1.8.0-openjdk-devel.x86_64
[root@localhost /]# java -version
openjdk version " 1.8.0_362"
OpenJDK Runtime Environment (build 1.8.0_362-b08)
OpenJDK 64-Bit Server VM (build 25.362-b08, mixed mode)
yum ν¨ν€μ§ νμΈνκΈ°
[root@localhost /]# yum search openjdk
Last metadata expiration check: 2:28:07 ago on Thu 21 Mar 2024 12:44:55 PM KST.
============================================================= Name & Summary Matched: openjdk ==============================================================
java-1.8.0-openjdk.x86_64 : OpenJDK 8 Runtime Environment
java-1.8.0-openjdk-demo.x86_64 : OpenJDK 8 Demos
# ########### (μ€λ΅) ############
[root@localhost /]# readlink -f /usr/bin/java
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre/bin/java
6-1. JAVA_HOME νκ²½λ³μ
CentOS μμλ /etc/profile.d
ν΄λμ custom.sh
νμΌλ‘ κ°λ³ μ€μ μ λ§λ€λλ‘ κΆκ³
/etc/profile
μ μ§μ μμ νλ λ°©μ보λ€λ λͺ©μ μ λ°λΌ
[root@localhost ~ ]# export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
.bash_profile
μλ§ μ μ©
[root@localhost ~ ]# env | grep JAVA
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre/
[root@localhost ~ ]# ls /usr/lib/jvm
java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64 jre-1.8.0 jre-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64
jre jre-1.8.0-openjdk jre-openjdk
πΆ Java λ²μ λ³κ²½ μ
[root@localhost ~ ]# alternatives --config java
There is 1 program that provides ' java' .
Selection Command
-----------------------------------------------
* + 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre/bin/java)
Enter to keep the current selection[+], or type selection number: 1
JAVA_HOME μ source λ‘ κ΅¬λνκ±°λ μ¬λ‘κ·ΈμΈμ ν΄μΌ λ³κ²½λ¨
[root@localhost ~ ]# source .bash_profile
# νκ²½λ³μ λ³κ²½λ λ΄μ© νμΈ
[root@localhost ~ ]# env | grep JAVA
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre/
alternatives μ¬λ³Όλ¦ λ§ν¬ μμ± μν νμΈ
[root@localhost ~ ]# ls -l /etc/alternatives/jre*
lrwxrwxrwx. 1 root root 62 Mar 15 09:48 /etc/alternatives/jre -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre
lrwxrwxrwx. 1 root root 62 Mar 15 09:48 /etc/alternatives/jre_1.8.0 -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre
lrwxrwxrwx. 1 root root 57 Mar 15 09:48 /etc/alternatives/jre_1.8.0_openjdk -> /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64
lrwxrwxrwx. 1 root root 62 Mar 15 09:48 /etc/alternatives/jre_openjdk -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre
CentOS μμ ν¨ν€μ§ μ€μΉλ κ°λ₯ν dnf λ₯Ό μ¬μ©
ProjYj 2022 μμ λͺ¨λ ν
μ€νΈκ° μλ£λλ©΄ Podman image λ‘ μμ±
μ°λΆν¬ 22 my8 νκ²½ λ§λ€κΈ°.hwp
μ°Έκ³
MySQL κ³΅ν΅ PW : password$$ (κΈ°λ³Έ μ€μ > μλ¬Έμ ꡬμ±λ νμ©)
7-1. MySQL μ€μΉ νμΌ λ€μ΄λ‘λ
/home/projyj/Downloads
κ²½λ‘μ μΈν
> μΉ μ½μμμ λ€μ΄λ‘λνκ±°λ, Windows λ€μ΄λ‘λ ν FileZilla μ΄μ©
http://repo.mysql.com/yum/mysql-8.0-community/ > el/9/x86_64
λͺ©λ‘
mysql80-community-release-el9-1.noarch.rpm
λ€μ΄λ‘λ
mysql-community-server-8.0.32-1.el9.x86_64.rpm
λ€μ΄λ‘λ
[root@localhost Downloads]$ ll
total 50304
-rw-r--r--. 1 root root 10534 Mar 22 10:23 mysql80-community-release-el9-1.noarch.rpm
-rw-r--r--. 1 root root 51495202 Mar 22 09:59 mysql-community-server-8.0.32-1.el9.x86_64.rpm
πΆ MySQL Yum Repository
[root@localhost Downloads]$ sudo rpm -Uvh mysql80-community-release-el9-1.noarch.rpm
warning: mysql80-community-release-el9-1.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Verifying... # ################################ [100%]
Preparing... # ################################ [100%]
Updating / installing...
1:mysql80-community-release-el9-1 # ################################ [100%]
[root@localhost Downloads]$ rpm -Uvh mysql-community-server-8.0.32-1.el9.x86_64.rpm
warning: mysql-community-server-8.0.32-1.el9.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
mysql-community-client(x86-64) > = 8.0.11 is needed by mysql-community-server-8.0.32-1.el9.x86_64
mysql-community-common(x86-64) = 8.0.32-1.el9 is needed by mysql-community-server-8.0.32-1.el9.x86_64
mysql-community-icu-data-files = 8.0.32-1.el9 is needed by mysql-community-server-8.0.32-1.el9.x86_64
μ€μΉ μν νμΈ
mysql-community-server-8.0.32-1.el9.x86_64.rpm
κ° μ€μΉ μ€ν¨ν¨
μ΄ν dnf install
μ±κ³΅ μμλ κ²°κ³Όκ° λμΌν΄μ μΌλ¨ 보λ₯
[root@localhost Downloads]$ rpm -qi mysql-community-server-8.0.32-1.el9.x86_64.rpm
warning: mysql-community-server-8.0.32-1.el9.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Name : mysql-community-server
Version : 8.0.32
Release : 1.el9
Architecture: x86_64
Install Date: (not installed)
Group : Applications/Databases
Size : 246795859
License : Copyright (c) 2000, 2022, Oracle and/or its affiliates. Under GPLv2 license as shown in the Description field.
Signature : RSA/SHA256, Sat 17 Dec 2022 09:25:25 PM KST, Key ID 467b942d3a79bd29
Source RPM : mysql-community-8.0.32-1.el9.src.rpm
Build Date : Sat 17 Dec 2022 01:08:25 AM KST
Build Host : pb2-el9-01.regionaliad02.mysql2iad.oraclevcn.com
Packager : MySQL Release Engineering < [email protected] >
Vendor : Oracle and/or its affiliates
URL : http://www.mysql.com/
Summary : A very fast and reliable SQL database server
Description :
# ########### (μ€λ΅) ############
dnf
λ‘ μ€μΉνκΈ°
sudo dnf remove
: μ€μΉλ ν¨ν€μ§ μ κ±°νκΈ°
[root@localhost Downloads]$ sudo dnf install mysql-community-server-8.0.32-1.el9.x86_64.rpm
[sudo] password for root:
Last metadata expiration check: 2:39:58 ago on Fri 22 Mar 2024 12:28:45 PM KST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
mysql-community-server x86_64 8.0.32-1.el9 @commandline 49 M
replacing mariadb-connector-c-config.noarch 3.2.6-1.el9
Installing dependencies:
mysql-community-client x86_64 8.0.36-1.el9 mysql80-community 3.4 M
mysql-community-client-plugins x86_64 8.0.36-1.el9 mysql80-community 1.4 M
mysql-community-common x86_64 8.0.32-1.el9 mysql80-community 544 k
mysql-community-icu-data-files x86_64 8.0.32-1.el9 mysql80-community 2.2 M
mysql-community-libs x86_64 8.0.36-1.el9 mysql80-community 1.4 M
Transaction Summary
=============================================================================================================================================================
Install 6 Packages
Total size: 58 M
Total download size: 8.9 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): mysql-community-common-8.0.32-1.el9.x86_64.rpm 1.8 MB/s | 544 kB 00:00
(2/5): mysql-community-client-plugins-8.0.36-1.el9.x86_64.rpm 2.4 MB/s | 1.4 MB 00:00
(3/5): mysql-community-client-8.0.36-1.el9.x86_64.rpm 3.5 MB/s | 3.4 MB 00:00
(4/5): mysql-community-libs-8.0.36-1.el9.x86_64.rpm 3.4 MB/s | 1.4 MB 00:00
(5/5): mysql-community-icu-data-files-8.0.32-1.el9.x86_64.rpm 2.9 MB/s | 2.2 MB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 8.4 MB/s | 8.9 MB 00:01
MySQL 8.0 Community Server 3.0 MB/s | 3.1 kB 00:00
Importing GPG key 0x3A79BD29:
Userid : " MySQL Release Engineering <[email protected] >"
Fingerprint: 859B E8D7 C586 F538 430B 19C2 467B 942D 3A79 BD29
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Is this ok [y/N]: y
Key imported successfully
Import of key(s) didn' t help, wrong key(s)?
Public key for mysql-community-client-8.0.36-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-client-8.0.36-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-client-plugins-8.0.36-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-client-plugins-8.0.36-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-libs-8.0.36-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-libs-8.0.36-1.el9.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing ' dnf clean packages' .
Error: GPG check FAILED
πΆ Error: GPG check FAILED
dnf install
μ§ν μ μ€λ₯ λ°μ
μμΈ : GPG-KEY μΈμ¦μ΄ λκ³ μμ§ μμκΈ° λλ¬Έ
μΈμ¦μ μν΄μ rpm μ key λ₯Ό import μν΄
[root@localhost rpm-gpg]$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[sudo] password for root:
[root@localhost Downloads]$ sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
# μλ νλ€κ° λ€μ 2022 λ‘ λλ Έμ (νΉμ μν₯μ΄ μμκΉλ΄ κΈ°μ¬)
[root@localhost Downloads]$ sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
μμ λ΄μ©μ μννκ³ λ€μ dnf install
μ§νν΄λ μ€λ₯ λ°μ
dnf check-update
μν
[root@localhost Downloads]$ dnf check-update
CentOS Stream 9 - BaseOS 1.1 MB/s | 8.0 MB 00:07
CentOS Stream 9 - AppStream 2.6 MB/s | 19 MB 00:07
CentOS Stream 9 - Extras packages 2.3 kB/s | 16 kB 00:06
Extra Packages for Enterprise Linux 9 - x86_64 4.2 MB/s | 21 MB 00:04
Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64 463 B/s | 2.5 kB 00:05
Extra Packages for Enterprise Linux 9 - Next - x86_64 453 kB/s | 1.4 MB 00:03
MySQL 8.0 Community Server 3.2 MB/s | 1.4 MB 00:00
MySQL Connectors Community 227 kB/s | 45 kB 00:00
MySQL Tools Community 1.6 MB/s | 536 kB 00:00
mysql80-community-release.noarch el9-5 mysql80-community
xrdp.x86_64 1:0.9.25-2.el9 epel
xrdp-selinux.x86_64 1:0.9.25-2.el9 epel
Obsoleting Packages
mysql-community-server.x86_64 8.0.30-1.el9 mysql80-community
# ########### (μ€λ΅) ############
πΆ dnf install μ¬μ€ν
[root@localhost Downloads]$ sudo dnf install mysql-community-server-8.0.32-1.el9.x86_64.rpm
Last metadata expiration check: 3:13:05 ago on Fri 22 Mar 2024 12:28:45 PM KST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
mysql-community-server x86_64 8.0.32-1.el9 @commandline 49 M
replacing mariadb-connector-c-config.noarch 3.2.6-1.el9
Installing dependencies:
mysql-community-client x86_64 8.0.36-1.el9 mysql80-community 3.4 M
mysql-community-client-plugins x86_64 8.0.36-1.el9 mysql80-community 1.4 M
mysql-community-common x86_64 8.0.32-1.el9 mysql80-community 544 k
mysql-community-icu-data-files x86_64 8.0.32-1.el9 mysql80-community 2.2 M
mysql-community-libs x86_64 8.0.36-1.el9 mysql80-community 1.4 M
Transaction Summary
=============================================================================================================================================================
Install 6 Packages
Total size: 58 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] mysql-community-client-8.0.36-1.el9.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-client-plugins-8.0.36-1.el9.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-common-8.0.32-1.el9.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-icu-data-files-8.0.32-1.el9.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-libs-8.0.36-1.el9.x86_64.rpm: Already downloaded
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mysql-community-common-8.0.32-1.el9.x86_64 1/7
Installing : mysql-community-client-plugins-8.0.36-1.el9.x86_64 2/7
Installing : mysql-community-libs-8.0.36-1.el9.x86_64 3/7
Running scriptlet: mysql-community-libs-8.0.36-1.el9.x86_64 3/7
Installing : mysql-community-client-8.0.36-1.el9.x86_64 4/7
Installing : mysql-community-icu-data-files-8.0.32-1.el9.x86_64 5/7
Running scriptlet: mysql-community-server-8.0.32-1.el9.x86_64 6/7
Installing : mysql-community-server-8.0.32-1.el9.x86_64 6/7
Running scriptlet: mysql-community-server-8.0.32-1.el9.x86_64 6/7
Obsoleting : mariadb-connector-c-config-3.2.6-1.el9.noarch 7/7
Running scriptlet: mariadb-connector-c-config-3.2.6-1.el9.noarch 7/7
Verifying : mysql-community-client-8.0.36-1.el9.x86_64 1/7
Verifying : mysql-community-client-plugins-8.0.36-1.el9.x86_64 2/7
Verifying : mysql-community-common-8.0.32-1.el9.x86_64 3/7
Verifying : mysql-community-icu-data-files-8.0.32-1.el9.x86_64 4/7
Verifying : mysql-community-libs-8.0.36-1.el9.x86_64 5/7
Verifying : mysql-community-server-8.0.32-1.el9.x86_64 6/7
Verifying : mariadb-connector-c-config-3.2.6-1.el9.noarch 7/7
Installed:
mysql-community-client-8.0.36-1.el9.x86_64 mysql-community-client-plugins-8.0.36-1.el9.x86_64 mysql-community-common-8.0.32-1.el9.x86_64
mysql-community-icu-data-files-8.0.32-1.el9.x86_64 mysql-community-libs-8.0.36-1.el9.x86_64 mysql-community-server-8.0.32-1.el9.x86_64
Complete!
νμ±ν λ° λΉνμ±νλ MySQL 리ν¬μ§ν 리λ₯Ό λͺ¨λ λμ΄
[root@localhost Downloads]$ dnf repolist all | grep mysql
mysql-cluster-8.0-community MySQL Cluster 8.0 Community disabled
mysql-cluster-8.0-community-debuginfo MySQL Cluster 8.0 Community - Deb disabled
mysql-cluster-8.0-community-source MySQL Cluster 8.0 Community - Sou disabled
mysql-connectors-community MySQL Connectors Community enabled
mysql-connectors-community-debuginfo MySQL Connectors Community - Debu disabled
mysql-connectors-community-source MySQL Connectors Community - Sour disabled
mysql-tools-community MySQL Tools Community enabled
mysql-tools-community-debuginfo MySQL Tools Community - Debuginfo disabled
mysql-tools-community-source MySQL Tools Community - Source disabled
mysql80-community MySQL 8.0 Community Server enabled
mysql80-community-debuginfo MySQL 8.0 Community Server - Debu disabled
mysql80-community-source MySQL 8.0 Community Server - Sour disabled
μ€μΉλ mysql * ν¨ν€μ§ λͺ©λ‘
[root@localhost mysql]$ sudo dnf list installed | grep mysql
mysql-community-client.x86_64 8.0.36-1.el9 @mysql80-community
mysql-community-client-plugins.x86_64 8.0.36-1.el9 @mysql80-community
mysql-community-common.x86_64 8.0.32-1.el9 @mysql80-community
mysql-community-icu-data-files.x86_64 8.0.32-1.el9 @mysql80-community
mysql-community-libs.x86_64 8.0.36-1.el9 @mysql80-community
mysql-community-server.x86_64 8.0.32-1.el9 @@commandline
mysql-ref-manual-8.0-en-html-chapter.noarch 1-20220914 @mysql80-community
mysql80-community-release.noarch el9-1 @System
pcp-pmda-mysql.x86_64 6.2.0-1.el9 @AppStream
πΆ ν¨ν€μ§ μΆκ° μ€μΉ
repo μμ μΆκ° μ€μΉ κ°λ₯ν ν¨ν€μ§ νμΈνκΈ°
[root@localhost mysql]$ dnf --disablerepo=\* --enablerepo=' mysql*-community*' list available
No read/execute access in current directory, moving to /
MySQL Cluster 8.0 Community 2.4 MB/s | 1.5 MB 00:00
MySQL 8.0 Community Server - Debuginfo 386 kB/s | 136 kB 00:00
MySQL Connectors Community - Debuginfo 15 kB/s | 7.6 kB 00:00
MySQL Tools Community - Debuginfo 65 kB/s | 25 kB 00:00
MySQL Cluster 8.0 Community - Debuginfo 315 kB/s | 155 kB 00:00
MySQL 8.0 Community Server - Source 8.3 kB/s | 3.2 kB 00:00
MySQL Connectors Community - Source 8.9 kB/s | 5.1 kB 00:00
MySQL Tools Community - Source 6.6 kB/s | 2.8 kB 00:00
MySQL Cluster 8.0 Community - Source 5.9 kB/s | 2.9 kB 00:00
Available Packages
mysql-cluster-community.src 8.0.36-1.el9 mysql-cluster-8.0-community-source
mysql-cluster-community-client.x86_64 8.0.36-1.el9 mysql-cluster-8.0-community
mysql-cluster-community-client-debuginfo.x86_64 8.0.36-1.el9 mysql-cluster-8.0-community-debuginfo
mysql-cluster-community-client-plugins.x86_64 8.0.36-1.el9 mysql-cluster-8.0-community
mysql-cluster-community-client-plugins-debuginfo.x86_64 8.0.36-1.el9 mysql-cluster-8.0-community-debuginfo
mysql-cluster-community-common.x86_64 8.0.36-1.el9 mysql-cluster-8.0-community
# ########### (μ€λ΅) ############
mysql-ref-manual-8.0-en-html-chapter.noarch
ν¨ν€μ§ μΆκ° μ€μΉ
[root@localhost mysql]$ sudo dnf install mysql-ref-manual-8.0-en-html-chapter.noarch
Last metadata expiration check: 0:56:36 ago on Fri 22 Mar 2024 03:42:06 PM KST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
mysql-ref-manual-8.0-en-html-chapter noarch 1-20220914 mysql80-community 7.9 M
Transaction Summary
=============================================================================================================================================================
Install 1 Package
Total download size: 7.9 M
Installed size: 41 M
Is this ok [y/N]: y
Downloading Packages:
mysql-ref-manual-8.0-en-html-chapter-1-20220914.noarch.rpm 8.1 MB/s | 7.9 MB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 8.1 MB/s | 7.9 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mysql-ref-manual-8.0-en-html-chapter-1-20220914.noarch 1/1
Verifying : mysql-ref-manual-8.0-en-html-chapter-1-20220914.noarch 1/1
Installed:
mysql-ref-manual-8.0-en-html-chapter-1-20220914.noarch
Complete!
7-3. MySQL DB λ°μ΄ν° μ μ₯μ λ³κ²½
쑰건 : systemctl status mysqld
κ²°κ³Ό inactive (dead)
μνμ¬μΌ ν¨
DB λ°μ΄ν° μ μ₯μλ‘ μ§μ λ κ²½λ‘ : /cargo1
my.cnf
νμΌ > datadir
, socket
κ²½λ‘ μμ
ν
μ΄λΈλͺ
μ‘°ν μ λμλ¬Έμ κ΅¬λΆ μμ΄ μ¬μ©νλλ‘ νλ μ€μ λ ν¨κ» μΆκ°
[root@localhost mysql]$ sudo vi /etc/my.cnf
[mysqld]
# datadir=/var/lib/mysql
# socket=/var/lib/mysql/mysql.sock
datadir=/cargo1/mysql
socket=/cargo1/mysql/mysql.sock
lower_case_table_names=1
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
rsync μμ
μ κΈ°μ‘΄ μ€ν€λ§λ€μ λͺ¨λ 볡μ¬νμ¬ κ°μ Έμ΄ (νμ¬ νκ²½μλ μμ±λ μ€ν€λ§κ° μμ§λ§ μ°μ λ°λΌν¨)
# mysql 볡μ¬
[root@localhost mysql]$ sudo rsync -av /var/lib/mysql /cargo1
sending incremental file list
mysql/
sent 64 bytes received 20 bytes 168.00 bytes/sec
total size is 0 speedup is 0.00
# mysql κΆν λΆμ¬
[root@localhost mysql]$ sudo chown -R mysql:mysql /cargo1/mysql
SElinux 보μ μΆκ°
νλ‘μΈμ€μ μλ‘ κΆνμ μΆκ°ν΄μ£ΌμκΈ° λλ¬Έμ ν΄λΉ κ²½λ‘μ SElinux 보μ 컨ν
μ€νΈλ₯Ό μΆκ°ν΄μΌ ν¨
μΆκ°νμ§ μμΌλ©΄ MySQL μ€νμ permission μλ¬ λ°μ (μλ¬ λ΄μ©μ /var/log/audit/audit.log
μμ νμΈ κ°λ₯)
μλλ€κ³ SElinux λ₯Ό ν΄μ νλκ²μ λ§€μ° μννλ―λ‘ λΉμΆ
[root@localhost mysql]$ sudo semanage fcontext -a -t mysqld_db_t " /cargo1/mysql(/.*)?"
[root@localhost mysql]$ sudo restorecon -R /cargo1/mysql
# μ€μ μλ£λμλμ§ νμΈ
[root@localhost mysql]$ sudo semanage fcontext -l | grep mysql
/cargo1/mysql(/.* )? all files system_u:object_r:mysqld_db_t:s0
systemctl status mysqld
: μν νμΈ
systemctl start mysqld
: MySQL μ€ν
systemctl stop mysqld
: MySQL μ’
λ£
[root@localhost mysql]$ systemctl status mysqld
β mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; preset: disabled)
Active: inactive (dead)
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
[root@localhost mysql]$ systemctl start mysqld
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
Authentication is required to start ' mysqld.service' .
Authenticating as: YNJCH (root)
Password:
==== AUTHENTICATION COMPLETE ====
[root@localhost mysql]$ systemctl status mysqld
β mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; preset: disabled)
Active: active (running) since Fri 2024-03-22 16:34:12 KST; 13s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 417304 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 417378 (mysqld)
Status: " Server is operational"
Tasks: 39 (limit: 202223)
Memory: 451.2M
CPU: 6.081s
CGroup: /system.slice/mysqld.service
ββ417378 /usr/sbin/mysqld
Mar 22 16:33:25 localhost.localdomain systemd[1]: Starting MySQL Server...
Mar 22 16:34:12 localhost.localdomain systemd[1]: Started MySQL Server.
/cargo1/mysql
κ²½λ‘μ νμΌλ€μ΄ μκΈ΄ κ² νμΈ κ°λ₯
[root@localhost mysql]$ pwd
/cargo1/mysql
[root@localhost mysql]$ sudo ls
auto.cnf ca-key.pem client-key.pem ib_buffer_pool ' #innodb_redo' mysql.ibd performance_schema server-cert.pem undo_001
binlog.000001 ca.pem ' #ib_16384_0.dblwr' ibdata1 ' #innodb_temp' mysql.sock private_key.pem server-key.pem undo_002
binlog.index client-cert.pem ' #ib_16384_1.dblwr' ibtmp1 mysql mysql.sock.lock public_key.pem sys
πΆ systemctl start mysqld μ€ν¨
μλμ κ°μ΄ μ€λ₯ λ°μκ³Ό ν¨κ» start λμ§ μμ
[root@localhost mysql]$ systemctl start mysqld
# ########### (μ€λ΅) ############
Job for mysqld.service failed because the control process exited with error code.
See " systemctl status mysqld.service" and " journalctl -xeu mysqld.service" for details.
2024-03-22T07:47:45.105142Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server (' 1' ) and data dictionary (' 0' ).
2024-03-22T07:47:45.105570Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
lower_case_table_names=1
κ°μ μμΉ, #datadir
λ±μ μ£Όμ μ²λ¦¬κ° μ λλ‘ λμλμ§ νμΈ
systemctl stop mysqld
ν νμΌ μμ μ ν΄μΌ ν¨
μ΄νμλ κ³μ λ¬Έμ λ°μ μ, my.cnf
κ° μ΄κΈ°ν μμ μμ μ΄ μ΄λ£¨μ΄μ§ κ²μΈμ§ 체ν¬
MySQL μ΄κΈ°ν(μ κ±° λ° μ¬μ€μΉ) ν my.cnf
λΆν° μμ νλλ‘ μμ μ μ°¨ λ€μ μ§ν
[root@localhost mysql]$ sudo vi /etc/my.cnf
[mysqld]
# datadir=/var/lib/mysql
# socket=/var/lib/mysql/mysql.sock
datadir=/cargo1/mysql
socket=/cargo1/mysql/mysql.sock
lower_case_table_names=1
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
chmod 755 my.cnf
λͺ
λ Ήμ΄ μν
[root@localhost etc]# chmod 755 my.cnf
-rwxr-xr-x. 1 root root 1326 Mar 25 10:37 my.cnf
πΆ 3306 Port μμ νμ©
λ°©νλ²½μ 3306 Portλ₯Ό μμ νμ©μΌλ‘ λ±λ‘ λ° μ¬μ€ν
[root@localhost ~ ]# sudo firewall-cmd --permanent --zone=public --add-port=3306/tcp
success
[root@localhost ~ ]# sudo firewall-cmd --reload
success
[root@localhost ~ ]# sudo firewall-cmd --list-port
3306/tcp 3389/tcp
mysql> status
--------------
mysql Ver 8.0.36 for Linux on x86_64 (MySQL Community Server - GPL)
Connection id: 13
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ' '
Using delimiter: ;
Server version: 8.0.32 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /cargo1/mysql/mysql.sock
Binary data as: Hexadecimal
πΆ Character Set νμΈ
Character Set : utf8 / 4byte (λ³κ²½ν μ¬ν μμ)
mysql> show variables like " ch%" ;
+--------------------------+--------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8mb3 |
| character_sets_dir | /usr/share/mysql-8.0/charsets/ |
| check_proxy_users | OFF |
+--------------------------+--------------------------------+
9 rows in set (0.01 sec)
mysql> show variables like " col%" ;
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_0900_ai_ci |
| collation_database | utf8mb4_0900_ai_ci |
| collation_server | utf8mb4_0900_ai_ci |
+----------------------+--------------------+
3 rows in set (0.00 sec)
μμ ν¨μ€μλ νμΈ & root ν¨μ€μλ λ³κ²½
[root@localhost mysql]$ sudo grep ' temporary password' /var/log/mysqld.log
2024-03-22T07:33:42.873919Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: duy4Xcq-aH%L
[root@localhost mysql]$ mysql -uroot -p
Enter password: [duy4Xcq-aH%L]
πΆ Can't connect to local MySQL server through socket
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
MySQLμ μμΌ νμΌμΈ mysql.sock
νμΌμ΄ μκ±°λ μ ννμ§ μμμ λ°μνλ μλ¬
/cargo1/mysql
λ‘ λλ ν 리 λ³κ²½νλ©΄μ λ°μλ¨
(24.04.01 μμ ν μ¬μ€μΉνλ socket μμΉ κΈ°μ¬νμ§ μμλ μ μλ¨)
[root@localhost mysql]# mysql -uroot -p -S '/cargo1/mysql/mysql.sock'
μμ κ°μ΄ μμΌ νμΌ μμΉλ₯Ό μ§μ μ§μ ν΄μ€ μ μμ
λ‘κ·Έ νμΈ : tail -f /var/log/mysqld.log
mysql.sock
νμΌ μμΉ μ°ΎκΈ°
[root@localhost /]# find / -name mysql.sock
find: β/run/user/1000/gvfsβ: Permission denied
/cargo1/mysql/mysql.sock
8-2. root ν¨μ€μλ λ³κ²½
μμ ν¨μ€μλμμ μ΄κΈ°νν΄μΌ ν¨
λλ¬Έμλ₯Ό ν¬ν¨ν΄μΌ ν΄μ μλ¬Έμλ§μΌλ‘λ μ¬μ©ν μ μλλ‘ ν¨μ€μλ κ΅¬μ± λ°©λ² λ³κ²½ νμ
mysql> alter user ' root' @' localhost' identified by ' password$$' ;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> alter user ' root' @' localhost' identified by ' password$$' ;
Query OK, 0 rows affected (0.06 sec)
mysql> show variables like ' val%' ;
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 8 |
| validate_password.mixed_case_count | 1 |
| validate_password.number_count | 1 |
| validate_password.policy | MEDIUM |
| validate_password.special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.00 sec)
mysql> SET GLOBAL validate_password.mixed_case_count = 0;
Query OK, 0 rows affected (0.00 sec)
# λ€μ 'password$$' μΌλ‘ PW λ³κ²½
[root@localhost mysql]# mysql -uroot -p -S '/cargo1/mysql/mysql.sock'
Enter password: [password$$ ]
8-3. κ³μ μΆκ° λ° κΆν μ€μ
mysql> create user ' root' @' %' identified by ' password$$' ;
Query OK, 0 rows affected (0.02 sec)
mysql> create user ' projyj' @localhost identified by ' password$$' ;
Query OK, 0 rows affected (0.02 sec)
mysql> create user ' projyj' @' %' identified by ' password$$' ;
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on * .* to ' projyj' @' %' ;
Query OK, 0 rows affected (0.02 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
select host, user, authentication_string from USER;
λ‘ νμΈ κ°λ₯
πΆ μνΈν λ°©μ λ³κ²½
8.0.32 λ²μ μνΈν λ°©μ νμΈ : caching_sha2_password
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| projyj | % | caching_sha2_password |
| root | % | caching_sha2_password |
| projyj | localhost | caching_sha2_password |
| root | localhost | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+
ProjYj μ¬μ© κ³μ μ μμ λ°©μμ μνΈμ²΄κ³ mysql_native_password
λ‘ λ³κ²½ν΄μΌ ν¨
mysql> ALTER USER ' projyj' @' %' IDENTIFIED WITH mysql_native_password BY ' password$$' ;
mysql> ALTER USER ' projyj' @' localhost' IDENTIFIED WITH mysql_native_password BY ' password$$' ;
πΆ MySQL μ¬μ©μ κ³μ λΉλ°λ²νΈ μ μ±
MySQL μ¬μ©μ κ³μ λΉλ°λ²νΈ μ μ±
λ³κ²½
validate_password_policy
λ₯Ό LOW
λ‘ μ€μ
mysql> set global validate_password.policy=LOW;
Query OK, 0 rows affected (0.00 sec)
9. MySQL ν
μ΄λΈ μμ±
9-1. λ°μ΄ν°λ² μ΄μ€ μμ±
projyj
λ°μ΄ν°λ² μ΄μ€ μμ±
mysql> create database projyj;
Query OK, 1 row affected (0.15 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| projyj |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
FileZilla > /home
> EZMIG_init.sql
, ALTER_TABLE.sql
, ALTER_TABLE_COLUMN.sql
νμΌμ μ
λ‘λ
[root@localhost home]# cd /home
[root@localhost home]# ls
ALTER_TABLE_COLUMN.sql ALTER_TABLE.sql EZMIG_init.sql projyj
EZMIG_init.sql
μ€ν > 57κ° ν
μ΄λΈμ΄ μμ±λλ©΄ μ±κ³΅
[root@localhost home]# mysql -uroot -p projyj -S '/cargo1/mysql/mysql.sock' < EZMIG_init.sql
Enter password:
ALTER_TABLE_COLUMN.sql
μ€ν > ν
μ΄λΈ λ° μ»¬λΌ μ½λ©νΈκ° μμ±λλ©΄ μ±κ³΅
[root@localhost home]# mysql -uroot -p projyj -S '/cargo1/mysql/mysql.sock' < ALTER_TABLE.sql
Enter password:
[root@localhost home]# mysql -uroot -p projyj -S '/cargo1/mysql/mysql.sock' < ALTER_TABLE_COLUMN.sql
Enter password:
πΆ DBeaver μμ νμΈ
Public Key Retrieval is not allowed
μ€λ₯ λ°μ μ, URL μ ?useSSL=false&allowPublicKeyRetrieval=true
μΆκ°
URL : jdbc:mysql://192.168.1.111:3306/projyj?useSSL=false&allowPublicKeyRetrieval=true
ID : projyj / PW : password$$
10. λ€νΈμν¬ μν νμΈ
μλ²μ κΈ°λ³Έ μ¬μ© ν¬νΈλ₯Ό μ μ§νλ©°, ProjYj Web μλ²λ 8070 ν¬νΈλ₯Ό μ¬μ©νλλ‘ ν¨
ν¬νΈ νμΈ : netstat -ltnp | grep 8070
ν¬νΈ μ£½μ΄κΈ° : kill -9 [PID]
10-1. λ€νΈμν¬ μν νμΈ
netstat
> λͺ¨λ μμ μμΌκ³Ό μ°κ²°μ νμΈ
lsof
> TCP port μ μ μ 보 νμΈ λ° μμ½ λ³΄κΈ°
[root@localhost home]# netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:44321 0.0.0.0:* LISTEN 2195/pmcd
tcp 0 0 127.0.0.1:5910 0.0.0.0:* LISTEN 349956/Xvnc
tcp 0 0 127.0.0.1:4330 0.0.0.0:* LISTEN 3175/pmlogger
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 351164/sshd: /usr/s
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1324/cupsd
tcp6 0 0 :::9090 :::* LISTEN 1/systemd
tcp6 0 0 ::1:44321 :::* LISTEN 2195/pmcd
tcp6 0 0 ::1:4330 :::* LISTEN 3175/pmlogger
tcp6 0 0 ::1:5910 :::* LISTEN 349956/Xvnc
tcp6 0 0 :::33060 :::* LISTEN 549541/mysqld
tcp6 0 0 :::22 :::* LISTEN 351164/sshd: /usr/s
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::3389 :::* LISTEN 345161/xrdp
tcp6 0 0 :::3306 :::* LISTEN 549541/mysqld
tcp6 0 0 ::1:631 :::* LISTEN 1324/cupsd
tcp6 0 0 ::1:3350 :::* LISTEN 345160/xrdp-sesman
[root@localhost home]# sudo lsof -i TCP -P |grep LISTEN
systemd 1 root 80u IPv4 777988 0t0 TCP * :111 (LISTEN)
systemd 1 root 84u IPv6 777019 0t0 TCP * :111 (LISTEN)
systemd 1 root 248u IPv6 802458 0t0 TCP * :9090 (LISTEN)
cupsd 1324 root 6u IPv6 20817 0t0 TCP localhost:631 (LISTEN)
cupsd 1324 root 7u IPv4 20818 0t0 TCP localhost:631 (LISTEN)
pmcd 2195 pcp 0u IPv4 17264 0t0 TCP localhost:44321 (LISTEN)
pmcd 2195 pcp 3u IPv6 17265 0t0 TCP localhost:44321 (LISTEN)
pmlogger 3175 pcp 7u IPv4 1337160 0t0 TCP localhost:4330 (LISTEN)
pmlogger 3175 pcp 8u IPv6 1337161 0t0 TCP localhost:4330 (LISTEN)
xrdp-sesm 345160 root 11u IPv6 742974 0t0 TCP localhost:3350 (LISTEN)
xrdp 345161 root 11u IPv6 746744 0t0 TCP * :3389 (LISTEN)
Xvnc 349956 root 6u IPv4 760993 0t0 TCP localhost:5910 (LISTEN)
Xvnc 349956 root 7u IPv6 760994 0t0 TCP localhost:5910 (LISTEN)
sshd 351164 root 3u IPv4 763481 0t0 TCP * :22 (LISTEN)
sshd 351164 root 4u IPv6 763483 0t0 TCP * :22 (LISTEN)
mysqld 549541 mysql 21u IPv6 1688602 0t0 TCP * :33060 (LISTEN)
mysqld 549541 mysql 24u IPv6 1684797 0t0 TCP * :3306 (LISTEN)
[root@localhost home]# sudo lsof -i -nP | grep LISTEN | awk '{print $(NF-1)" "$1}' | sort
* :111 systemd
* :111 systemd
127.0.0.1:4330 pmlogger
127.0.0.1:44321 pmcd
127.0.0.1:5910 Xvnc
127.0.0.1:631 cupsd
[::1]:3350 xrdp-sesm
[::1]:4330 pmlogger
[::1]:44321 pmcd
[::1]:5910 Xvnc
[::1]:631 cupsd
* :22 sshd
* :22 sshd
* :33060 mysqld
* :3306 mysqld
* :3389 xrdp
* :9090 systemd
8.0.36 λ²μ μ κΈ°μ€μΌλ‘ μ€μΉ
rpm λ°°ν¬ νμΌμ΄ μκ³ , μμΆ νμΌλ‘λ§ μ κ³΅λ¨ > wget μΌλ‘ λ€μ΄λ‘λ μ§ν
# λλ ν 리 μμ±
[root@localhost /]# mkdir projyjengine
[root@localhost /]# mkdir tomcat
# wget μΌλ‘ λ€μ΄λ‘λ
[root@localhost Downloads]# pwd
/root/Downloads
[root@localhost Downloads]# wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.tar.gz
--2024-03-28 09:45:52-- https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.tar.gz
Resolving archive.apache.org (archive.apache.org)... 65.108.204.189, 2a01:4f9:1a:a084::2
Connecting to archive.apache.org (archive.apache.org)| 65.108.204.189| :443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9277365 (8.8M) [application/x-gzip]
Saving to: βapache-tomcat-8.0.36.tar.gzβ
apache-tomcat-8.0.36.tar.gz 100%[============================================================================> ] 8.85M 939KB/s in 11s
2024-03-28 09:46:04 (831 KB/s) - βapache-tomcat-8.0.36.tar.gzβ saved [9277365/9277365]
/tomcat
κ²½λ‘μ μμΆ νκΈ°
[root@localhost Downloads]# tar -xvf apache-tomcat-8.0.36.tar.gz -C /tomcat/
apache-tomcat-8.0.36/bin/catalina.sh
apache-tomcat-8.0.36/bin/configtest.sh
apache-tomcat-8.0.36/bin/daemon.sh
server.xml
: 8080 ν¬νΈλ₯Ό 8070 λ‘ λ³κ²½νκ³ μ μ₯
[root@localhost conf]# pwd
/tomcat/apache-tomcat-8.0.36/conf
[root@localhost conf]# vi server.xml
< Connector port=" 8070" protocol=" HTTP/1.1"
connectionTimeout=" 20000"
redirectPort=" 8443" />
[root@localhost conf]# timedatectl
Local time: Thu 2024-03-28 09:51:11 KST
Universal time: Thu 2024-03-28 00:51:11 UTC
RTC time: Thu 2024-03-28 09:51:11
Time zone: Asia/Seoul (KST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: yes
λ°©νλ²½ 8070 ν¬νΈ μ΄κΈ° (8888 μ΄μλ€κ° λ³κ²½ν¨)
[root@localhost ~ ]# firewall-cmd --permanent --zone=public --add-port=8070/tcp
success
[root@localhost ~ ]# firewall-cmd --reload
success
[root@localhost ~ ]# firewall-cmd --list-port
3306/tcp 3389/tcp 8070/tcp 8888/tcp
Java Version νμΈ : openjdk version "1.8.0_362"
[root@localhost conf]# java -version
openjdk version " 1.8.0_362"
OpenJDK Runtime Environment (build 1.8.0_362-b08)
OpenJDK 64-Bit Server VM (build 25.362-b08, mixed mode)
νκ²½λ³μ μ€μ μ§ννμ§ μμμΌλ, μΌλ¨ κΈ°λ‘ν΄λ κ²μ
/etc/profile
μ μ§μ μμ
[root@localhost etc]# cd /etc
[root@localhost etc]# vi profile
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre
CATALINA_HOME=/tomcat/apache-tomcat-8.0.36
[root@localhost bin]# pwd
/tomcat/apache-tomcat-8.0.36/bin
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /tomcat/apache-tomcat-8.0.36
Using CATALINA_HOME: /tomcat/apache-tomcat-8.0.36
Using CATALINA_TMPDIR: /tomcat/apache-tomcat-8.0.36/temp
Using JRE_HOME: /usr
Using CLASSPATH: /tomcat/apache-tomcat-8.0.36/bin/bootstrap.jar:/tomcat/apache-tomcat-8.0.36/bin/tomcat-juli.jar
Tomcat started.
[root@localhost network-scripts]# rm -rf ifcfg-eno1
λ€νΈμν¬ μΈν°νμ΄μ€ name νμΈ : eno1
inet 192.168.1.999
μ νμΈ
[root@localhost bin]# ifconfig
eno1: flags=4163< UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.999 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::dabb:c1ff:fe4d:c443 prefixlen 64 scopeid 0x20< link>
ether d8:bb:c1:4d:c4:43 txqueuelen 1000 (Ethernet)
RX packets 480472 bytes 169286658 (161.4 MiB)
RX errors 0 dropped 32337 overruns 0 frame 0
TX packets 249470 bytes 258333052 (246.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xa1200000-a1220000
lo: flags=73< UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10< host>
loop txqueuelen 1000 (Local Loopback)
RX packets 62902 bytes 3802084 (3.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 62902 bytes 3802084 (3.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# μλ λ°©λ²μΌλ‘λ νμΈ κ°λ₯
[root@localhost bin]# ls /sys/class/net
eno1 lo
ifcfg-eno1
νμΌμ΄ μμ΄μ μλ‘ μμ±
BOOTPROTO
: dhcp λμ static μΌλ‘ μ€μ (dhcp: μλν λΉ / static: μλμΌλ‘ μ€μ )
IPADDR
: μ€μ ν IP μ£Όμ
NETMASK
: μλΈλ· λ§μ€ν¬ μ£Όμ
GATEWAY
: κ²μ΄νΈμ¨μ΄ μ£Όμ
DNS
: DNSμ£Όμ (μΉ μ¬μ΄νΈ μ°κ²°νμ§ μμ κ²½μ° νμ μμ)
ONBOOT
: noμΌ κ²½μ° yesλ‘ λ°κΎΈκΈ° (λΆν
ν λ μλ λ€νΈμν¬ νμ±ν μ€μ νλ κ²)
DEVICE
: μμ name κ° eno1
[root@localhost network-scripts]# cd /etc/sysconfig/network-scripts
[root@localhost network-scripts]# touch ifcfg-eno1
[root@localhost network-scripts]# vi ifcfg-eno1
# λ΄μ© νμΈ
[root@seob network-scripts]# cat ifcfg-eno1
TYPE=Ethernet
PROXY_METHOD=none
BOOTPROTO=static
IPADDR=192.168.1.111
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
ONBOOT=yes
DEVICE=eno1
NAME=eno1
# USERCTL=no
12-2. Network Server μ¬μμ
service network restart
, systemctl restart network
λͺ
λ Ήμ΄λ‘ μ¬μμ
CentOS 8 μ΄μμμλ μλΉμ€ λͺ
μΉμ΄ Network
λμ NetworkManager
λ‘ λ³κ²½λ¨
[root@localhost ~ ]# service network restart
Redirecting to /bin/systemctl restart network.service
Failed to restart network.service: Unit network.service not found.
service NetworkManager restart
λͺ
λ Ήμ΄λ‘ μ¬μμ
[root@localhost network-scripts]# service NetworkManager restart
Redirecting to /bin/systemctl restart NetworkManager.service
12-3. μ¬μμ μ νλ‘ μν νμΈ
dmesg μμ€ν
λΆν
λ‘κ·Έ νμΈ
[root@localhost network-scripts]# dmesg | grep eth
[ 1.524205] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) d8:bb:c1:4d:c4:43
[ 1.524207] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection
[ 1.524356] e1000e 0000:00:1f.6 eth0: MAC: 13, PHY: 12, PBA No: FFFFFF-0FF
[ 1.719672] e1000e 0000:00:1f.6 eno1: renamed from eth0
[root@localhost network-scripts]# dmesg | grep eno1
[ 1.719672] e1000e 0000:00:1f.6 eno1: renamed from eth0
[ 25.238976] e1000e 0000:00:1f.6 eno1: NIC Link is Up 100 Mbps Full Duplex, Flow Control: Rx/Tx
[ 25.239153] IPv6: ADDRCONF(NETDEV_CHANGE): eno1: link becomes ready
[root@localhost network-scripts]# lspci | grep Ethernet
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (10) I219-V (rev 11)
systemctl status μλΉμ€
[root@localhost ~ ]# systemctl status NetworkManager.service
β NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: enabled)
Active: active (running) since Thu 2024-03-28 10:57:46 KST; 45s ago
Docs: man:NetworkManager(8)
Main PID: 118424 (NetworkManager)
Tasks: 3 (limit: 202236)
Memory: 5.4M
CPU: 39ms
CGroup: /system.slice/NetworkManager.service
ββ118424 /usr/sbin/NetworkManager --no-daemon
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7788] device (lo): Activation: successful, device activated.
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7792] policy: set ' eno1' (eno1) as default for IPv4 routing and DNS
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7804] device (eno1): state change: ip-config -> ip-check (reason ' none' , s>
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7863] device (eno1): state change: ip-check -> secondaries (reason ' none' ,>
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7864] device (eno1): state change: secondaries -> activated (reason ' none' >
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7866] manager: NetworkManager state is now CONNECTED_SITE
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7869] device (eno1): Activation: successful, device activated.
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7873] manager: NetworkManager state is now CONNECTED_GLOBAL
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7874] manager: startup complete
Mar 28 10:57:46 localhost.localdomain NetworkManager[118424]: < info> [1711591066.7921] policy: set-hostname: set hostname to ' localhost.localdomain' (no ho>
...skipping...
[root@localhost network-scripts]# ip addr show eno1
2: eno1: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether d8:bb:c1:4d:c4:43 brd ff:ff:ff:ff:ff:ff
altname enp0s31f6
inet 192.168.1.999/24 brd 192.168.1.255 scope global noprefixroute eno1
valid_lft forever preferred_lft forever
inet6 fe80::dabb:c1ff:fe4d:c443/64 scope link noprefixroute
valid_lft forever preferred_lft forever
μ¬μ© κ°λ₯ν λͺ¨λ μ₯μΉμ μν νμ : nmcli dev status
/ μ¬μ© κ°λ₯ν λͺ¨λ μ°κ²°μ μνλ₯Ό νμ : nmcli con show
[root@localhost network-scripts]# nmcli dev status
DEVICE TYPE STATE CONNECTION
eno1 ethernet connected eno1
lo loopback connected (externally) lo
λ€νΈμν¬ μ 보 νμΈ (IP μ£Όμλ§ λ³΄κΈ°) : ifconfig eno1 | grep inet
λ€νΈμν¬ μ¬μμ νμλ IP μ£Όμκ° λ³κ²½λμ§ μμ μ₯μΉ λΉνμ±ν μλ
eno1
μ₯μΉ νμ±ν/λΉνμ±ν : ifup eno1
, ifdown eno1
[root@localhost network-scripts]# ifdown eno1
bash: ifdown: command not found...
Install package ' NetworkManager-initscripts-updown' to provide command ' ifdown' ? [N/y] y
* Waiting in queue...
* Loading list of packages....
The following packages have to be installed:
NetworkManager-initscripts-updown-1:1.47.2-1.el9.noarch Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts)
Proceed with changes? [N/y] y
μ€μΉνλΌλ λ¬Έκ΅¬κ° λμ μ€μΉ μ§ν
μλμ κ°μ μ€λ₯ λ°μ
[root@localhost network-scripts]# ifdown eno1
Error: ' /etc/sysconfig/network-scripts/ifcfg-eno1' is not an active connection.
Error: no active connection provided.
Failure to deactivate file " eno1" !
See all profiles with ` nmcli connection` .
Reload files from disk with ` nmcli connection reload`
Deactivate the desired profile with ` nmcli connection down \" $NAME \" `
eno1.nmconnection
νμΌ > IP μ£Όμ λ³κ²½
[root@localhost system-connections]# cd /etc/NetworkManager/system-connections/
[root@localhost system-connections]# ls
eno1.nmconnection
[root@localhost system-connections]# vi eno1.nmconnection
# λ΄μ© μμ
[ipv4]
address1=192.168.1.111/24,192.168.1.1
dns=210.94.0.73; 210.220.163.82;
ignore-auto-dns=true
method=manual
[root@localhost system-connections]# service NetworkManager restart
Redirecting to /bin/systemctl restart NetworkManager.service
IP μ£Όμ νμΈνκΈ° (inet 192.168.1.111
κ° μΆκ°λ¨)
[root@localhost network-scripts]# ip addr show eno1
2: eno1: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether d8:bb:c1:4d:c4:43 brd ff:ff:ff:ff:ff:ff
altname enp0s31f6
inet 192.168.1.999/24 brd 192.168.1.255 scope global noprefixroute eno1
valid_lft forever preferred_lft forever
inet 192.168.1.111/24 brd 192.168.1.255 scope global secondary noprefixroute eno1
valid_lft forever preferred_lft forever
inet6 fe80::dabb:c1ff:fe4d:c443/64 scope link noprefixroute
valid_lft forever preferred_lft forever
μ μλ μ λλ κ²μΌλ‘ νμΈλ¨
projyj
μΆκ°λ‘ μμ±
adduser
: μ¬μ©μ ν λλ ν 리λ₯Ό ν¬ν¨ν μ¬μ©μ κ΄λ ¨ μ€μ μ μλ μμ± / μ¬μ©μκ° μ€μ ν κΈ°λ³Έ μμ μ¬μ©μμ μλ‘ μ§μ
useradd
: μ¬μ©μ ν λλ ν 리λ₯Ό ν¬ν¨ν μ¬μ©μ κ΄λ ¨ μ€μ μ μλμμ± νμ§ μμ / ν λλ ν 리μ ν¨μ€μλ κ·Έ μΈμλ μ¬λ¬κ°μ§ μ€μ μ λ°λ‘ ν΄μ€μΌ ν¨ / κΈ°λ³Έ μμΈ shκ° ν λΉλ¨
[root@localhost ~ ]# whoami
root
[root@localhost home]# adduser projyj -p password$$
[root@localhost projyj]# id projyj # μ 보 μ‘°ν
uid=1001(projyj) gid=1001(projyj) groups=1001(projyj)
[root@localhost home]# passwd projyj
Changing password for user projyj.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
πΆ μμ± κ³μ νμΈ
μ€μ λ κ³μ ID νμΈ
[root@localhost home]# grep /bin/bash /etc/passwd | cut -f1 -d:
root
projyj
-r
: κ³μ μ home directory λ±μ ν¬ν¨ν μμ μμ
userdel [user] // μ¬μ©μ κ³μ λ§ μμ
userdel -r [user] // home directory λ±μ ν¬ν¨ν μμ μμ
14-1. κ³μ κΆν λΆμ¬
visudo
λλ vi /etc/sudoers
λ‘ ν΄λΉ νμΌ νμΈ
sudoers μμ μμλ visudo
μ¬μ©μ κΆκ³ νκ³ μμ
[root@localhost home]# visudo
visudo: /etc/sudoers.tmp unchanged
[root@localhost home]# vi /etc/sudoers
projyj
κ³μ λ root κΆν μ£ΌκΈ°
# # Allow root to run any commands anywhere
root ALL=(ALL) ALL
projyj ALL=(ALL) ALL
5. Podman μ μ΄μ΄μ Podman μμ
Docker Hub μ Podman μ μ νΈνλλ€κ³ ν¨ > Docker Hub μ Jenkins μ΄λ―Έμ§λ₯Ό μ¬μ©
μ΄λ―Έμ§ λ€μ΄λ‘λ (podman pull)
[root@localhost home]# podman pull jenkins/jenkins:lts
β docker.io/jenkins/jenkins:lts
Trying to pull docker.io/jenkins/jenkins:lts...
Getting image source signatures
Copying blob 8d7cd7345072 done |
Copying blob 71215d55680c done |
Copying blob c8dac3aae91a done |
Copying blob 1830bd5f9b45 done |
Copying blob 35af8fb55c2f done |
Copying blob 234e1154c2a1 done |
Copying blob a89f7edcbd51 done |
Copying blob 83597e279c9f done |
Copying blob 6c39e3e60898 done |
Copying blob 29150353c9ba done |
Copying blob 33fe415a6139 done |
Copying blob c5d8e31128fd done |
Copying config 2371da2306 done |
Writing manifest to image destination
2371da23064a2c39b40101d0851ef5c51adff752a013949cc129eb616228d5cd
μ΄λ―Έμ§ νκ·Έ μ€μ (podman tag)
[root@localhost home]# podman tag jenkins/jenkins:lts projyj/jenkins:2.204.2
[root@localhost home]# podman tag jenkins/jenkins:lts docker.io/projyj/jenkins:2.204.2
[root@localhost home]# podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/projyj/jenkins 2.204.2 2371da23064a 8 days ago 471 MB
localhost/projyj/jenkins 2.204.2 2371da23064a 8 days ago 471 MB
docker.io/jenkins/jenkins lts 2371da23064a 8 days ago 471 MB
μ΄λ―Έμ§ κ²μ (podman search)
[root@localhost home]# podman search --tls-verify jenkins
NAME DESCRIPTION
registry.access.redhat.com/openshift3/jenkins-2-rhel7 This image provides a Jenkins server, primar...
registry.access.redhat.com/openshift3/jenkins-1-rhel7 Jenkins image which can be used to set up a...
# ########### (μ€λ΅) ############
docker.io/rancher/jenkins-jnlp-slave
docker.io/jenkins/core-pr-tester Docker image for testing pull-requests sent...
docker.io/jenkins/jnlp-agent-alpine
docker.io/rancher/jenkins-slave Jenkins Build Slave
docker.io/jenkins/jnlp-agent-coresdk
docker.io/jenkins/evergreen An automatically self-updating Jenkins distr...
μ΄λ―Έμ§ λͺ©λ‘ μΆλ ₯ (podman images)
[root@localhost home]# podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/jenkins/jenkins lts 2371da23064a 8 days ago 471 MB
μ΄λ―Έμ§ μΈλΆ μ 보 νμΈ (podman inspect)
[root@localhost home]# podman inspect jenkins/jenkins:lts
[
{
" Id" : " 2371da23064a2c39b40101d0851ef5c51adff752a013949cc129eb616228d5cd" ,
" Digest" : " sha256:1fd79ceb68ce883fb86db70bdbf7f9eaa8b25e580aafe7a240235240396e3916" ,
" RepoTags" : [
" docker.io/jenkins/jenkins:lts"
],
" RepoDigests" : [
" docker.io/jenkins/jenkins@sha256:1fd79ceb68ce883fb86db70bdbf7f9eaa8b25e580aafe7a240235240396e3916" ,
" docker.io/jenkins/jenkins@sha256:55ca11703b6b90031030be36c9fe9f064b38a4bd2bd253100d0246efd0054a8a"
],
" Parent" : " " ,
" Comment" : " " ,
" Created" : " 2024-03-20T16:37:24.770285139Z" ,
" Config" : {
" User" : " jenkins" ,
" ExposedPorts" : {
" 50000/tcp" : {},
" 8080/tcp" : {}
},
" Env" : [
" PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ,
" LANG=C.UTF-8" ,
" JENKINS_HOME=/var/jenkins_home" ,
" JENKINS_SLAVE_AGENT_PORT=50000" ,
" REF=/usr/share/jenkins/ref" ,
" JENKINS_VERSION=2.440.2" ,
" JENKINS_UC=https://updates.jenkins.io" ,
" JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental" ,
" JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals" ,
" COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log" ,
" JAVA_HOME=/opt/java/openjdk"
],
" Entrypoint" : [
" /usr/bin/tini" ,
" --" ,
" /usr/local/bin/jenkins.sh"
],
" Volumes" : {
" /var/jenkins_home" : {}
},
" Labels" : {
" org.opencontainers.image.description" : " The Jenkins Continuous Integration and Delivery server" ,
" org.opencontainers.image.licenses" : " MIT" ,
" org.opencontainers.image.revision" : " 8b3d5836ae21390ab374b154b94b7ac33d615243" ,
" org.opencontainers.image.source" : " https://github.com/jenkinsci/docker" ,
" org.opencontainers.image.title" : " Official Jenkins Docker image" ,
" org.opencontainers.image.url" : " https://www.jenkins.io/" ,
" org.opencontainers.image.vendor" : " Jenkins project" ,
" org.opencontainers.image.version" : " 2.440.2"
}
},
" Version" : " " ,
" Author" : " " ,
" Architecture" : " amd64" ,
" Os" : " linux" ,
" Size" : 471191196,
" VirtualSize" : 471191196,
# ########### (μ€λ΅) ############
" Labels" : {
" org.opencontainers.image.description" : " The Jenkins Continuous Integration and Delivery server" ,
" org.opencontainers.image.licenses" : " MIT" ,
" org.opencontainers.image.revision" : " 8b3d5836ae21390ab374b154b94b7ac33d615243" ,
" org.opencontainers.image.source" : " https://github.com/jenkinsci/docker" ,
" org.opencontainers.image.title" : " Official Jenkins Docker image" ,
" org.opencontainers.image.url" : " https://www.jenkins.io/" ,
" org.opencontainers.image.vendor" : " Jenkins project" ,
" org.opencontainers.image.version" : " 2.440.2"
},
" Annotations" : {},
" ManifestType" : " application/vnd.oci.image.manifest.v1+json" ,
" User" : " jenkins" ,
" History" : [
# ########### (μ€λ΅) ############
],
" NamesHistory" : [
" docker.io/jenkins/jenkins:lts"
]
}
]
μ΄λ―Έμ§ μμ (podman rmi)
$ podman rmi localhost/projyj/jenkins:2.204.2
Untagged: localhost/projyj/jenkins:2.204.2
$ podman rmi docker.io/projyj/jenkins:2.204.2
Untagged: docker.io/projyj/jenkins:2.204.2
15-2. Podman 컨ν
μ΄λ μμ± λ° κ΅¬λ
컨ν
μ΄λ μμ± λ° λ°±κ·ΈλΌμ΄λ μ€ν (podman run)
[root@localhost home]# podman run --name jenkins -d -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
e5c906face7a150af68d9672d019e4ca60775a981f21bb516c5ff34d097652b7
컨ν
μ΄λ λͺ©λ‘ νμΈ (podman ps)
컨ν
μ΄λ μ€ν νμΈκ³Ό μ¬μ© κ°λ₯ν λͺ¨λ 컨ν
μ΄λ μΆλ ₯
[root@localhost home]# podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d7020c058f90 docker.io/jenkins/jenkins:lts 42 seconds ago Up 42 seconds 0.0.0.0:8080-> 8080/tcp, 0.0.0.0:50000-> 50000/tcp jenkins
컨ν
μ΄λ ꡬλ νμΈ (podman logs)
[root@localhost home]# podman logs -f jenkins
Running from: /usr/share/jenkins/jenkins.war
webroot: /var/jenkins_home/war
2024-03-29 00:34:08.819+0000 [id= 1] INFO winstone.Logger#logInternal: Beginning extraction from war file
2024-03-29 00:34:09.458+0000 [id= 1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2024-03-29 00:34:09.494+0000 [id= 1] INFO org.eclipse.jetty.server.Server#doStart: jetty-10.0.20; built: 2024-01-29T20:46:45.278Z; git: 3a745c71c23682146f262b99f4ddc4c1bc41630c; jvm 17.0.10+7
2024-03-29 00:34:09.640+0000 [id= 1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2024-03-29 00:34:09.670+0000 [id= 1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: Session workerName=node0
2024-03-29 00:34:09.940+0000 [id= 1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get(" JENKINS_HOME" )
2024-03-29 00:34:10.007+0000 [id= 1] INFO o.e.j.s.handler.ContextHandler#doStart: Started w.@332820f4{Jenkins v2.440.2,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
2024-03-29 00:34:10.014+0000 [id= 1] INFO o.e.j.server.AbstractConnector#doStart: Started ServerConnector@68fa0ba8{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2024-03-29 00:34:10.019+0000 [id= 1] INFO org.eclipse.jetty.server.Server#doStart: Started Server@2a7686a7{STARTING}[10.0.20,sto= 0] @1502ms
2024-03-29 00:34:10.020+0000 [id= 27] INFO winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2024-03-29 00:34:10.150+0000 [id= 35] INFO jenkins.InitReactorRunner$1 #onAttained: Started initialization
2024-03-29 00:34:10.162+0000 [id= 56] INFO jenkins.InitReactorRunner$1 #onAttained: Listed all plugins
2024-03-29 00:34:10.642+0000 [id= 56] INFO jenkins.InitReactorRunner$1 #onAttained: Prepared all plugins
2024-03-29 00:34:10.645+0000 [id= 56] INFO jenkins.InitReactorRunner$1 #onAttained: Started all plugins
2024-03-29 00:34:10.649+0000 [id= 52] INFO jenkins.InitReactorRunner$1 #onAttained: Augmented all extensions
2024-03-29 00:34:10.758+0000 [id= 41] INFO jenkins.InitReactorRunner$1 #onAttained: System config loaded
2024-03-29 00:34:10.758+0000 [id= 40] INFO jenkins.InitReactorRunner$1 #onAttained: System config adapted
2024-03-29 00:34:10.758+0000 [id= 51] INFO jenkins.InitReactorRunner$1 #onAttained: Loaded all jobs
2024-03-29 00:34:10.759+0000 [id= 51] INFO jenkins.InitReactorRunner$1 #onAttained: Configuration for all jobs updated
2024-03-29 00:34:10.769+0000 [id= 69] INFO hudson.util.Retrier#start: Attempt # 1 to do the action check updates server
2024-03-29 00:34:11.025+0000 [id= 48] INFO jenkins.install.SetupWizard#init:
*************************************************************
*************************************************************
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
070b01f500e94ca1b1a3c3fa01b0c911
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
2024-03-29 00:34:25.553+0000 [id= 55] INFO jenkins.InitReactorRunner$1 #onAttained: Completed initialization
2024-03-29 00:34:25.564+0000 [id= 26] INFO hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
2024-03-29 00:34:26.480+0000 [id= 69] INFO h.m.DownloadService$Downloadable #load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2024-03-29 00:34:26.481+0000 [id= 69] INFO hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt # 1
πΆ Podman 컨ν
μ΄λ ꡬλ/μ€μ§/μ¬μμ
컨ν
μ΄λ ꡬλ (podman start) / μ€μ§ (podman stop) / μ¬μμ (podman restart)
# 컨ν
μ΄λ μ€μ§ (podman stop)
[root@localhost home]# podman stop jenkins
jenkins
[root@localhost home]# podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d7020c058f90 docker.io/jenkins/jenkins:lts 7 minutes ago Exited (143) 16 seconds ago 0.0.0.0:8080-> 8080/tcp, 0.0.0.0:50000-> 50000/tcp jenkins
# 컨ν
μ΄λ ꡬλ (podman start)
[root@localhost home]# podman start jenkins
jenkins
[root@localhost home]# podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d7020c058f90 docker.io/jenkins/jenkins:lts 8 minutes ago Up 11 seconds 0.0.0.0:8080-> 8080/tcp, 0.0.0.0:50000-> 50000/tcp jenkins
# 컨ν
μ΄λ μ¬μμ (podman restart)
[root@localhost home]# podman restart jenkins
jenkins
[root@localhost home]# podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d7020c058f90 docker.io/jenkins/jenkins:lts 8 minutes ago Up 1 second 0.0.0.0:8080-> 8080/tcp, 0.0.0.0:50000-> 50000/tcp jenkins
컨ν
μ΄λ μμ (podman rm)
[root@localhost home]# podman rm jenkins
πΆ Podman 컨ν
μ΄λ μ¬μ©λ²
컨ν
μ΄λμ νλ‘μΈμ€ μ€ν λ° μ μ (podman exec)
[root@localhost home]# podman exec -it jenkins /bin/bash
jenkins@d7020c058f90:/$ whoami
jenkins
jenkins@d7020c058f90:/$ cd /var/jenkins_home/secrets
jenkins@d7020c058f90:~ /secrets$ cat initialAdminPassword
070b01f500e94ca1b1a3c3fa01b0c911
컨ν
μ΄λμ νλ‘μΈμ€ νμΈ (podman top)
[root@localhost home]# podman top jenkins
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
jenkins 1 0 0.000 4m19.290914938s ? 0s /usr/bin/tini -- /usr/local/bin/jenkins.sh
jenkins 2 1 8.485 4m19.29096756s ? 22s java -Duser.home=/var/jenkins_home -Djenkins.model.Jenkins.slaveAgentPort=50000 -Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle -jar /usr/share/jenkins/jenkins.war
컨ν
μ΄λμ ν¬νΈ μν νμΈ (podman port)
[root@localhost home]# podman port jenkins
8080/tcp -> 0.0.0.0:8080
50000/tcp -> 0.0.0.0:50000
μ°Έκ³ : Jenkins μ€μΉ κ°μ΄λ
15-2. Podman 컨ν
μ΄λ μμ± λ° κ΅¬λ μμ νμΈλ λΉλ°λ²νΈ λ³΅μ¬ : 070b01f500e94ca1b1a3c3fa01b0c911
http://192.168.1.111:8080 λ‘ μ μνμ¬ κ΅¬λλ κ² νμΈ
λΉλ°λ²νΈ μ
λ ₯ > Continue
Customize Jenkins > Install suggested plugins
Create First Admin User > κ³μ μ 보 μ
λ ₯
κ³μ λͺ
: projyj
μνΈ : password$$
μ΄λ¦ : projyj
μ΄λ©μΌ μ£Όμ : [email protected]
Jenkins URL : Jenkins Web UIμ μ κ·ΌνκΈ° μν Jenkins URL μ€μ (κΈ°λ³ΈμΌλ‘ μ μ§ν¨)
Jenkins is ready! > Start using Jenkins
16. Jenkins μ Github μ°λ
16-1. Github Token λ°κΈ
Github > Settings(https://github.com/settings/profile ) > Developer Settings > Personal access tokens > Tokens (classic)
Generate new token (classic) ν΄λ¦
Note : CentOS 9 ProjYj
Expiration : No expiration (The token will never expire!)
Select scopes : repo
, admin:org
, admin:repo_hook
μ ν
Generate token : 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
(λ°κΈ λ°μ token μ λ€μ λ³Ό μ μμΌλ―λ‘ λ°λ‘ μ μ₯)
16-2. Jenkins Credentials μμ±
Dashboard > Jenkins κ΄λ¦¬ > Credentials
Stores scoped to Jenkins > System
μ Domains (global)
μ ν
Add Credentials
Kind : Username with password
Scope : Global (Jenkins, nodes, items, all child items, etc)
Username : projyj
(GitHub μμ΄λ)
Treat username as secret μ²΄ν¬ ν΄μ
Password : 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
(μμμ λ°κΈ λ°μ GitHub token)
ID : github_token
(Credentials μ΄λ¦)
Description : github_token
(Optional)
λΉλν GitHub Repository κ²½λ‘ μμ Jenkinsfile
μ΄ μ‘΄μ¬ν΄μΌ ν¨
2024.04.12 > Pipeline
μΌλ‘ ꡬμ±ν λλ§ νμ
pipeline {
agent any
stages {
stage(' github-clone' ) {
steps {
git branch: ' ProjYj2024main' , credentialsId: ' github_token' , url: ' https://github.com/projyj/ProjYj2024.git'
}
}
// stage...
}
}
16-4. Jenkins Freestyle project μ€μ
Dashboard > μλ‘μ΄ Item > Freestyle project μ ν
item name : ProjYj2024
2024.04.12 > Pipeline
μΌλ‘ ꡬμ±νμμΌλ, λΉλ ν μ‘°μΉ μ¬μ©μ μν΄ Freestyle project
λ‘ λ³κ²½νμμ (κ° νμ
λ³ Configure λ νλ¨ μ°Έκ³ )
μλ μ€ν λ± λΉλ ν μμ
μ 21. Jenkins λΉλ λ° μ€ν μμ μ΄μ΄μ νμΈ
πΆ Freestyle project Configure
μ°Έκ³ : Jenkins μλ‘μ΄ Item μμ± λ° μ€μ / Jenkinsμ github μ°λνκΈ°
General > GitHub project
μ ν
Project url : https://github.com/projyj/
(GitHub Repository κ²½λ‘)
μμ€ μ½λ κ΄λ¦¬ > Git
Repository URL : https://github.com/projyj/ProjYj2024.git
(GitHub Repository κ²½λ‘.git)
Credentials : (μμμ μμ±ν Credentials)
Branch Specifier : */ProjYj2024main
(trigger Branch)
λΉλ μ λ°(Build Triggers) > GitHub hook trigger for GITScm polling
μ ν
pushμ μν hook μ΄λ²€νΈκ° λ°μν κ²½μ° μ μ₯μλ₯Ό pollingν΄μ μ ν¨μ€μ μλ λΉλλ₯Ό μ λ°
GitHub μ hook trigger λ₯Ό λ°μΌλ©΄ λΉλ νκ² λ€λ μλ―Έ
λΉλ νκ²½ > Provide Node & npm bin/ folder to PATH
μ ν
NodeJS Installation : NodeJS 20.9.0
npmrc file : - use system default -
Cache location : Default (~/.npm or %APP_DATA%\npm-cache)
μ μ₯
General > GitHub project
μ ν
Project url : https://github.com/projyj/
(GitHub Repository κ²½λ‘)
Build Triggers > GitHub hook trigger for GITScm polling
μ ν
Pipeline > Definition > Pipeline script from SCM
μ ν
SCM : Git
μ ν
Repository URL : https://github.com/projyj/ProjYj2024.git
(GitHub Repository κ²½λ‘.git)
Credentials : (μμμ μμ±ν Credentials)
Branch Specifier : ProjYj2024main
(trigger Branch)
Script Path : Jenkinsfile
(λ£¨νΈ νλ‘μ νΈμμ Jenkinsfileμ κ²½λ‘ - κΈ°λ³Έκ° μ μ§)
μ μ₯
16-5. GitHub Repository Webhooks μ€μ
GitHub Repository μ Settings > Webhooks > Add webhook
Payload URL : http://192.168.1.111:8080/github-webhook/
(http://Jenkinsμ£Όμ/github-webhook/ )
Content type : application/json
Let me select individual events
μ ν > Pull requests
, Pushes
μ ν
Active
μ²΄ν¬ μ μ§
Add webhook
μ§κΈ λΉλ
> μλμ κ°μ΄ workspace κ° μκΉ
[root@localhost workspace]# pwd
/var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace
[root@localhost workspace]# ls
ProjYj2024 ProjYj2024@tmp
컨ν
μ΄λμ νλ‘μΈμ€ μ€ν λ° μ μ (podman exec)
[root@localhost home]# podman exec -it jenkins /bin/bash
jenkins@d7020c058f90:~ /workspace$ cd /var/jenkins_home/workspace
jenkins@d7020c058f90:~ /workspace$ ls
ProjYj2024 ProjYj2024@tmp
πΆ Jenkins λ₯Ό μν κΆν λΆμ¬
Jenkins λΉλ μ Permission denied
λ°©μ§
[root@localhost storage]# pwd
/var/lib/containers/storage
[root@localhost storage]# chmod 755 volumes/
[root@localhost storage]# ls -al
total 144
drwxr-xr-x 3 root root 78 Mar 29 14:31 volumes
[root@localhost volumes]# pwd
/var/lib/containers/storage/volumes
[root@localhost volumes]# chmod 755 4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb
[root@localhost _data]# pwd
/var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data
[root@localhost _data]# chmod 777 logs/* #νμΌ μμ± κΆν
[root@localhost _data]# chmod 777 logs
16-6. Plugin μ€μΉ - Post build task
16-7. Plugin μ€μΉ - NodeJS
Jenkins λΉλ μ npm not found error
λ°©μ§
Jenkins > Dashboard > Jenkins κ΄λ¦¬ > Plugins > Available plugins
NodeJS
μ ννμ¬ μ€μΉ
Dashboard > Jenkins κ΄λ¦¬ > Tools > NodeJS installations > Add NodeJS
ν΄λ¦
Name : NodeJS 20.9.0
Version : NodeJS 20.9.0
(node -version μΌμΉ)
[root@localhost ~ ]# dnf update -y
Last metadata expiration check: 0:18:29 ago on Fri 29 Mar 2024 02:00:07 PM KST.
Dependencies resolved.
=========================================================================================================================================================================
Package Architecture Version Repository Size
=========================================================================================================================================================================
Installing:
kernel x86_64 5.14.0-432.el9 baseos 66 k
Upgrading:
bpftool x86_64 7.3.0-432.el9 baseos 842 k
# ########### (μ€λ΅) ############
Transaction Summary
=========================================================================================================================================================================
Install 5 Packages
Upgrade 142 Packages
Total download size: 227 M
Downloading Packages:
(1/147): kernel-5.14.0-432.el9.x86_64.rpm 345 kB/s | 66 kB 00:00
(2/147): kernel-core-5.14.0-432.el9.x86_64.rpm 2.2 MB/s | 15 MB 00:06
# ########### (μ€λ΅) ############
[root@localhost ~ ]# dnf module list nodejs
Last metadata expiration check: 0:24:35 ago on Fri 29 Mar 2024 02:00:07 PM KST.
CentOS Stream 9 - AppStream
Name Stream Profiles Summary
nodejs 18 common [d], development, minimal, s2i Javascript runtime
nodejs 20 common [d], development, minimal, s2i Javascript runtime
Hint: [d]efault, [e]nabled, [x]d
[root@localhost ~ ]# dnf module install nodejs:20 -y
Last metadata expiration check: 0:25:33 ago on Fri 29 Mar 2024 02:00:07 PM KST.
Dependencies resolved.
=========================================================================================================================================================================
Package Architecture Version Repository Size
=========================================================================================================================================================================
Installing group/module packages:
nodejs x86_64 1:20.9.0-1.module_el9+743+ad38546c appstream 14 M
npm x86_64 1:10.1.0-1.20.9.0.1.module_el9+743+ad38546c appstream 2.6 M
Installing weak dependencies:
nodejs-docs noarch 1:20.9.0-1.module_el9+743+ad38546c appstream 8.1 M
nodejs-full-i18n x86_64 1:20.9.0-1.module_el9+743+ad38546c appstream 8.5 M
Installing module profiles:
nodejs/common
Enabling module streams:
nodejs 20
Transaction Summary
=========================================================================================================================================================================
Install 4 Packages
Total download size: 33 M
Installed size: 175 M
Downloading Packages:
(1/4): nodejs-docs-20.9.0-1.module_el9+743+ad38546c.noarch.rpm 2.4 MB/s | 8.1 MB 00:03
(2/4): npm-10.1.0-1.20.9.0.1.module_el9+743+ad38546c.x86_64.rpm 1.0 MB/s | 2.6 MB 00:02
(3/4): nodejs-full-i18n-20.9.0-1.module_el9+743+ad38546c.x86_64.rpm 1.3 MB/s | 8.5 MB 00:06
(4/4): nodejs-20.9.0-1.module_el9+743+ad38546c.x86_64.rpm 1.3 MB/s | 14 MB 00:10
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.8 MB/s | 33 MB 00:11
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : nodejs-docs-1:20.9.0-1.module_el9+743+ad38546c.noarch 1/4
# ########### (μ€λ΅) ############
Installed:
nodejs-1:20.9.0-1.module_el9+743+ad38546c.x86_64 nodejs-docs-1:20.9.0-1.module_el9+743+ad38546c.noarch
nodejs-full-i18n-1:20.9.0-1.module_el9+743+ad38546c.x86_64 npm-1:10.1.0-1.20.9.0.1.module_el9+743+ad38546c.x86_64
Complete!
[root@localhost ~ ]# dnf list npm
Last metadata expiration check: 0:27:47 ago on Fri 29 Mar 2024 02:00:07 PM KST.
Installed Packages
npm.x86_64 1:10.1.0-1.20.9.0.1.module_el9+743+ad38546c @appstream
Install NPM (Node Package Manager)
[root@localhost ~ ]# dnf install npm -y
Last metadata expiration check: 0:29:43 ago on Fri 29 Mar 2024 02:00:07 PM KST.
Package npm-1:10.1.0-1.20.9.0.1.module_el9+743+ad38546c.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
πΆ Node.js, NPM λ²μ νμΈ
κ°μΈ λ‘컬 PC λ²μ μ κ°κ° v20.10.0 / 10.2.3
[root@localhost ~ ]# node --version
v20.9.0
[root@localhost ~ ]# npm --version
10.1.0
[root@localhost ProjYj2024]# npm run dev
> [email protected] dev
> quasar dev
sh: line 1: quasar: command not found
ProjYj2024main
Branch μλ .quasar
, node_modules
ν΄λκ° μμ (gitignore μΊμ μμ μ²λ¦¬ git rm -r --cached
μ§ννκΈ° λλ¬Έ)
FileZilla > /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace
> μλμΌλ‘ λ³΅μ¬ λΆμ¬λ£κΈ°
[root@localhost .bin]# npm run dev
> [email protected] dev
> quasar dev
sh: line 1: /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024/node_modules/.bin/quasar: Permission denied
[root@localhost .bin]# pwd
/var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024/node_modules/.bin
[root@localhost .bin]# chmod 755 *
πΆ 9000 Port μμ νμ©
λ°©νλ²½μ 9000 Portλ₯Ό μμ νμ©μΌλ‘ λ±λ‘ λ° μ¬μ€ν
[root@localhost ~ ]# firewall-cmd --permanent --zone=public --add-port=9000/tcp
success
[root@localhost ~ ]# firewall-cmd --reload
success
[root@localhost ~ ]# firewall-cmd --list-port
3306/tcp 3389/tcp 8070/tcp 8888/tcp 9000/tcp
/projyjengine
κ²½λ‘μ logs
, projyj
, blib
λλ ν 리 μμ±
[root@localhost projyjengine]# pwd
/projyjengine
[root@localhost projyjengine]# mkdir logs
[root@localhost projyjengine]# mkdir projyj
[root@localhost projyjengine]# mkdir blib
[root@localhost projyjengine]# ls
blib projyj logs
18-1. FTP νμΌ μ
λ‘λ
FileZilla > C:\home\projyj\projyjengine\blib
μ ν΄λ λ° νμΌμ /projyjengine/blib
κ²½λ‘μ μ
λ‘λ
λ€μ΄λ‘λ κ²½λ‘ : C:\Users\PROJYJ\PROJYJ_YJ\2. ProjYj\1. μ€μΉ\μλ²νκ²½ ꡬμΆ
Eclipse > ProjYjSvr
μμ€ Export > WAR file > κΈ°λ³Έ μ€μ μΌλ‘ 'Finish'
FileZilla > μμ±λ ProjYjSvr.war
νμΌμ /tomcat/apache-tomcat-8.0.36/webapps
κ²½λ‘μ μ΄λ
[root@localhost webapps]# cd /tomcat/apache-tomcat-8.0.36/webapps
[root@localhost webapps]# ls
docs examples ProjYjSvr.war host-manager manager ROOT
WAR νμΌ μμ± μ μ globals.properties
νμΌμμ DB μ°κ²° μ 보 μμ νμ
# \uc6b4\uc601\uc11c\ubc84 \ud0c0\uc785(WINDOWS, UNIX)
Globals.OsType=UNIX
# G4C \uc5f0\uacb0\uc6a9 IP (localhost)
Globals.LocalIp=192.168.1.111
# DB\uc11c\ubc84 \ud0c0\uc785(mysql,oracle,altibase,tibero) - datasource \ubc0f sqlMap \ud30c\uc77c \uc9c0\uc815\uc5d0 \uc0ac\uc6a9\ub428
Globals.DbType=mysql
Globals.DbServer=192.168.1.111
Globals.DbName=projyj
Globals.UserName=projyj
Globals.Password=password\$\$
# Globals.DbType = mysql
# Globals.UserName=root
# Globals.Password=
# oracle
# Globals.DriverClassName=oracle.jdbc.driver.OracleDriver
# Globals.Url=jdbc:oracle:thin:@192.168.1.104:1521:ORCL
# mysql
Globals.DriverClassName=net.sf.log4jdbc.DriverSpy
Globals.Url=jdbc:mysql://192.168.1.111:3306/projyj
WAR νμΌ νλ¦° νμ κ²½λ‘ : /tomcat/apache-tomcat-8.0.36/webapps/ProjYjSvr/WEB-INF/classes/egovframework/egovProps
πΆ Could not open JDBC Connection
globals.properties
> νΉμλ¬Έμλ μμ¬λμ¬(\
) λΆμΌ κ² : Globals.Password=password\$\$
μμ¬λμ¬ λΆμ΄μ§ μμΌλ©΄ μλμ κ°μ μ€λ₯κ° λ°μλ¨
μλ¬ νμ
λ¬Έκ΅¬κ° loadError : xhr=[object Object], st=parseerror, err=SyntaxError: Unexpected token '<',"
μ΄κ³ ,
ProjYjServer.log
λ‘κ·Έ λ©μμ§κ° μλμ κ°μ
2024-04-01 15:45:34,148 ERROR [egovframework.projsvr.service.impl.OptionServiceImpl] Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user ' projyj' @' 192.168.1.999' (using password: YES))
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user ' projyj' @' 192.168.1.999' (using password: YES))
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) ~ [commons-dbcp-1.4.jar:1.4]
(...μ€λ΅)
Caused by: java.sql.SQLException: Access denied for user ' projyj' @' 192.168.1.999' (using password: YES)
19-2. MySQL DB λ°μ΄ν° μΈν
bmig_option_tbl
ν
μ΄λΈμ κ° μΌλΆ λ³κ²½
WasURL : http://192.168.1.111:8070/ProjYjSvr/projsvr
JVM : /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-4.el9.x86_64/jre/bin/java
JarHome : /projyjengine
./startup.sh
μ€ννμ¬ WAR νμΌμ΄ νλ¦° κ² νμΈ
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /tomcat/apache-tomcat-8.0.36
Using CATALINA_HOME: /tomcat/apache-tomcat-8.0.36
Using CATALINA_TMPDIR: /tomcat/apache-tomcat-8.0.36/temp
Using JRE_HOME: /usr
Using CLASSPATH: /tomcat/apache-tomcat-8.0.36/bin/bootstrap.jar:/tomcat/apache-tomcat-8.0.36/bin/tomcat-juli.jar
Tomcat started.
[root@localhost bin]# cd ../webapps/
[root@localhost webapps]# ls
docs examples ProjYjSvr ProjYjSvr.war host-manager manager ROOT
λ‘κ·ΈμΈ ν
μ€νΈκΉμ§ μλ£λλ©΄ OK (ID : admin
/ PW : admin
)
log4j2.xml
> <RollingFile name="rollingFile" fileName="/home/projyj/tomcat/projyjlog/ProjYjServer.log"
κ²½λ‘ νμΈ
[root@localhost projyjlog]# cd /home/projyj/tomcat/projyjlog
[root@localhost projyjlog]# tail -f ProjYjServer.log
.bash_aliases
νμΌ μμ±νμ¬ alias λ±λ‘
[root@localhost ~ ]# ls -al | grep bashrc
-rw-r--r--. 1 root root 429 Aug 10 2021 .bashrc
[root@localhost ~ ]# vi .bash_aliases
alias zlog=' tail -f /home/projyj/tomcat/projyjlog/ProjYjServer.log'
alias ztc=' cd /tomcat/apache-tomcat-8.0.36/bin/'
alias zstart=' /tomcat/apache-tomcat-8.0.36/bin/startup.sh'
alias zshut=' /tomcat/apache-tomcat-8.0.36/bin/shutdown.sh'
source .bash_aliases
λͺ
λ Ήμ΄λ₯Ό μ€νν΄μΌ μ¬μ© κ°λ₯
19-4. λλ½ νμΌ μΆκ°
Monitoring* νμΌμ΄ λλ½λμ΄ κ° κ²½λ‘μ μΆκ°ν¨
.class λ€μ΄λ‘λ κ²½λ‘ : C:\Users\PROJYJ\PROJYJ_YJ\2. ProjYj\1. μ€μΉ\μλ²νκ²½ ꡬμΆ\λλ½ νμΌ
ProjYjSvr νλ‘μ νΈ μ체μ μΆκ°νμ¬ WAR νμΌ Export νλ κ²μΌλ‘ λ³κ²½ (24.04.03)
.java λ€μ΄λ‘λ κ²½λ‘ : C:\Users\PROJYJ\PROJYJ_YJ\2. ProjYj\1. μ€μΉ\ProjYjWAS λλ½νμΌ
.war νμΌ κ²½λ‘ : C:\Users\PROJYJ\PROJYJ_YJ\2. ProjYj\1. μ€μΉ\μλ²νκ²½ ꡬμΆ
[root@localhost projsvr]# pwd # MonitoringController / MonitoringService / MonitoringServiceImpl / MonitoringDAO
/tomcat/apache-tomcat-8.0.36/webapps/ProjYjSvr/WEB-INF/classes/egovframework/projsvr
[root@localhost projsvr]# pwd # Monitoring_SQL_Mysql
/tomcat/apache-tomcat-8.0.36/webapps/ProjYjSvr/WEB-INF/classes/egovframework/sqlmap/projsvr
[root@localhost egovframework]# find | grep Monitoring
./projsvr/controller/MonitoringController.class
./projsvr/dao/MonitoringDAO.class
./projsvr/service/impl/MonitoringServiceImpl.class
./projsvr/service/MonitoringService.class
./sqlmap/projsvr/Monitoring_SQL_Mysql.xml
ProjYj2024
νλ‘μ νΈ μ€ν
17-3-npm-run-dev μ μ μ°¨ μν ν λ€μ npm run dev
[root@localhost ProjYj2024]# npm run dev
> [email protected] dev
> quasar dev
.d88888b.
d88P" " Y88b
888 888
888 888 888 888 8888b. .d8888b 8888b. 888d888
888 888 888 888 " 88b 88K " 88b 888P"
888 Y8b 888 888 888 .d888888 " Y8888b. .d888888 888
Y88b.Y8b88P Y88b 888 888 888 X88 888 888 888
" Y888888" " Y88888 " Y888888 88888P' "Y888888 888
Y8b
Β» Reported at............ 3/29/2024 3:28:11 PM
Β» App dir................ /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024
Β» App URL................ http://localhost:9000/
http://192.168.1.999:9000/
http://192.168.1.111:9000/
http://10.88.0.1:9000/
Β» Dev mode............... spa
Β» Pkg quasar............. v2.14.1
Β» Pkg @quasar/app-vite... v1.7.0
Β» Browser target......... es2019|edge88|firefox78|chrome87|safari13.1
App β’ Opening default browser at http://localhost:9000/
You installed esbuild on another platform than the one you' re currently using.
This won' t work because esbuild is written with native code and needs to
install a platform-specific binary executable.
Specifically the "esbuild-windows-64" package is present but this platform
needs the "esbuild-linux-64" package instead. People often get into this
situation by installing esbuild on Windows or macOS and copying "node_modules"
into a Docker image that runs Linux, or by copying "node_modules" between
Windows and WSL environments.
If you are installing with npm, you can try not copying the "node_modules"
directory when you copy the files over, and running "npm ci" or "npm install"
on the destination platform after the copy. Or you could consider using yarn
instead which has built-in support for installing a package on multiple
platforms simultaneously.
If you are installing with yarn, you can try listing both this platform and the
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
Another alternative is to use the "esbuild-wasm" package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the "esbuild" package, so you may also not
want to do that.
App β’ β οΈ Failed to open default browser
πΆ 2024.03.29 νμ¬ μν©
http://192.168.1.111:9000/ μ μ μ μ°κ²°μ λλ, console μ°½μ λ€μ λ΄μ©λ§ μΆλ ₯λκ³ μ무κ²λ λ¨μ§ μμ
npm run dev
μ€ν μνλ₯Ό μ’
λ£νλ©΄ 'μ¬μ΄νΈμ μ°κ²°ν μ μμ' μ΄ λ¨λ κ²μΌλ‘ 보μ μ€νμ λμμ
/* console μ°½ */
[ vite ] connecting ... client . ts :16
[ vite ] connected . client . ts :53
πΆ 2024.03.29 μ€λ₯ λ΄μ©
νμ¬ μ¬μ© μ€μΈ νλ«νΌμ΄ μλ λ€λ₯Έ νλ«νΌμ esbuildλ₯Ό μ€μΉνμ΅λλ€.
esbuildλ λ€μ΄ν°λΈ μ½λλ‘ μμ±λμμΌλ©° λ€μμ μνν΄μΌ νκΈ° λλ¬Έμ μ΄λ μλνμ§ μμ΅λλ€.
νλ«νΌλ³ λ°μ΄λ리 μ€ν νμΌμ μ€μΉν©λλ€.
νΉν "esbuild-windows-64" ν¨ν€μ§κ° μμ§λ§ μ΄ νλ«νΌμ λμ "esbuild-linux-64" ν¨ν€μ§κ° νμν©λλ€.
Windows λλ macOSμ esbuildλ₯Ό μ€μΉνκ³ "node_modules"λ₯Ό 볡μ¬νμ¬ μν©μ ν΄κ²°νμΈμ.
Linuxλ₯Ό μ€ννλ Docker μ΄λ―Έμ§λ‘ λλ "node_modules"λ₯Ό 볡μ¬νμ¬ Windows λ° WSL νκ²½.
npmμΌλ‘ μ€μΉνλ κ²½μ° "node_modules"λ₯Ό 볡μ¬νμ§ μμλ λ©λλ€.
νμΌμ 볡μ¬νκ³ "npm ci" λλ "npm install"μ μ€νν λ λλ ν°λ¦¬ λ³΅μ¬ ν λμ νλ«νΌμμ. μλλ©΄ μμ¬ μ¬μ©μ κ³ λ €ν μλ μμ΅λλ€.
λμ μ¬λ¬ κ³³μ ν¨ν€μ§λ₯Ό μ€μΉνλ κΈ°λ₯μ΄ λ΄μ₯λμ΄ μμ΅λλ€.
(μ€λ΅)
20-1. You installed esbuild on another platform ν΄κ²°
[root@localhost ProjYj2024]# ls
index.html node_modules package-lock.json public README.md test1-src240131am.zip test1-src240205pm.zip test1-src240216pm.zip
jsconfig.json package.json postcss.config.cjs quasar.config.js src test1-src240201pm.zip test1-src240213pm.zip
[root@localhost ProjYj2024]# rm -rf node_modules/
npm i
λ‘ λ€μ install νμ¬, node_modules
ν΄λ μμ±λ κ² νμΈ
[root@localhost ProjYj2024]# npm i
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ' [email protected] ' ,
npm WARN EBADENGINE required: { node: ' ^18 || ^16 || ^14.19' , npm: ' >= 6.13.4' , yarn: ' >= 1.21.1' },
npm WARN EBADENGINE current: { node: ' v20.9.0' , npm: ' 10.1.0' }
npm WARN EBADENGINE }
added 424 packages, and audited 425 packages in 9s
84 packages are looking for funding
run ` npm fund` for details
3 vulnerabilities (2 moderate, 1 high)
To address all issues, run:
npm audit fix
Run ` npm audit` for details.
[root@localhost ProjYj2024]# ls
index.html node_modules package-lock.json public README.md test1-src240131am.zip test1-src240205pm.zip test1-src240216pm.zip
jsconfig.json package.json postcss.config.cjs quasar.config.js src test1-src240201pm.zip test1-src240213pm.zip
[root@localhost ProjYj2024]# npm run dev
> [email protected] dev
> quasar dev
.d88888b.
d88P" " Y88b
888 888
888 888 888 888 8888b. .d8888b 8888b. 888d888
888 888 888 888 " 88b 88K " 88b 888P"
888 Y8b 888 888 888 .d888888 " Y8888b. .d888888 888
Y88b.Y8b88P Y88b 888 888 888 X88 888 888 888
" Y888888" " Y88888 " Y888888 88888P' "Y888888 888
Y8b
Β» Reported at............ 4/12/2024 10:14:15 AM
Β» App dir................ /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024
Β» App URL................ http://localhost:9000/
http://192.168.1.999:9000/
http://192.168.1.111:9000/
http://10.88.0.1:9000/
Β» Dev mode............... spa
Β» Pkg quasar............. v2.14.1
Β» Pkg @quasar/app-vite... v1.7.0
Β» Browser target......... es2019|edge88|firefox78|chrome87|safari13.1
App β’ Opening default browser at http://localhost:9000/
App β’ β οΈ Failed to open default browser
21. Jenkins λΉλ λ° μ€ν
μ μμ μΌλ‘ ProjYj2024
κ° μ€νλλ―λ‘, npm run dev
κ° μλ μ€νλλλ‘ λ³κ²½
21-1. log νμΌ μμ± κ²½λ‘ μΈν
log νμΌμ μ μ₯ν ProjYj2024_log
ν΄λ μμ±
κ²½λ‘ : /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/logs
[root@localhost logs]# pwd
/var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/logs
[root@localhost logs]# mkdir ProjYj2024_log
[root@localhost logs]# chmod 777 ProjYj2024_log/
[root@localhost logs]# ls -al
total 8
drwxrwxrwx 2 root root 6 Apr 12 17:18 ProjYj2024_log
drwxr-xr-x 2 root root 4096 Apr 12 03:01 tasks
21-2. npmrun.sh νμΌ μμ±
npmrun.sh
νμΌ μμ± λ° κΆν λΆμ¬
κ²½λ‘ : /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data
[root@localhost _data]# pwd
/var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data
[root@localhost _data]# vi npmrun.sh
[root@localhost _data]# chmod 777 npmrun.sh
νμΌμ μ΄μ΄ μλμ κ°μ΄ νΈμ§
#! /bin/sh
nowDate=` date " +%Y-%m-%d_%H:%M:%S" `
fileName=" ProjYj2024_$nowDate .log"
cd ./workspace/ProjYj2024/ProjYj2024
pwd
nohup npm run dev > ../../../logs/ProjYj2024_log/$fileName &
μ€ν ν log νμΌμ΄ μ μμ μΌλ‘ μμ±λλμ§ νμΈ
[root@localhost _data]# ./npmrun.sh
/var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024
[root@localhost _data]# nohup: redirecting stderr to stdout
[root@localhost _data]# cd logs/ProjYj2024_log/
[root@localhost ProjYj2024_log]# ls
ProjYj2024_2024-04-12_13:57:26.log
πΆ λ°±κ·ΈλΌμ΄λ μ€ν μ€λ¨μν€κΈ°
ps -ef | grep "quasar dev"
: npm run dev
λ‘ μΈν΄ μ€νλ λͺ©λ‘ νμΈ λ° μ€λ¨
[root@localhost ProjYj2024]# ps -ef | grep "quasar dev"
root 1131847 1131836 0 11:49 pts/0 00:00:00 node /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024/node_modules/.bin/quasar dev
root 1131951 1131940 0 11:50 pts/0 00:00:00 node /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024/node_modules/.bin/quasar dev
root 1132841 1124565 0 11:56 pts/0 00:00:00 grep --color=auto quasar dev
[root@localhost ProjYj2024]# kill -9 1131847
[root@localhost ProjYj2024]# kill -9 1131951
[2]- Exit 137 nohup ./startup.sh (wd: /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace)
(wd now: /var/lib/containers/storage/volumes/4e56f41adaca53fa1652bb2d5e0aaa4f80905a278588c911343a283eb21be2fb/_data/workspace/ProjYj2024/ProjYj2024)
Jenkins λΉλ ν μ‘°μΉλ μλ λ κ°μ§ λ°©λ²μΌλ‘ ν μ μμ
Item > Configure > Build Steps > Execute shell
Item > Configure > λΉλ ν μ‘°μΉ > Post build task
Command : podman exec -it jenkins /bin/bash
μμ 보λ κ²½λ‘ κΈ°μ€μΌλ‘ μμ±νκ² λ¨
무쑰건 μ€νλλ λͺ
λ Ήμ΄λ‘, Command
μ μμ±
echo " ProjYj2024 BUILD > Execute shell START ======================="
echo " ProjYj2024 BUILD > Execute shell END ======================="
μ§κΈ λΉλ
> Console Output νμΈ
ProjYj2024 BUILD > Execute shell START =======================
ProjYj2024 BUILD > Execute shell END =======================
쑰건μ λ°λΌ μ€νλλ λͺ
λ Ήμ΄λ‘, Script
μ μμ±
git rev-list --no-walk
λΌλ ν€μλκ° log μ μΆλ ₯λλ©΄(μ¦, μ±κ³΅νλ©΄) μ€ννλλ‘ κ΅¬μ±
echo " ProjYj2024 BUILD > Post build task START ======================="
cd /var/jenkins_home
pwd
ps -ef | grep " quasar dev"
./npmrun.sh
ps -ef | grep " quasar dev"
echo " ProjYj2024 BUILD > Post build task END ======================="
Jenkins μ NodeJS νλ¬κ·ΈμΈ λ―Έμ€μΉ μ μ€λ₯ λ°μ
ssh μ€ν μ, npm: not found
문ꡬ μΆλ ₯
jenkins@d7020c058f90:~ $ ./npmrun.sh
/var/jenkins_home/workspace/ProjYj2024/ProjYj2024
./npmrun.sh: 7: npm: not found
Jenkins λΉλ μ nohup: failed to run command 'npm': No such file or directory
문ꡬ μΆλ ₯
Plugin μ€μΉ - NodeJS λ΄μ©λ μννμμΌλ, κ³μ μ€λ₯ λ°μνλ μν©
μλ μ€νμ νμ¬ μλκ³ μμ > μ°μ μ μ§μ ./npmrun.sh
μ μννλ λ°©μμΌλ‘ μ§ν