LINUX
2018.06.06 / 11:34

CentOS ¿¡¼­ ½Ã°£, ŸÀÓÁ¸ ¼³Á¤ ¹æ¹ýÀ» Á¤¸®

ÀλçÀ̵åÀÚ¹Ù
Ãßõ ¼ö 137

CentOS ¿¡¼­ ½Ã°£, ŸÀÓÁ¸ ¼³Á¤ ¹æ¹ýÀ» Á¤¸®Çغ¸°Ú½À´Ï´Ù.




CentOS 7 ºÎÅÍ # timedatectl ¸í·É¾î·Î ½Ã°£, ŸÀÓÁ¸ ¼³Á¤ µî ´Ù¾çÇÑ °ÍÀ» ÇÒ ¼ö ÀÖ½À´Ï´Ù.


# timedatectl


Local time : ÇöÁ¦ ½Ã°£ ÀÔ´Ï´Ù.

Universal time : UTC ±¹Á¦ Ç¥ÁؽàÀÔ´Ï´Ù.

RTC time : Çϵå¿þ¾î ½Ã°è ÀÔ´Ï´Ù.

Time zone : ŸÀÓÁ¸ ÀÔ´Ï´Ù.

NTP enabled : NTP È°¼ºÈ­ ¿©ºÎ ÀÔ´Ï´Ù.

NTP synchronized : NTP µ¿±âÈ­ ¿©ºÎ ÀÔ´Ï´Ù.

RTC in local TZ : RTC ¿Í Time zone ½Ã°£ µ¿±âÈ­ ¿©ºÎ ÀÔ´Ï´Ù.




1. ½Ã°£¼³Á¤ ¹æ¹ý



# timedatectl set-time "2017-07-11"


Failed »çÀ¯¸¦ º¸¸é time synchronizaion ÀÌ È°¼ºÈ­µÇ¾î ¾ÈµÇ´Â °Í ÀÔ´Ï´Ù.


# timedatectl set-ntp no


ntp È°¼³È­¸¦ no ·Î ÇØÁÝ´Ï´Ù.



´Ù½Ã Çغ¸¸é À̹ø¿£ Failed ¾øÀÌ ¼º°øÇÑ°ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.




2. NTP ½Ã°£ µ¿±âÈ­



# timedatectl set-ntp yes


ntp È°¼³È­¸¦ yes ·Î ¹Ù²ãÁÝ´Ï´Ù. ntpd °¡ ¼³Ä¡µÇ¾îÀÖÁö ¾Ê´Ù¸é # yum install -y ntpd ·Î ¼³Ä¡ÇØÁÝ´Ï´Ù.



# systemctl enable ntpd


ntpd ¼­ºñ½º È°¼ºÈ­ ÇÕ´Ï´Ù.


# systemctl start ntpd


ntpd ¼­ºñ½º ½ÇÇà ÇÕ´Ï´Ù. 


½ÇÇàÇϰԵǸé # timedatectl ·Î È®ÀÎÇßÀ»¶§ NTP synchronized °¡ yes °¡ µÈ°É È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.




3. Timezone º¯°æ



# timedatectl list-timezones | grep -i america/n


list-timezones ¿É¼ÇÀ¸·Î timezone ¸®½ºÆ®¸¦ È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.


grep ÀÇ -i ¿É¼ÇÀº ´ë¼Ò¹®ÀÚ ±¸ºÐÀ» ¾øÀÌ grep ÇÕ´Ï´Ù.



# timedate set-timezone America/New_York


timezone À» America/New_York À¸·Î º¯°æÇß½À´Ï´Ù.



Ãß°¡·Î CentOS 6 ÀÌÇÏ ¹öÀü¿¡¼­´Â date -s "2017-07-09 22:00:00" À¸·Î ½Ã°£¼³Á¤ÀÌ °¡´ÉÇÕ´Ï´Ù.



# date




Ãâó: http://jeongyd.tistory.com/49?category=572715 [JeongYD]