{"id":104,"date":"2008-01-23T21:13:55","date_gmt":"2008-01-23T19:13:55","guid":{"rendered":"http:\/\/robert.kolatzek.org\/wblog\/?p=104"},"modified":"2008-01-23T21:13:55","modified_gmt":"2008-01-23T19:13:55","slug":"sysclock_xen","status":"publish","type":"post","link":"https:\/\/blog.kolatzek.org\/wblog\/104\/sysclock_xen","title":{"rendered":"Zeit im Xen"},"content":{"rendered":"<p>Wer einen Xen-virtualisierten Server betreibt staunt manchmal nicht schlecht, wie langsam die Server-Uhr geht. Am Anfang sind es wenige Sekunden. Irgendwann ist es schon eine Minute&#8230;<\/p>\n<p>Es gibt Software, die dies beheben k\u00f6nnte, aber sie scheint nicht zu funktionieren. Egal wie oft man versucht, die Zeit neu einzustellen &#8211; es geht nicht.<\/p>\n<p><!--more--><\/p>\n<p>Die Ursache liegt darin, dass Xen versucht, die System-Zeit der Hardware zu nutzen (genauer gesagt, den Sysclock des Wirtes). Diese kann man nat\u00fcrlich aus dem Xen-Gast heraus nicht setzen. Doch es gibt einen anderen Weg: Man schaltet im Xen einen eigenen Sysclock ein. Das geht mit root-Rechten sehr schnell:<\/p>\n<pre><span class=\"Code\">echo 1 &gt; \/proc\/sys\/xen\/independent_wallclock<\/span><\/pre>\n<p>Danach ist ein Zeitabgleich von dauer &#8211; der Sysclock des Xen-Systems l\u00e4sst sich setzen. ZB mit:<\/p>\n<pre><span class=\"Code\">\/usr\/sbin\/ntpdate europe.pool.ntp.org<\/span><\/pre>\n<p>Damit man die \u00dcbung nicht immer per Hand exerzieren muss, schafft man eine neue Datei an und gibt Folgendes ein:<\/p>\n<pre><span class=\"Code\">#!\/bin\/bash\n<\/span><span class=\"Code\">echo 1 &gt; \/proc\/sys\/xen\/independent_wallclock\n\/usr\/sbin\/ntpdate europe.pool.ntp.org<\/span><\/pre>\n<p>Speichern + <strong>chmod 700<\/strong> macht es zu einem Pseudo-Programm. Jetzt nur noch den vollen Pfad zu dieser Datei im crontab eintragen (oder <strong>unter Debian\/Ubunut<\/strong> die Datei in <strong>\/etc\/cron.daily\/<\/strong> ablegen). Und schon k\u00fcmmert sich der Server selber um seine Zeit-Updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wer einen Xen-virtualisierten Server betreibt staunt manchmal nicht schlecht, wie langsam die Server-Uhr geht. Am Anfang sind es wenige Sekunden. Irgendwann ist es schon eine Minute&#8230; Es gibt Software, die dies beheben k\u00f6nnte, aber sie scheint nicht zu funktionieren. Egal wie oft man versucht, die Zeit neu einzustellen &#8211; es geht nicht.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[65,74,96],"class_list":["post-104","post","type-post","status-publish","format-standard","hentry","category-software","tag-linux","tag-opensource","tag-server","entry"],"_links":{"self":[{"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":0,"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kolatzek.org\/wblog\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}