<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>master-master &#8211; SMsoft &#8211; informatica e dintorni</title>
	<atom:link href="https://blog.smsoft.it/tag/master-master/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.smsoft.it</link>
	<description>consigli settimanali su MacOS, GNU/Linux ed Open Source</description>
	<lastBuildDate>Tue, 10 Sep 2013 08:51:18 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=69001</generator>
	<item>
		<title>Mysql: replica master-master ed auto flush dei vecchi logs</title>
		<link>https://blog.smsoft.it/2013/09/10/mysql-replica-master-master-ed-auto-flush-dei-vecchi-logs/</link>
					<comments>https://blog.smsoft.it/2013/09/10/mysql-replica-master-master-ed-auto-flush-dei-vecchi-logs/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 10 Sep 2013 08:51:18 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[master-master]]></category>
		<category><![CDATA[MySQL]]></category>
		<guid isPermaLink="false">http://blog.smsoft.it/?p=2554</guid>

					<description><![CDATA[Usando la configurazione per la replica di MySQL master-master, avrete notato che i logs binari sono sempre tutti li, ovvero non vengono cancellati dopo che la replica è stata commpletata. Per ovviare, si può inserire una direttiva nel file my.cnf (/etc/mysql/my.cnf) che cancella quelli più vecchi di 7 giorni: [crayon-6a7c74e2ada9b174583049/] Si può anche decidere di ... <a title="Mysql: replica master-master ed auto flush dei vecchi logs" class="read-more" href="https://blog.smsoft.it/2013/09/10/mysql-replica-master-master-ed-auto-flush-dei-vecchi-logs/" aria-label="Per saperne di più su Mysql: replica master-master ed auto flush dei vecchi logs">Leggi tutto</a>]]></description>
										<content:encoded><![CDATA[<p>Usando la configurazione per la replica di MySQL master-master, avrete notato che i logs binari sono sempre tutti li, ovvero non vengono cancellati dopo che la replica è stata commpletata.</p>
<p>Per ovviare, si può inserire una direttiva nel file my.cnf (<strong>/etc/mysql/my.cnf</strong>) che cancella quelli più vecchi di 7 giorni:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">[mysqld]
expire-logs-days=7</pre><p></p>
<p>Si può anche decidere di farlo manualmente, eseguendo nella console mysql:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">mysql> PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 7 DAY) + INTERVAL 0 SECOND;</pre><p></p>
<p>Infine, operazione più &#8220;delicata&#8221;, si può verificare il file binario che lo slave sta usando al momento e poi cancellare quelli precedenti sul master. Per farlo, bisogna accedere alla console mysql dello <strong>slave</strong> e digitare:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">mysql> SHOW SLAVE STATUS\G;</pre><p></p>
<p>questo visualizzerà una serie di informazioni tra cui il campo <strong>Relay_Master_Log_File</strong>, es:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Relay_Master_Log_File: mysql-bin.000031</pre><p></p>
<p>Questo significa che si sta usando il file <strong>mysql-bin.000031</strong> e quindi si può accedere alla console del <strong>master</strong> e scrivere:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">mysql> PURGE BINARY LOGS TO 'mysql-bin.000031';</pre><p></p>
<p>enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2013/09/10/mysql-replica-master-master-ed-auto-flush-dei-vecchi-logs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
