<?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>Cluster Setup Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/cluster-setup/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/cluster-setup/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Thu, 04 Jan 2024 02:35:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>Cluster Setup Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/cluster-setup/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Setting Up an Apache Kafka Cluster on ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/setting-up-an-apache-kafka-cluster-on-serverstadium/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 02:34:26 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11764</guid>

					<description><![CDATA[<p>This guide will walk you through the process of setting up an Apache Kafka cluster, which is ideal for handling real-time data processing tasks. Prerequisites ServerStadium VMs or dedicated servers. Consider the size and number based on your Kafka workload. Check out ServerStadium VM Pricing and Dedicated Servers. Basic knowledge of Linux, networking, and Kafka.&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-an-apache-kafka-cluster-on-serverstadium/">Setting Up an Apache Kafka Cluster on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This guide will walk you through the process of setting up an Apache Kafka cluster, which is ideal for handling real-time data processing tasks.</p>
<h3>Prerequisites</h3>
<ul>
<li>ServerStadium VMs or dedicated servers. Consider the size and number based on your Kafka workload. Check out <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">ServerStadium VM Pricing</a> and <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>.</li>
<li>Basic knowledge of Linux, networking, and Kafka.</li>
</ul>
<h3>Step 1: Setting Up Your ServerStadium VMs/Dedicated Servers</h3>
<ol>
<li><strong>Choose Your Servers</strong>: Select at least three servers (one for each Kafka broker) for a basic Kafka cluster. Using the <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">ServerStadium Cloud Panel</a>, deploy your VMs or dedicated servers.</li>
<li><strong>Initial Server Setup</strong>: Access your servers via SSH. Update and upgrade each server:<br />
<div class="shortcode-code">
<p>sudo apt update<br />
sudo apt upgrade</p></div></li>
</ol>
<h3>Step 2: Install Java</h3>
<p>Kafka requires Java, so install it on all servers:<br />
<div class="shortcode-code">
<p>sudo apt install default-jdk</p></div><br />
Verify the installation:<br />
<div class="shortcode-code">
<p>java -version</p></div></p>
<h3>Step 3: Install Zookeeper</h3>
<p>Kafka uses Zookeeper for cluster management:</p>
<ol>
<li><strong>Install Zookeeper</strong>:<br />
<div class="shortcode-code">
<p>sudo apt install zookeeperd</p></div></li>
<li><strong>Configure Zookeeper</strong>:Edit the Zookeeper configuration file:<br />
<div class="shortcode-code">
<p>sudo nano /etc/zookeeper/conf/zoo.cfg</p></div><br />
Ensure <code>clientPort</code> is set to <code>2181</code> and add the server details under the <code>server.N=</code> lines, where <code>N</code> is the server ID.</li>
</ol>
<h3>Step 4: Install and Configure Kafka</h3>
<ol>
<li><strong>Download Kafka</strong>: Go to the <a href="https://kafka.apache.org" target="_new" rel="noopener">Apache Kafka website</a> and download Kafka. Use <code>wget</code> on your servers:<br />
<div class="shortcode-code">
<p>wget &#091;Kafka-download-link&#093;<br />
tar -xzf &#091;Kafka-tar-file&#093;</p></div><br />
Replace <code>[Kafka-download-link]</code> and <code>[Kafka-tar-file]</code> with the actual download link and file name.</li>
<li><strong>Configure Kafka</strong>:Inside the Kafka directory, edit the <code>config/server.properties</code> file:<br />
<div class="shortcode-code">
<p>nano config/server.properties</p></div><br />
Set the <code>broker.id</code> for each Kafka broker. Configure <code>zookeeper.connect</code> with the Zookeeper connection string.</li>
</ol>
<h3>Step 5: Start Kafka</h3>
<ol>
<li><strong>Start Kafka Broker</strong>:On each server:<br />
<div class="shortcode-code">
<p>bin/kafka-server-start.sh config/server.properties</p></div></li>
</ol>
<h3>Step 6: Create Kafka Topics</h3>
<ol>
<li><strong>Create a Topic</strong>:Use the Kafka scripts to create topics:<br />
<div class="shortcode-code">
<p>bin/kafka-topics.sh &#8211;create &#8211;topic &#091;topic-name&#093; &#8211;bootstrap-server &#091;server-list&#093; &#8211;replication-factor 3 &#8211;partitions 1</p></div><br />
Replace <code>[topic-name]</code> with your topic and <code>[server-list]</code> with a list of your Kafka brokers.</li>
</ol>
<h3>Step 7: Test Your Kafka Cluster</h3>
<ol>
<li><strong>Produce Messages</strong>:Send some messages to your Kafka topic:<br />
<div class="shortcode-code">
<p>bin/kafka-console-producer.sh &#8211;topic &#091;topic-name&#093; &#8211;bootstrap-server &#091;server-list&#093;</p></div></li>
<li><strong>Consume Messages</strong>:Read messages from the topic:<br />
<div class="shortcode-code">
<p>bin/kafka-console-consumer.sh &#8211;topic &#091;topic-name&#093; &#8211;from-beginning &#8211;bootstrap-server &#091;server-list&#093;</p></div></li>
</ol>
<h3>Conclusion</h3>
<p>You have now set up an Apache Kafka cluster on ServerStadium infrastructure, which can be used for real-time data streaming and processing.</p>
<p>For additional assistance, check out the <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">ServerStadium Knowledge Base</a> or contact our support team.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-an-apache-kafka-cluster-on-serverstadium/">Setting Up an Apache Kafka Cluster on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Configuring a PostgreSQL Database Cluster with Replication on ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/configuring-a-postgresql-database-cluster-with-replication-on-serverstadium/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 02:11:32 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11758</guid>

					<description><![CDATA[<p>This tutorial explains how to set up a PostgreSQL database cluster with replication using ServerStadium&#8217;s infrastructure. Prerequisites At least two ServerStadium VM instances or dedicated servers. Check ServerStadium VM Pricing and Dedicated Servers for options. Access to the ServerStadium Cloud Panel. Basic knowledge of PostgreSQL and Linux system administration. Step 1: Setting Up the Primary&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/configuring-a-postgresql-database-cluster-with-replication-on-serverstadium/">Configuring a PostgreSQL Database Cluster with Replication on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This tutorial explains how to set up a PostgreSQL database cluster with replication using ServerStadium&#8217;s infrastructure.</p>
<h3>Prerequisites</h3>
<ul>
<li>At least two ServerStadium VM instances or dedicated servers. Check <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">ServerStadium VM Pricing</a> and <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a> for options.</li>
<li>Access to the <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">ServerStadium Cloud Panel</a>.</li>
<li>Basic knowledge of PostgreSQL and Linux system administration.</li>
</ul>
<h3>Step 1: Setting Up the Primary PostgreSQL Server</h3>
<ol>
<li><strong>Select and Set Up Your Servers</strong>: Use the <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">ServerStadium Cloud Panel</a> to set up at least two servers &#8211; one for the primary PostgreSQL server and the other for the replica.</li>
<li><strong>Install PostgreSQL</strong>: SSH into your primary server and install PostgreSQL:<br />
<div class="shortcode-code">
<p>sudo apt update<br />
sudo apt install postgresql postgresql-contrib</p></div></li>
<li><strong>Configure PostgreSQL for Replication</strong>:
<p>Edit the PostgreSQL configuration file:<br />
<div class="shortcode-code">
<p>sudo nano /etc/postgresql/12/main/postgresql.conf</p></div></p>
<p>Make the following changes (note that the version number, here <code>12</code>, may vary):</p>
<p>-Set the listen_addresses to &#8216;*&#8217; or the specific IP addresses of your replica servers.<br />
-Set the wal_level to replica.<br />
-Configure max_wal_senders to a number greater than or equal to the number of replicas you plan to have.<br />
-Set wal_keep_segments to a value that determines how much information to retain for the replicas (e.g., 64).</li>
<li><strong>Configure Client Authentication</strong>:
<p>Edit the <code>pg_hba.conf</code> file:<br />
<div class="shortcode-code">
<p>sudo nano /etc/postgresql/12/main/pg_hba.conf</p></div><br />
Add the following line to allow replication connections from your replicas (replace <code>replica_ip</code> with your replica&#8217;s IP):<br />
<div class="shortcode-code">
<p>host replication all replica_ip md5</p></div></li>
<li><strong>Restart PostgreSQL</strong>:<br />
<div class="shortcode-code">
<p>sudo systemctl restart postgresql</p></div></li>
</ol>
<h3>Step 2: Setting Up the Replica PostgreSQL Server</h3>
<ol>
<li><strong>Install PostgreSQL</strong>: Repeat the installation process on the replica server.</li>
<li><strong>Data Copy</strong>: On the primary server, create a user for replication and grant replication privileges. Then use <code>pg_basebackup</code> to copy data from the primary to the replica.
<p>On the primary server:<br />
<div class="shortcode-code">
<p>sudo -u postgres createuser &#8211;replication replica_user</p></div><br />
On the replica server:<br />
<div class="shortcode-code">
<p>sudo systemctl stop postgresql<br />
sudo -u postgres pg_basebackup -h primary_ip -D /var/lib/postgresql/12/main -U replica_user -P &#8211;wal-method=stream</p></div><br />
Replace <code>primary_ip</code> with the IP of your primary server.</li>
<li><strong>Configure Replica PostgreSQL</strong>:
<p>On the replica, create a recovery file:<br />
<div class="shortcode-code">
<p>sudo -u postgres nano /var/lib/postgresql/12/main/recovery.conf</p></div><br />
Add the following configuration:<br />
<div class="shortcode-code">
<p>standby_mode = &#039;on&#039;<br />
primary_conninfo = &#039;host=primary_ip port=5432 user=replica_user password=replica_password&#039;<br />
trigger_file = &#039;/tmp/postgresql.trigger.5432&#039;</p></div><br />
Replace <code>primary_ip</code> and <code>replica_password</code> with appropriate values.</li>
<li><strong>Start the Replica Server</strong>:<br />
<div class="shortcode-code">
<p>sudo systemctl start postgresql</p></div></li>
</ol>
<h3>Step 3: Testing and Verification</h3>
<ol>
<li><strong>Testing</strong>: Create a test database or table on the primary server. Verify that changes are replicated to the replica server.</li>
<li><strong>Monitoring</strong>: Use PostgreSQL’s built-in functions or external tools to monitor the replication status. Check logs for any errors.</li>
</ol>
<h3>Conclusion</h3>
<p>You now have a PostgreSQL database cluster with replication set up using ServerStadium&#8217;s services. This configuration enhances your database&#8217;s availability and load distribution.</p>
<p>For further assistance, refer to our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">knowledge base</a> or reach out to our support team.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/configuring-a-postgresql-database-cluster-with-replication-on-serverstadium/">Configuring a PostgreSQL Database Cluster with Replication on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
