<?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>Control WebPanel Wiki &#187; Clusters</title>
	<atom:link href="https://wiki.centos-webpanel.com/category/cluster/feed" rel="self" type="application/rss+xml" />
	<link>https://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>How to Setup remote SMTP server as relay</title>
		<link>https://wiki.centos-webpanel.com/how-to-setup-remote-smtp-server-as-relay</link>
		<comments>https://wiki.centos-webpanel.com/how-to-setup-remote-smtp-server-as-relay#comments</comments>
		<pubDate>Fri, 12 Jul 2019 08:58:01 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[E-Mail]]></category>
		<category><![CDATA[sendgrid]]></category>
		<category><![CDATA[SMTP relay]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=1221</guid>
		<description><![CDATA[Sending an outgoing email through a 3rd party SMTP relay service is a quick and easy alternative to setting up a full-fledged local email server. Open /etc/postfix/main.cf and add the remote mail server hostname to end of the file: relayhost = [remote.server.com] If the remote system uses a different port number, please specify the port [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Sending an outgoing email through a 3rd party SMTP relay service is a quick and easy alternative to setting up a full-fledged local email server.</p>
<p><strong>Open /etc/postfix/main.cf</strong> and add the remote mail server hostname to end of the file:</p>
<pre>relayhost = [remote.server.com]</pre>
<p>If the remote system uses a different port number, please specify the port number:</p>
<pre>relayhost = [remote.server.com]:587</pre>
<p>In some situations, for redundancy, you may want to configure the relay via two or more remote SMTP server. In such instances, you may configure the following;</p>
<pre>relayhost = [remote1.server.com]
fallback_relay = [remote2.server.com]</pre>
<p>This gives us redundancy in a way so that if one of the SMTP relays is down, we can send emails out via the second one.</p>
<div class="st-alert st-alert- ">
If you need to use login username and password you can add this:</p>
<pre>smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:postmaster@mydomain.com:password
smtp_sasl_security_options = noanonymous</pre>
</div>
<p>Now, open /etc/postfix/mynetworks and the public IP of the remote mail server. For example,</p>
<pre>192.168.6.45/32
192.168.7.34/32</pre>
<p>This will let the mail server know exactly which networks are allowed to relay mail. This is a very important step</p>
<p>Restart postfix:</p>
<pre>service postfix restart</pre>
<p>* Don't forget that remote mail servers need to have a valid SPF record and to be properly configured.</p>
<p><strong>SendGrid instructions</strong><br />
<a href="https://docs.sendgrid.com/for-developers/sending-email/postfix" title="SendGrid Postfix instructions" target="_blank">https://docs.sendgrid.com/for-developers/sending-email/postfix</a></p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/how-to-setup-remote-smtp-server-as-relay/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slave DNS Server &amp; Manager - DNS Cluster</title>
		<link>https://wiki.centos-webpanel.com/slave-dns-server-manager-dns-cluster</link>
		<comments>https://wiki.centos-webpanel.com/slave-dns-server-manager-dns-cluster#comments</comments>
		<pubDate>Wed, 10 Jul 2019 23:06:54 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Slave DNS Server]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=1197</guid>
		<description><![CDATA[CWP SLAVE DNS and DNS Clusters Please note that we have two options of slave DNS: - Slave DNS Server on our hosted server (you get an account with domain limit you need) - Slave DNS Server download version (a full and FREE Slave DNS Manager where you can add/remove users, set domain limits and [&#8230;]]]></description>
				<content:encoded><![CDATA[<h1>CWP SLAVE DNS and DNS Clusters</h1>
<p>Please note that we have two options of slave DNS:<br />
- Slave DNS Server on our hosted server (you get an account with domain limit you need)<br />
- Slave DNS Server download version (a full and FREE Slave DNS Manager where you can add/remove users, set domain limits and manage domains)<br />
<em>* The only requirement is to have a CWPpro license.</em></p>
<p><a href="http://wiki.centos-webpanel.com/wp-content/uploads/2019/07/CWP_DNS_Cluster1.png"><img src="/wp-content/uploads/2019/07/CWP_DNS_Cluster-e1562804855974.png" alt="CWP_DNS_Cluster" class="alignnone size-medium wp-image-1211" /></a></p>
<p><strong>Slave DNS Server &#038; Manager on our hosted server</strong><br />
For those having only a single VPS or dedicated server and with a need additional remote DNS server as ns2 they can order a slave DNS from our website.</p>
<p>Features of CWP Slave DNS server hosted by us:<br />
- Automatic sync DNS zones from a master server (your CWPpro) on serial change.<br />
- Automatic sync DNS zones on add/remove.<br />
- Manage DNS zones/domains from your CWP or our Website GUI.<br />
- You get an account on our Slave DNS Manager where you have a limited number of domains based on the package you order.<br />
- You don't need to buy an additional server and manually setup DNS on it.</p>
<p>You can order it <a href="https://support.centos-webpanel.com/cart.php?a=add&#038;pid=13" title="CWP - Slave DNS Server" target="_blank">here</a>.</p>
<p><strong>Slave DNS Server &#038; Manager download version</strong><br />
A Full and FREE Slave DNS Server &#038; Manager where you can add/remove users, set domain limits and manage domains.<br />
The most important part is that this is a completely FREE and scalable for bigger hosting providers with many domains.</p>
<p>Features of CWP Slave DNS Server &#038; Manager download version:<br />
- Completely FREE, The only requirement is to have CWPpro to be able to sync zones.<br />
- Automatic sync DNS zones from a master server (your CWPpro) on serial change.<br />
- Automatic sync DNS zones on add/remove.<br />
- Unlimited number of accounts.<br />
- Option to limit the number of domains per account (if you sell/offer DNS cluster to other clients).<br />
- Ability to connect multiple Slave2 DNS Servers (used as DNS Cluster).<br />
- Ability to connect multiple CWPpro WebServers on a single account.<br />
- Ability to connect multiple CWPpro WebServers on separate accounts.</p>
<p>You can check the installation instructions <a href="/slave-dns-server-manager-download-version" title="CWP - Slave DNS Server &#038; Manager download" target="_blank">here</a>.</p>
<p>Possible scenarios:<br />
You can connect multiple CWPpro WebServers to single Slave DNS Manager and make it as ns2 for all of the CWPpro Webservers.<br />
You can also use it as ns1 and then add multiple additional Slave2 DNS Servers as ns2, ns3, ns4....</p>
<p><strong>Slave DNS Server &#038; Manager - How it works:</strong><br />
In CWPpro WebServer on dns zone serial change, new account/domain/subdomain add/remove/edit it syncs DNS zone to the Slave DNS Manager.<br />
DNS Zone is added to Slave DNS Manager from CWPpro WebServer via API on the Slave DNS Manager then Bind dns server (on the slave) transfers zone to itself acting as a slave dns server.</p>
<p><strong>Slave2 DNS Server - How it works:</strong><br />
Big providers mostly have a custom DNS Cluster which handles all dns domains they have on multiple webservers to reduce resource usage by dns on the webservers.<br />
Slave2 DNS Server is designed to be an additional DNS Server for big providers which need to have stability if some DNS servers get overloaded or unavailable.</p>
<p>It's using rsync running via cron which checks for changes on the Slave DNS Manager and based on the changes from rsync it will add or remove dns zone from itself.<br />
It also has the ability to check if Slave DNS Manage is responding on dns queries before accepting new changes to prevent multiple DNS servers to be down at the same time.</p>
<p>Slave DNS Servers can be located in different data centers worldwide.</p>
<p>You can check the installation instructions for Slave2 DNS Servere <a href="/slave2-dns-server" title="CWP - Slave2 DNS Server" target="_blank">here</a>.</p>
<p><strong>INFO</strong><br />
<em>* Only WebServers need to have CWPpro, DNS servers don't need to have it.</em></p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/slave-dns-server-manager-dns-cluster/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Cluster (MariaDB Galera)</title>
		<link>https://wiki.centos-webpanel.com/mysql-cluster-mariadb-galera</link>
		<comments>https://wiki.centos-webpanel.com/mysql-cluster-mariadb-galera#comments</comments>
		<pubDate>Wed, 08 Jul 2015 18:04:11 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[MySQL Cluster]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=355</guid>
		<description><![CDATA[How to setup MySQL Cluster (master/master) with MariaDB Galera Cluster We will use two Servers for MySQL Cluster cluster1 with IP 10.90.90.101 cluster2 with IP 10.90.90.102 ..this can be public or private IP's depending on your needs. Make sure that SeLinux is disabled and IP's are whitelisted in the firewall. Create a mariadb repository: nano [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>How to setup MySQL Cluster (master/master) with MariaDB Galera Cluster</strong></p>
<p><strong>We will use two Servers for MySQL Cluster</strong><br />
cluster1 with IP 10.90.90.101<br />
cluster2 with IP 10.90.90.102<br />
..this can be public or private IP's depending on your needs.</p>
<p>Make sure that SeLinux is disabled and IP's are whitelisted in the firewall.</p>
<p><strong>Create a mariadb repository:</strong> nano /etc/yum.repos.d/mariadb.repo</p>
<p>CentOS 6 64bit</p>
<pre>[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1</pre>
<p>CentOS 6 32bit</p>
<pre>[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1</pre>
<p><strong>Installation on all cluster servers</strong></p>
<pre>yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/socat-1.7.2.3-1.el6.x86_64.rpm
yum -y install MariaDB-server MariaDB-client rsync galera
service mysql start
/usr/bin/mysql_secure_installation</pre>
<p>You can enter a DATABASE-PASSWORD and accepted all defaults (if you don't know what to do).</p>
<p>Now we need to add MariaDB Galera Cluster user</p>
<pre>mysql -u root -p</pre>
<p>** For password just hit enter</p>
<pre>mysql> DELETE FROM mysql.user WHERE user='';
mysql> GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'DATABASE-PASSWORD';
mysql> GRANT USAGE ON *.* to sst_user@'%' IDENTIFIED BY 'DATABASE-PASSWORD';
mysql> GRANT ALL PRIVILEGES on *.* to sst_user@'%';
mysql> FLUSH PRIVILEGES;
mysql> quit</pre>
<p>You can replace "%" with hostname or IP address from which that users can access the database.<br />
"%" means that you can access databases from any server so this is decreasing your security level.</p>
<p><strong>Now lets configure MariaDB Galera Cluster</strong></p>
<pre>service mysql stop</pre>
<p>Under <strong>[galera]</strong> in file <strong>/etc/my.cnf.d/server.cnf</strong> add cluster configuration.<br />
<em>DON'T FORGET TO EDIT</em> <strong>wsrep_node_address</strong> and <strong>wsrep_node_name</strong> for each server.</p>
<pre>
wsrep_on=ON
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
innodb_locks_unsafe_for_binlog=1
query_cache_size=0
query_cache_type=0
bind-address=0.0.0.0
datadir=/var/lib/mysql
innodb_log_file_size=100M
innodb_file_per_table
innodb_flush_log_at_trx_commit=2
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://10.90.90.101,10.90.90.102"
wsrep_cluster_name='galera_cluster'
wsrep_node_address='10.90.90.101'
wsrep_node_name='cluster1'
wsrep_sst_method=rsync
wsrep_sst_auth=sst_user:dbpass
</pre>
<p><strong>Now let's start our clusters</strong><br />
On cluster1 ONLY run MySQL with additonal option "<strong>--wsrep-new-cluster</strong>"</p>
<pre>/etc/init.d/mysql start --wsrep-new-cluster</pre>
<p>On every other cluster server like cluster2 in our example you need to start mysql as usual</p>
<pre>service mysql start</pre>
<p>And that is it, you cluster should be working now <img src="https://wiki.centos-webpanel.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
<p><strong>Test which MySQL servers are running in cluster</strong><br />
You should see IP address of each server in cluster and number of servers in cluster</p>
<pre>mysql -u root -p -e "show status like 'wsrep%'"</pre>
<pre>| wsrep_local_state_comment | Synced                                 |
| wsrep_incoming_addresses  | 10.90.90.101:3306,10.90.90.102:3306    |
| wsrep_cluster_size        | 3                                      |
| wsrep_connected           | ON                                     |
| wsrep_ready               | ON                                     |</pre>
<p><strong>Final improvements</strong><br />
Avoid password requests from command line for MySQL root user:<br />
Create file /root/.my.cnf and add in it</p>
<pre>[client]
host=MYSQL-IP
port=3306
password="DATABASE-PASSWORD"  
user=root</pre>
<p>Secure this file to be readable for root user only</p>
<pre>chmod 400 /root/.my.cnf</pre>
<p><strong>Avoid DNS</strong><br />
To avoid DNS communication between cluster servers we need to define cluster servers in <strong>/etc/hosts</strong> file on each server.<br />
We can do that by adding IP's and server name for each cluster at end of /etc/hosts file.</p>
<pre>10.90.90.101 cluster1
10.90.90.102 cluster2
</pre>
<p>You can also change configuration for server by using example from this files /usr/share/mysql/:</p>
<pre>
my-huge.cnf (1-2GB RAM)        
my-innodb-heavy-4G.cnf (4GB RAM,InnoDB only,ACID,heavy queries)
my-large.cnf (512MB RAM)        
my-medium.cnf (128MB RAM)    
my-small.cnf (<=64MB RAM)
</pre>
<p>Don't forget that cluster works with innodb tables, you can check the database table type with this command.</p>
<pre>mysql -e "SHOW TABLE STATUS FROM \`DATABASE-NAME\`;"|awk {'print $2'}|sort|uniq -c</pre>
<p>*** Replace DATABASE-NAME with the name of your database.</p>
<p><strong>For assistance you can contact our support</strong><br />
<a href="http://centos-webpanel.com/contact" title="Contact CentOS support" target="_blank">http://centos-webpanel.com/contact</a></p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/mysql-cluster-mariadb-galera/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote MySQL with SOCAT socket</title>
		<link>https://wiki.centos-webpanel.com/remote-mysql-with-socat-socket</link>
		<comments>https://wiki.centos-webpanel.com/remote-mysql-with-socat-socket#comments</comments>
		<pubDate>Tue, 30 Jun 2015 20:50:20 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[Load-Balancers]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[remote MySQL]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=320</guid>
		<description><![CDATA[How to make a remote MySQL server with socket by using SOCAT. Remote MySQL advantages - move MySQL CPU usage from local CWP web server - move MySQL disk IO operations from disk - move MySQL disk space usage to other server - improve performances by moving MySQL to SSD multi-core powered server ... on [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>How to make a remote MySQL server with socket by using SOCAT.</strong><br />
Remote MySQL advantages<br />
- move MySQL CPU usage from local CWP web server<br />
- move MySQL disk IO operations from disk<br />
- move MySQL disk space usage to other server<br />
- improve performances by moving MySQL to SSD multi-core powered server<br />
...</p>
<p><strong>on the remote MYSQL server</strong><br />
This needs to be a clean server, best would be a clean CentOS 6 minimal without any control panel.</p>
<p>Install MySQL server and Socat</p>
<pre>yum install mysql-server socat -y</pre>
<p>Run Socat listening for MySQL on the port 3307</p>
<pre>socat TCP-LISTEN:3307,reuseaddr,fork UNIX-CONNECT:/var/lib/mysql/mysql.sock &#038;</pre>
<p><strong>on the CWP Web server</strong><br />
1. Backup all databases<br />
2. Import databases to the remote MySQL server<br />
3. Update MySQL root password from MySQL server and add it in following files:<br />
- /root/.my.cnf<br />
- /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php<br />
Update postfix<br />
- /usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php<br />
** Other option would be that you change MySQL root password on the MySQL server.<br />
4. Stop local MySQL server<br />
5. Add IP from CWP server to MySQL and from MySQL to CWP in firewall allow list.</p>
<p>Please note that also in the bellow listed files you need to replace <b>$db_host</b> and <b>$db_host_postfix</b> from <b>localhost</b> to your remote mysql server ip<br />
/usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php<br />
/usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php</p>
<p>Now lets create remote MySQL socket connection with socat (replace SERVER-IP)</p>
<pre>socat UNIX-LISTEN:/var/lib/mysql/mysql.sock,fork,reuseaddr,unlink-early,user=mysql,group=mysql,mode=777 TCP:SERVER-IP:3307 &#038;</pre>
<p>If you have successful login in the cwp and local MySQL server is stopped than this means that you are connected on the remote MySQL server.<br />
Once you have a working remote mysql server then you need to create remote mysql users root/postifx</p>
<pre>
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'postfix'@'%' IDENTIFIED BY 'old-password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'old-password';
MariaDB [(none)]> flush privileges;</pre>
<p>Disable or remove local MySQL server from web hosting server.</p>
<p><strong>For assistance you can contact our support</strong><br />
<a href="http://centos-webpanel.com/contact" title="Contact CentOS support" target="_blank">http://centos-webpanel.com/contact</a></p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/remote-mysql-with-socat-socket/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
