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

๐Ÿ’ปTech/๐ŸงLinux37

[๋ฆฌ๋ˆ…์Šค] ๋กœ๊ทธ ์ถ”์ถœ ๋ฐ ์‚ญ์ œ์ฃผ๊ธฐ ์„ค์ • ๐Ÿ“Œ /var/log/message ์˜ ์Œ“์ด๋Š” docker log ๋ณ„๋„ ์ €์žฅ ๋ฐ ์‚ญ์ œ ์ฃผ๊ธฐ ์„ค์ • $ vi /etc/rsyslog.d/10-docker.conf # Docker logging *.* { /var/log/docker/docker.log stop } $ systemctl restart rsyslog $ vi /etc/logrotate.d/docker /var/log/docker/docker.log { size 100M rotate 10 missingok compress } 2022. 3. 4.
[๋ฆฌ๋ˆ…์Šค] ์—ฌ๋Ÿฌ ์„œ๋ฒ„ ์›๊ฒฉ ์ž‘์—… (parallel-ssh, ssh remote shell) ๋ฆฌ๋ˆ…์Šค์—์„œ ์—ฌ๋Ÿฌ ์„œ๋ฒ„๋“ค ๋™์‹œ์— ์ž‘์—…ํ•  ๋•Œ ์œ ์šฉํ•œ 2๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. (parallel-ssh๋ฅผ ์ถ”์ฒœ) โ—พ parallel-ssh ์„ค์น˜ ๋ฐ ์‚ฌ์šฉ 1. ๋‹ค์šด ๋ฐ ์„ค์น˜ pssh-2.3.1.tar.gz ๋‹ค์šด (https://code.google.com/archive/p/parallel-ssh/downloads/) tar xvzf pssh-2.3.1.tar.gz cd pssh-2.3.1 python setup.py install 2. ์ž‘์—… host ํŒŒ์ผ ์ž‘์„ฑ vi allnodes ------------------------------ cdpwork01 cdpwork02 cdpwork03 ------------------------------ 3. keygen ์ƒ์„ฑ ๋ฐ ๋ฐฐํฌ ssh-keygen chmod 700 ... 2021. 3. 4.
[๋ฆฌ๋ˆ…์Šค] yum $releasever ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ• yum repository์—์„œ $releasever ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ ์ž˜๋ชป ์„ค์ •๋˜์–ด ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š”๋ฐ์š” /etc/yum/vars/releasever ์ƒ์„ฑ ๋˜๋Š” ๋ณ€๊ฒฝํ•˜์—ฌ ์กฐ์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๐Ÿšซ ERROR https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7.7-10.el7-x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found ๐Ÿ’ก SOLVED $ echo "7.7" > /etc/yum/vars/releasever ์กฐํšŒ ๋ฐฉ๋ฒ• $ python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.y.. 2020. 4. 1.
[SOLVED] This account is currently not available root ๊ณ„์ •์—์„œ ํƒ€ ๊ณ„์ •์œผ๋กœ ์ „ํ™˜ ์•ˆ๋˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ๐Ÿšซ ERROR /etc/passwd์—์„œ ํ•ด๋‹น ๊ณ„์ •์ด nologin์œผ๋กœ ์„ค์ •๋˜์–ด ์žˆ์–ด์„œ ๊ณ„์ • ์ „ํ™˜์ด ๋˜์ง€ ์•Š์Œ $ su - hdfs This account is currently not available $ cat /etc/passwd | grep hdfs hdfs:x:986:979:Hadoop HDFS:/var/lib/hadoop-hdfs:/sbin/nologin ๐Ÿ’ก SOLVED chsh๋กœ ๊ณ„์ • shell์„ ๋ณ€๊ฒฝ ํ›„ su - hdfs ๋ช…๋ น์ด ์ •์ƒ ์ž‘๋™ ## ์ผ์‹œ์ ์œผ๋กœ ๋ณ€๊ฒฝํ•˜์—ฌ hdfs๋กœ ๊ณ„์ • ์ ‘์† ๋ฐฉ๋ฒ• $ su - hdfs -s /bin/bash ## ์˜๊ตฌ์ ์œผ๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ• $ chsh -s /bin/bash hdfs $ cat /etc.. 2020. 1. 14.
[๋ฆฌ๋ˆ…์Šค] JAVA ํŒŒ์ผ ์‹คํ–‰ ๋ฐฉ๋ฒ• java ํŒŒ์ผ ์ƒ์„ฑํ•˜์—ฌ ๋ฆฌ๋ˆ…์Šค์—์„œ java ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์ฝ”๋“œ๋Š” ๋ฉ”์ธํ•จ์ˆ˜๋กœ ์ž…๋ ฅ๋˜๋Š” ๊ฐ’์„ ์ถœ๋ ฅํ•˜๋Š” ๊ฐ„๋‹จํ•œ ์ฝ”๋“œ๋กœ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค. public class test{ public static void main(String[] args){ for(String arg:args){ System.out.println(arg); } } } 1. java ํŒŒ์ผ ์ปดํŒŒ์ผ - ๋””๋ ‰ํ† ๋ฆฌ ์•ˆ์— ์ž๋ฐ”ํŒŒ์ผ์„ ์ปดํŒŒ์ผํ•˜์—ฌ ํด๋ž˜์Šค ์ƒ์„ฑ - java ํŒŒ์ผ๋ช…๊ณผ ์ฝ”๋“œ ์•ˆ์— class ๋ช…์„ ๋งž์ถฐ์•ผ ํ•จ javac -d . test.java - ์—ฌ๋Ÿฌ lib jar ํŒŒ์ผ์˜ ํด๋ž˜์Šค ํŒจ์Šค ์—ฐ๊ฒฐํ•ด์„œ ์ปดํŒŒ์ผํ•  ๋•Œ javac -d . -cp lib/hadoop-common-2.7.0.jar:lib/hadoop-distcp-2.7.3.jar:lib/.. 2019. 11. 21.
[๋ฆฌ๋ˆ…์Šค] REST API ํ˜ธ์ถœ ๋ฐฉ๋ฒ•(curl) โ—พ curl ๋ช…๋ น์–ด ์‚ฌ์šฉ curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST http://$1/ 2019. 9. 10.
[๋ฆฌ๋ˆ…์Šค] vimrc ์„ค์ • โ—พ vi ๋ณต์‚ฌ ๋ถ™์—ฌ ๋„ฃ๊ธฐ ํ•  ๋•Œ ํƒญ ๋“ค์–ด๊ฐ€๋Š” ํ˜„์ƒ ์กฐ์น˜ โ—พ vi ํŽธ์ง‘๊ธฐ ์ปฌ๋Ÿฌ ๋ณ€๊ฒฝ (์ฃผ์„ ๋“ฑ ๊ฐ€๋…์„ฑ ์ข‹์Œ) vi ~/.vimrc ## ์•„๋ž˜ ๋‚ด์šฉ ์ž…๋ ฅ set paste color ron 2019. 9. 6.
[๋ฆฌ๋ˆ…์Šค] MySQL ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ ์‰˜ ๋ณ€์ˆ˜์— ์ €์žฅ ๐Ÿ“Œ MySQL ๊ฒฐ๊ณผ๋ฅผ ์‰˜ ๋ณ€์ˆ˜์— ์ €์žฅ ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ์‰˜ ๋ณ€์ˆ˜์— ์ €์žฅํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด -N ์˜ต์…˜์„ ๋ถ™์—ฌ์„œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค N : ์ปฌ๋Ÿผ๋ช… ์ œ์™ธํ•œ ์ปฌ๋Ÿผ ๊ฐ’๋งŒ ์ถœ๋ ฅ RESULT=$(mysql -N -h'abc-01' -u'user' -p'1234' TEST_TABLE -e"select a,b from test") i=`expr index "$RESULT" "๊ตฌ๋ถ„์ž"` A=${RESULT:0:$i-1} B=${RESULT:$i-1} 2019. 9. 4.