{"id":1913,"date":"2013-03-31T23:34:51","date_gmt":"2013-03-31T20:34:51","guid":{"rendered":"http:\/\/www.koraykey.com\/?p=1913"},"modified":"2013-05-20T21:53:25","modified_gmt":"2013-05-20T18:53:25","slug":"linux-isletim-sistemlerinde-ntp-yapilandirmasi","status":"publish","type":"post","link":"https:\/\/www.koraykey.com\/?p=1913","title":{"rendered":"Linux \u0130\u015fletim Sistemlerinde NTP Yap\u0131land\u0131rmas\u0131"},"content":{"rendered":"<p style=\"text-align: justify;\"><a href=\"http:\/\/www.koraykey.com\/wp-content\/uploads\/LinuxAll.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-797\" alt=\"LinuxAll\" src=\"http:\/\/www.koraykey.com\/wp-content\/uploads\/LinuxAll.jpg\" width=\"250\" height=\"250\" srcset=\"https:\/\/www.koraykey.com\/wp-content\/uploads\/LinuxAll.jpg 250w, https:\/\/www.koraykey.com\/wp-content\/uploads\/LinuxAll-150x150.jpg 150w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Bu makalemizde Linux \u0130\u015fletim Sistemlerinde NTP (Zaman Sunucusu) yap\u0131land\u0131rmas\u0131n\u0131 inceleyece\u011fiz.<\/span><\/p>\n<p style=\"text-align: justify;\"><strong><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">NTP Nedir ?<\/span><\/strong><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">&#8220;NTP Network Time Protocol&#8221;\u00fcn k\u0131saltmas\u0131d\u0131r. T\u00fcrk\u00e7esi A\u011f Zaman Protokol\u00fc&#8217;d\u00fcr. NTP, de\u011fi\u015fken gecikmeye sahip paket anahtarlamal\u0131 a\u011flar \u00fczerindeki bilgisayarlar\u0131n saatlerinin e\u015f zamanlanmas\u0131n\u0131n sa\u011flanmas\u0131 i\u00e7in kullan\u0131lan bir protokold\u00fcr. Protokol, jitter buffer kullan\u0131m\u0131 sayesinde \u00f6zellikle de\u011fi\u015fken gecikmenin etkilerine kar\u015f\u0131 diren\u00e7li olacak \u015fekilde tasar\u0131mlanm\u0131\u015ft\u0131r. NTP, hala kullan\u0131lan en eski Internet protokollerinden biridir. (1985&#8217;den beri). \u0130lk olarak g\u00f6n\u00fcll\u00fc bir ekip ile bu konuda destek sa\u011flamaya devam eden Delaware \u00dcniversitesinden David L. Mills taraf\u0131ndan tasar\u0131mlanm\u0131\u015ft\u0131r. NTP, 123 no&#8217;lu port \u00fczerinden, Kullan\u0131c\u0131 Datagram Protokol\u00fc (UDP)&#8217;n\u00fc kullan\u0131r. NTP ayarlar\u0131 hangi Linux da\u011f\u0131t\u0131m\u0131n kullan\u0131ld\u0131\u011f\u0131na ba\u011fl\u0131 olarak ya \/etc\/ntp.conf ya da \/etc\/xntp.conf dosyas\u0131ndan yap\u0131l\u0131r.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">\u015eimdi yap\u0131land\u0131rmam\u0131za ge\u00e7elim. Yap\u0131land\u0131rmam\u0131z\u0131 &#8220;NTP Client ve &#8220;NTP Server&#8221; ad\u0131nda iki ba\u015fl\u0131kta inceleyece\u011fiz. Ayr\u0131ca &#8220;Oracle Real Application Cluster&#8221; ortamlar\u0131 i\u00e7in yap\u0131land\u0131rmay\u0131da inceleyece\u011fiz.<br \/>\n<\/span><\/p>\n<p style=\"text-align: justify;\"><strong><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">NTP Client<\/span><\/strong><\/p>\n<p style=\"text-align: justify;\">1. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Sunucumuzda &#8220;root&#8221; kullan\u0131c\u0131s\u0131 ile oturum a\u00e7\u0131yoruz ve NTP paketimizi kuruyoruz.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># yum install ntp<\/span><\/pre>\n<p style=\"text-align: justify;\">2. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Sunucumuzda NTP Servisini ba\u015fl\u0131yoruz ve ayn\u0131 zamanda sunucumuz a\u00e7\u0131l\u0131rken otomatik ba\u015flamas\u0131 i\u00e7in gerekli yap\u0131land\u0131rmay\u0131 yap\u0131yoruz.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># service ntpd start<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># chkconfig ntpd on<\/span><\/pre>\n<p style=\"text-align: justify;\">3. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">NTP servisimizde herhangi bir yap\u0131land\u0131rma yapacaksak &#8220;\/etc\/ntp.conf&#8221; dosyas\u0131nda yap\u0131yoruz.<br \/>\n<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># vim \/etc\/ntp.conf<\/span><\/pre>\n<p style=\"text-align: justify;\">4. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">E\u011fer bu dosyada herhangi bir ayar de\u011fi\u015ftirirsek NTP Servisimizi yeniden ba\u015flatmal\u0131y\u0131z.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># service ntpd restart<\/span><\/pre>\n<p style=\"text-align: justify;\">5. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">G\u00fcvenlik Duvar\u0131m\u0131z\u0131n (Firewall) a\u00e7\u0131ksa NTP servisimizin \u00e7al\u0131\u015fabilmesi i\u00e7in\u00a0 Firewall servisinde gerekli d\u00fczenlemeyi yapmam\u0131z gerekiyor. E\u011fer Firewall servisimiz kapal\u0131ysa bu ad\u0131m\u0131 atlayabiliriz.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># iptables -A INPUT -p udp --dport 123 -j ACCEPT<\/span><\/pre>\n<p style=\"text-align: justify;\"><strong><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">A-) NTP \u0130stemci Yap\u0131land\u0131rmas\u0131<\/span><\/strong><\/p>\n<p style=\"text-align: justify;\">1. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">NTP yap\u0131land\u0131rma dosyas\u0131 &#8220;\/etc\/ntp.conf&#8221; i\u00e7erisine zaman sunucular\u0131m\u0131z\u0131n adreslerini ekliyoruz.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># vim \/etc\/ntp.conf<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"><span style=\"color: #222222; font-family: BatangChe;\">-- <\/span>Dosyas\u0131n\u0131 a\u00e7\u0131yoruz. A\u015fa\u011f\u0131daki sat\u0131r\u0131 bulup sunucular\u0131m\u0131z\u0131 ekliyoruz.<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">Yerel a\u011f\u0131m\u0131zda bulunan bir zaman sunucusunu ekleyeceksek <\/span><span style=\"font-family: courier new,courier; font-size: 12px;\">a\u015fa\u011f\u0131daki gibi\r\nsonunda \"ibtrust\" \"parametresiyle eklemeliyiz.<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># Use public servers from the pool.ntp.org project.<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># Please consider joining the pool (http:\/\/www.pool.ntp.org\/join.html).<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">server koraykey-ntp.koraykey.com iburst<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">server 0.rhel.pool.ntp.org<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">server 1.rhel.pool.ntp.org<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">server 2.rhel.pool.ntp.org\r\n<\/span><\/pre>\n<p style=\"text-align: justify;\">2. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Bu de\u011fi\u015fiklikleri yapt\u0131ktan sonra ayarlar\u0131n ge\u00e7erli olabilmesi i\u00e7in servisimizi yeniden ba\u015flat\u0131yoruz.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># service ntpd restart\r\nShutting down ntpd: [\u00a0 OK\u00a0 ]\r\nStarting ntpd: [\u00a0 OK\u00a0 ]\r\n<\/span><\/pre>\n<p style=\"text-align: justify;\">3. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Yerel a\u011f ortam\u0131m\u0131z\u0131nda veya di\u011fer sunucumuzun zaman\u0131n\u0131 sorgulayarak do\u011frulu\u011funu veya sunucumuza eri\u015filebilirlik durumunu kontrol edebiliriz.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># ntpdate -u 0.koraykey-ntp.koraykey.com<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">31 Mar 22:59:23 ntpdate[3331]: adjust time server 192.168.2.1 offset -0.001525 sec<\/span><\/pre>\n<p style=\"text-align: justify;\"><strong><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">B-) NTP Server Yap\u0131land\u0131rmas\u0131<\/span><\/strong><\/p>\n<p style=\"text-align: justify;\">1. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Sunucumuzu NTP Server hizmeti verecek \u015fekilde yap\u0131land\u0131rmak istiyorsak yukar\u0131daki kurulum ad\u0131mlar\u0131ndan sonra yine &#8220;\/etc\/ntp.conf&#8221; dosyas\u0131nda gerekli d\u00fczenlemeleri yapmal\u0131y\u0131z. Sunucumuz kendi tarih ve zaman\u0131n\u0131 g\u00fcncelleyebilmesi i\u00e7in internet \u00fczerindeki sunuculara eri\u015febilmesi gerekmektedir. Aksi takdirde sunucumuzun ayarlar\u0131n\u0131 elle kendimiz yapmam\u0131z gerekmektedir. Ayr\u0131ca sunucumuzun yerel a\u011fda bulunan bilgisayarlara hizmet verebilmesi i\u00e7in g\u00fcvenlik ayar\u0131n\u0131n yap\u0131lmas\u0131 gerekmektedir.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># vim \/etc\/ntp.conf<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">-- Dosyas\u0131n\u0131 a\u00e7\u0131yoruz. A\u015fa\u011f\u0131daki sat\u0131r\u0131 bulup yerel a\u011f <\/span><span style=\"font-family: courier new,courier; font-size: 12px;\">bilgilerimizi d\u00fczenliyoruz.\r\nB\u00f6ylece yerel a\u011fdaki bilgisayarlar\u0131m\u0131z\u0131n sunucumuzdan NTP hizmeti alabilmesini\r\nsa\u011fl\u0131yoruz.<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># Hosts on local network are less restricted.<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap<\/span><\/pre>\n<p style=\"text-align: justify;\">2. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Bu de\u011fi\u015fiklikleri yapt\u0131ktan sonra ayarlar\u0131n ge\u00e7erli olabilmesi i\u00e7in servisimizi yeniden ba\u015flat\u0131yoruz.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\"># service ntpd restart<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">Shutting down ntpd: [  OK  ]<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">Starting ntpd: [  OK  ]<\/span><\/pre>\n<p style=\"text-align: justify;\"><strong><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">&#8220;Oracle Real Application Cluster&#8221; Ortamlar\u0131 \u0130\u00e7in Yap\u0131land\u0131rma<\/span><\/strong><\/p>\n<p style=\"text-align: justify;\">1. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Oracle Real Application Cluster kurulumunda zaman senkronizasyonu i\u00e7in &#8220;NTP&#8221; yerine &#8220;Oracle Cluster Time Synchronization&#8221; kullanacaksak NTP servisini kapatmak i\u00e7in ayarlar\u0131m\u0131z\u0131 a\u015fa\u011f\u0131daki gibi yapmal\u0131y\u0131z.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\">NTP Servisimizi kapat\u0131yoruz.<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># service ntpd stop<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">Shutting down ntpd:\t[  OK  ]<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">NTP Servisimizin sunucumuz yeniden ba\u015flad\u0131\u011f\u0131ndan otomatik <\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">a\u00e7\u0131lmamas\u0131 i\u00e7in servisimizi kapat\u0131yoruz.<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># chkconfig ntpd off<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">NTP yap\u0131land\u0131rma dosyam\u0131z\u0131 ba\u015fka bir isimle adland\u0131r\u0131yoruz.<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># mv \/etc\/ntp.conf \/etc\/ntp.conf.org<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">ntpd.pid dosyas\u0131n\u0131 siliyoruz.<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># rm \/var\/run\/ntpd.pid<\/span><\/pre>\n<p style=\"text-align: justify;\">2. <span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Oracle Real Application Cluster kurulumunda zaman senkronizasyonu i\u00e7in &#8220;NTP&#8221; servisini kullanacaksak ayarlar\u0131m\u0131z\u0131 a\u015fa\u011f\u0131daki gibi yapmal\u0131y\u0131z.<\/span><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\"><span style=\"font-family: courier new,courier; font-size: 12px;\">-- Zaman servisimizin senkronizasyon ayar\u0131n\u0131 yap\u0131land\u0131r\u0131yoruz.<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># vim \/etc\/sysconfig\/ntpd<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"><span style=\"font-family: Georgia;\">-- <\/span>Dosyas\u0131 a\u015fa\u011f\u0131daki gibi yap\u0131land\u0131r\u0131yoruz.<\/span>\r\n\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">OPTIONS=\"-x -u ntp:ntp -p \/var\/run\/ntpd.pid\"<\/span>\r\n\r\n-- <span style=\"font-family: courier new,courier; font-size: 12px;\">Ayarlar\u0131m\u0131z\u0131n ge\u00e7erli olabilmesi i\u00e7in <\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\"># service ntpd restart<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">Shutting down ntpd: [  OK  ]<\/span>\r\n<span style=\"font-family: courier new,courier; font-size: 12px;\">Starting ntpd: [  OK  ]<\/span><\/pre>\n<p style=\"text-align: justify;\"><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Bu makalemizdeki Linux \u0130\u015fletim Sistemlerinde NTP Yap\u0131land\u0131rmas\u0131&#8217;n\u0131 inceledik. Burada uygulanan ad\u0131mlar &#8220;Oracle Enterprise Linux 6.4&#8221; i\u015fletim sistemi \u00fczerinde test edilmi\u015ftir. Di\u011fer Linux da\u011f\u0131t\u0131mlar\u0131ylada uyumludur.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12px;\">Ba\u015fka bir makalede g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bu makalemizde Linux \u0130\u015fletim Sistemlerinde NTP (Zaman Sunucusu) yap\u0131land\u0131rmas\u0131n\u0131 inceleyece\u011fiz. NTP Nedir ? &#8220;NTP Network Time Protocol&#8221;\u00fcn k\u0131saltmas\u0131d\u0131r. T\u00fcrk\u00e7esi A\u011f Zaman Protokol\u00fc&#8217;d\u00fcr. NTP, de\u011fi\u015fken gecikmeye sahip paket anahtarlamal\u0131 a\u011flar \u00fczerindeki bilgisayarlar\u0131n saatlerinin e\u015f zamanlanmas\u0131n\u0131n sa\u011flanmas\u0131 i\u00e7in kullan\u0131lan bir protokold\u00fcr. Protokol, &hellip; <a href=\"https:\/\/www.koraykey.com\/?p=1913\">Okumaya devam et <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[21,290,20,19,133,132,136,134,135],"class_list":["post-1913","post","type-post","status-publish","format-standard","hentry","category-unix-linux","tag-h-koray-gunduz","tag-halil-koray-gunduz","tag-koray-gunduz","tag-koraykey","tag-linux-isletim-sistemlerinde-ntp","tag-linux-ntp-kurulumu","tag-linux-ntp-server-kurulumu","tag-ntp-kurulumu","tag-ntp-server-kurulumu"],"_links":{"self":[{"href":"https:\/\/www.koraykey.com\/index.php?rest_route=\/wp\/v2\/posts\/1913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.koraykey.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.koraykey.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.koraykey.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.koraykey.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1913"}],"version-history":[{"count":0,"href":"https:\/\/www.koraykey.com\/index.php?rest_route=\/wp\/v2\/posts\/1913\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.koraykey.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.koraykey.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.koraykey.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}