๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ปTech/๐ŸงLinux37

[๋ฆฌ๋ˆ…์Šค] resolv.conf ์›๋ณต ํ˜„์ƒ ์กฐ์น˜๋ฐฉ๋ฒ• ์„œ๋ฒ„๊ฐ€ ์žฌ๊ธฐ๋™ ๋˜๋ฉด์„œ /etc/resolv.conf ํŒŒ์ผ์˜ ๋ณ€๊ฒฝ ๋‚ด์šฉ์ด ์›๋ณต๋˜๋Š” ํ˜„์ƒ์— ๋Œ€ํ•œ ์กฐ์น˜ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ํŒŒ์ผ์˜ ๋ณ€๊ฒฝ ๋‚ด์šฉ์ด ์„œ๋ฒ„ ์žฌ๊ธฐ๋™ ํ›„์— ์›๋ณต๋˜๋Š” ํ˜„์ƒ์€ ์ฃผ๋กœ ๋„คํŠธ์›Œํฌ ๊ด€๋ฆฌ ๋„๊ตฌ๋‚˜ ์„œ๋น„์Šค์— ์˜ํ•ด ํŒŒ์ผ์ด ์ž๋™์œผ๋กœ ๊ด€๋ฆฌ๋˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. โ—พ /etc/resolv.conf ์ˆ˜์ •, ์‚ญ์ œ ์ œํ•œ ์ง์ ‘ ํŽธ์ง‘ํ•˜์ง€ ๋ชปํ•˜๋„๋ก chattr +i ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ํŒŒ์ผ์„ ์ž ๊ธˆ ## ์ž ๊ธˆ chattr +i /etc/resolv.conf ## ์ž ๊ธˆ ํ•ด์ œ chattr -i /etc/resolv.conf 2023. 11. 21.
[๋ฆฌ๋ˆ…์Šค] LVM ์„ค์ • ๋ฐฉ๋ฒ• ๋ฆฌ๋ˆ…์Šค์˜ LVM(Logical Volume Manager)์€ ์Šคํ† ๋ฆฌ์ง€ ๊ด€๋ฆฌ์˜ ์œ ์—ฐํ•œ ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. LVM์„ ์‚ฌ์šฉํ•˜๋ฉด ์—ฌ๋Ÿฌ ๋””์Šคํฌ๋ฅผ ํ•˜๋‚˜์˜ ํฐ ๋””์Šคํฌ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜, ํ•„์š”์— ๋”ฐ๋ผ ์Šคํ† ๋ฆฌ์ง€ ํฌ๊ธฐ๋ฅผ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.LVM ์ฃผ์š” ๊ตฌ์„ฑ ์š”์†ŒPV (Physical Volume): ์‹ค์ œ ๋””์Šคํฌ ํŒŒํ‹ฐ์…˜์œผ๋กœ, LVM์—์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ํ•˜๋“œ ๋“œ๋ผ์ด๋ธŒ์˜ ํŒŒํ‹ฐ์…˜์ด๋‚˜ ์ „์ฒด ๋“œ๋ผ์ด๋ธŒ๊ฐ€ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.VG (Volume Group): ํ•˜๋‚˜ ์ด์ƒ์˜ PV๋ฅผ ๊ฒฐํ•ฉํ•˜์—ฌ ์ƒ์„ฑ๋œ ์ €์žฅ์†Œ์˜ ๋…ผ๋ฆฌ์  ๊ทธ๋ฃน์ž…๋‹ˆ๋‹ค. VG๋Š” ํ•˜๋‚˜ ์ด์ƒ์˜ LV๋ฅผ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.LV (Logical Volume): VG ๋‚ด์—์„œ ์ƒ์„ฑ๋˜๋Š” ๋…ผ๋ฆฌ์  ๋‹จ์œ„๋กœ, ์‹ค์ œ ํŒŒ์ผ ์‹œ์Šคํ…œ์ด ์ƒ์„ฑ๋˜๋Š” ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. LV๋Š” ํ•„์š”์— ๋”ฐ๋ผ ํฌ๊ธฐ๋ฅผ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.PE .. 2023. 11. 20.
[๋ฆฌ๋ˆ…์Šค] ulimit ์„ค์ •ํ•˜์—ฌ ์„ฑ๋Šฅ ์ œํ•œ ํ•ด์ œ open file๊ณผ process ์ƒ์„ฑ ์ œํ•œ ๊ด€๋ จ ์˜ˆ์™ธ ๋ฐœ์ƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์„ค์ •ํ•ด์ค๋‹ˆ๋‹ค. โ—พ limit values ์ˆ˜์ • vi /etc/security/limits.conf ------------------------------ * - nofile 65536 * - nproc 65536 ------------------------------ (- : soft, hard ๋™์ผํ•˜๊ฒŒ ์ ์šฉ) โ—พ ulimit ์กฐํšŒ ๋ช…๋ น์–ด ulimit -a ----------------------------------------- open files (-n) 65536 max user processes (-u) 65536 2023. 8. 21.
[๋ฆฌ๋ˆ…์Šค] ssh ํŒจ์Šค์›Œ๋“œ ์ž…๋ ฅ์—†์ด ์ ‘์† (passwordless) ๋ฆฌ๋ˆ…์Šค์—์„œ ํŒจ์Šค์›Œ๋“œ ์ž…๋ ฅ ์—†์ด ssh ์ ‘์†ํ•˜๋Š” 2๊ฐ€์ง€ ๋ฐฉ๋ฒ• ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค. 1. ํŒจ์Šค์›Œ๋“œ ์ž…๋ ฅ ์—†์ด ์ ‘์†ํ•  ์„œ๋ฒ„์— ์•”ํ˜ธํ™” ํ‚ค๋ฅผ ๋“ฑ๋กํ•˜์—ฌ ์ž๋™๋กœ๊ทธ์ธ์„ ํ•ฉ๋‹ˆ๋‹ค. โ—พ rsa ํ‚ค ์ƒ์„ฑ์ด ์•ˆ๋˜์žˆ์„ ๊ฒฝ์šฐ ์ƒ์„ฑํ•ด ์ค๋‹ˆ๋‹ค. ssh-keygen -t rsa Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): ## ()๊ด„ํ˜ธ ์œ„์น˜๋กœ ์‚ฌ์šฉํ•  ๊ฑฐ๋ฉด Enter Enter passphrase (empty for no passphrase): ## ํŒจ์Šค์›Œ๋“œ ์—†์ด ์‚ฌ์šฉํ•  ๊ฑฐ๋ฉด Enter Enter same passphrase again: ## Enter โ—พ authorized_keys ํŒŒ์ผ์ด ์—†์œผ๋ฉด ์ƒ์„ฑํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. chmod 700 ~/.ssh ## 700์œผ๋กœ ๊ถŒํ•œ ๋ณ€๊ฒฝ cd.. 2023. 8. 21.
[๋ฆฌ๋ˆ…์Šค] JupyterHub ์„ค์น˜ ๋ฐฉ๋ฒ• ๋ฆฌ๋ˆ…์Šค ํ™˜๊ฒฝ (CentOS 7, Python3.8)์—์„œ JupyterHub ์„ค์น˜ ๋ฐฉ๋ฒ• ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜ ์ „ Jupyter ์šฉ์–ด ๊ด€๋ จํ•˜์—ฌ ๊ฐ„๋žตํ•˜๊ฒŒ ์ •๋ฆฌ ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. Jupyter Notebook ๋Œ€ํ™”ํ˜• Python Interpreter๋กœ ์›น ํ™˜๊ฒฝ์—์„œ Python ์ฝ”๋“œ ์ž‘์„ฑ ๋ฐ ์‹คํ–‰ํ•˜๋Š” ๊ฐœ๋ฐœ ํ™˜๊ฒฝ(tool) Jupyter Lab Jupyter Notebook์˜ ์ฐจ์„ธ๋Œ€ ๋ฒ„์ „์œผ๋กœ ์‚ฌ์šฉ์ž ํŽธ์˜ ๊ธฐ๋Šฅ๋“ค์ด ์ถ”๊ฐ€๋จ ๋‹ค์ค‘์ฐฝ ์ง€์›, csv/pdf ๋“ฑ ํŒŒ์ผ๋„ ์—ด ์ˆ˜ ์žˆ์–ด์„œ ๋Œ€์‹œ๋ณด๋“œ์ฒ˜๋Ÿผ ์‚ฌ์šฉ ๊ฐ€๋Šฅ JupyterHub ๋ฉ€ํ‹ฐ ์‚ฌ์šฉ์ž ํ™˜๊ฒฝ์—์„œ Jupyter Notebook/Lab์„ ์‚ฌ์šฉ ๐Ÿ“– ์„ค์น˜ ๋ฐฉ๋ฒ• 1. os ํŒจํ‚ค์ง€ ์„ค์น˜ yum install –y nodejs yum install openssl 2. nodejs ํŒจํ‚ค์ง€ ์„ค์น˜ โ—พ.. 2023. 4. 13.
[๋ฆฌ๋ˆ…์Šค] ์„œ๋ฒ„ Asia/Seoul ํƒ€์ž„์กด ์ ์šฉ timedatectl set-timezone Asia/Seoul 2022. 11. 3.
[๋ฆฌ๋ˆ…์Šค] ์—ฌ๋Ÿฌ jar ํŒŒ์ผ์•ˆ์— class ๋ชฉ๋ก ํ•œ๋ฒˆ์— ์ถœ๋ ฅ ll | grep log4j | awk '{print $9}' | xargs -d '\n' -n 1 jar -tvf find . -name "*.jar" -exec echo ==\ {} \; -exec jar tf {} \;|grep -E "==|HiveMetaStore" 2022. 8. 4.
[๋ฆฌ๋ˆ…์Šค] ํ•˜์œ„ ๋””๋ ‰ํ† ๋ฆฌ ๊ฐ ์‚ฌ์ด์ฆˆ ๋‚ด๋ฆผ์ฐจ์ˆœ ์ถœ๋ ฅ $ du -h --max-depth=1 | sort -rh ----------------------------------------- 138G . 137G ./dfs 1.3G ./yarn 284M ./hadoop-ozone 193M ./kudu ----------------------------------------- 2022. 4. 25.