How To Install Hazelcast on Fedora 42
Installing Hazelcast on Fedora 42 opens up powerful distributed computing capabilities for modern applications. This comprehensive guide walks through every aspect of deploying Hazelcast’s in-memory data grid platform on Fedora’s latest release. Whether you’re building scalable microservices, implementing distributed caching solutions, or creating high-performance real-time applications, mastering Hazelcast installation on Fedora 42 is essential for developers and system administrators alike.
Hazelcast represents a breakthrough in distributed computing technology, offering lightning-fast data processing through its innovative in-memory architecture. The platform excels at handling massive datasets across clustered environments while maintaining exceptional performance and reliability. Fedora 42, with its cutting-edge kernel and robust package management system, provides an ideal foundation for Hazelcast deployments.
Prerequisites and System Requirements
System Requirements for Fedora 42
Fedora 42 demands specific hardware specifications to run optimally with Hazelcast workloads. The minimum configuration includes a 2GHz dual-core processor, 2GB RAM, and 15GB available storage space. However, production environments benefit significantly from enhanced specifications: a 2GHz quad-core processor, 4GB RAM, and 20GB storage capacity.
Memory considerations become critical when running distributed Hazelcast clusters. Each Hazelcast member typically requires additional RAM beyond the base system requirements. Planning for at least 1GB extra memory per cluster member ensures smooth operation during peak loads.
Storage performance impacts Hazelcast’s persistence features and backup operations. SSD storage delivers superior performance compared to traditional hard drives, particularly for write-heavy workloads and large dataset processing.
Java Requirements
Hazelcast mandates Java 8 or higher for proper operation, though newer versions offer enhanced performance and security features. OpenJDK versions 11, 17, and 21 LTS represent recommended choices for production deployments. These Long Term Support releases provide stability and extended maintenance windows critical for enterprise applications.
The choice between Java Runtime Environment (JRE) and Java Development Kit (JDK) depends on deployment requirements. Development environments typically require JDK for compilation and debugging capabilities. Production systems often run efficiently with JRE installations, reducing the overall system footprint.
Java version compatibility becomes crucial when integrating Hazelcast with existing applications. Legacy systems may require specific Java versions, while modern applications benefit from the latest security patches and performance improvements available in recent releases.
Network and Security Prerequisites
Network configuration plays a vital role in Hazelcast cluster formation and communication. Firewall rules must accommodate Hazelcast’s default port range (5701-5708) for proper member discovery and data synchronization. TCP connectivity between cluster members is essential for distributed operations.
Security considerations include configuring appropriate access controls and authentication mechanisms. Production deployments should implement TLS encryption for cluster communications and restrict network access to authorized systems only.
SELinux policies on Fedora 42 may require adjustments to allow Hazelcast network operations. Understanding these security contexts prevents common connectivity issues during initial deployment phases.
Installing Java on Fedora 42
Installing OpenJDK via DNF Package Manager
Fedora 42’s DNF package manager provides the most straightforward approach for Java installation. Begin by updating the system package repository and searching for available OpenJDK versions:
sudo dnf update
sudo dnf search openjdk
This command reveals all available Java packages, including different versions and variants. Install OpenJDK 21, the latest LTS version, using the following command:
sudo dnf install java-21-openjdk-devel
The java-21-openjdk-devel
package includes both runtime and development tools. For runtime-only installations, use java-21-openjdk
instead. Alternative versions like Java 8, 11, or 17 can be installed simultaneously for compatibility with different applications:
sudo dnf install java-8-openjdk-devel java-11-openjdk-devel java-17-openjdk-devel
Verify the installation by checking the Java version:
java -version
javac -version
These commands should display version information confirming successful installation. Multiple Java versions can coexist on Fedora 42, providing flexibility for diverse application requirements.
Configuring Java Environment
Environment variable configuration ensures proper Java functionality across system processes. Set the JAVA_HOME variable by adding the following lines to /etc/environment
or your shell profile:
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
export PATH=$PATH:$JAVA_HOME/bin
The alternatives
system manages multiple Java installations elegantly. Configure the default Java version using:
sudo alternatives --config java
sudo alternatives --config javac
These commands present interactive menus for selecting the default Java runtime and compiler. The selection affects system-wide Java operations and application behavior.
Test the configuration by verifying JAVA_HOME and PATH variables:
echo $JAVA_HOME
which java
which javac
Proper configuration displays the correct paths and ensures Java accessibility from any directory location.
Alternative Java Installation Methods
Oracle JDK installation provides an alternative to OpenJDK for organizations requiring Oracle’s commercial support. Download the Oracle JDK package from Oracle’s official website and install manually:
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_rpm.rpm
sudo rpm -ivh jdk-21_linux-x64_rpm.rpm
Third-party repositories like RPM Fusion offer additional Java distributions and versions. These repositories expand installation options but require careful security consideration and trust evaluation.
Production environments often standardize on specific Java versions for consistency and support purposes. Development environments benefit from having multiple versions available for testing and compatibility verification.
Hazelcast Installation Methods
Method 1: Package Manager Installation
RPM package installation offers the most streamlined approach for Hazelcast deployment on Fedora 42. This method integrates seamlessly with the system package manager and provides automatic dependency resolution.
First, add the official Hazelcast RPM repository to your system:
wget https://repository.hazelcast.com/rpm/stable/hazelcast-rpm-stable.repo -O hazelcast-rpm-stable.repo
sudo mv hazelcast-rpm-stable.repo /etc/yum.repos.d/
Update the package database to recognize the new repository:
sudo dnf update
Install Hazelcast using DNF:
sudo dnf install hazelcast-5.5.0
Verify the installation by checking the Hazelcast CLI version:
hz -V
This command should display both Hazelcast and CLI version information. The package manager installation automatically configures system paths and creates necessary service files for seamless operation.
Benefits include automatic updates through the system package manager, proper integration with Fedora’s security policies, and standardized file locations. However, version flexibility may be limited compared to manual installation methods.
Method 2: Binary Distribution Installation
Binary distribution installation provides maximum flexibility and control over the Hazelcast deployment. This method suits environments requiring specific versions or custom configurations not available through package managers.
Download the latest Hazelcast binary distribution:
cd /opt
sudo wget -O - 'https://repository.hazelcast.com/download/hazelcast/hazelcast-5.5.0.tar.gz' | sudo tar xvzf -
sudo chown -R $USER:$USER hazelcast-5.5.0
Create a symbolic link for easier access:
sudo ln -s /opt/hazelcast-5.5.0 /opt/hazelcast
Add Hazelcast to the system PATH by creating a script in /etc/profile.d/
:
sudo tee /etc/profile.d/hazelcast.sh << 'EOF'
export HAZELCAST_HOME=/opt/hazelcast
export PATH=$PATH:$HAZELCAST_HOME/bin
EOF
Source the script or restart your session to apply the changes:
source /etc/profile.d/hazelcast.sh
Create a systemd service file for automatic startup:
sudo tee /etc/systemd/system/hazelcast.service << 'EOF'
[Unit]
Description=Hazelcast Service
After=network.target
[Service]
Type=simple
User=hazelcast
Group=hazelcast
ExecStart=/opt/hazelcast/bin/hz start
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable hazelcast.service
sudo systemctl start hazelcast.service
Method 3: Docker Installation
Docker containerization offers isolation, portability, and simplified deployment for Hazelcast instances. This approach particularly benefits development environments and microservices architectures.
Install Docker on Fedora 42 if not already present:
sudo dnf install docker
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $USER
Pull the official Hazelcast Docker image:
docker pull hazelcast/hazelcast:5.5.0
Run a Hazelcast container with basic configuration:
docker run -d --name hazelcast-node1 -p 5701:5701 hazelcast/hazelcast:5.5.0
For production deployments, use Docker Compose for multi-container orchestration:
version: '3.8'
services:
hazelcast-node1:
image: hazelcast/hazelcast:5.5.0
ports:
- "5701:5701"
environment:
- JAVA_OPTS=-Xmx1g
volumes:
- ./hazelcast.xml:/opt/hazelcast/config/hazelcast.xml
Containerized deployment simplifies scaling, updates, and environment consistency across development and production systems.
Basic Hazelcast Configuration
Understanding Hazelcast Configuration Files
Hazelcast configuration revolves around XML-based configuration files that define cluster behavior, network settings, and data structure properties. The primary configuration file, hazelcast.xml
, controls all aspects of cluster operation and member behavior.
Default configurations work well for development and testing scenarios, providing automatic member discovery and basic clustering capabilities. Production environments require customized configurations addressing specific networking, security, and performance requirements.
Configuration precedence follows a hierarchical structure: programmatic configuration overrides XML configuration, which overrides default settings. Understanding this hierarchy prevents configuration conflicts and ensures predictable behavior across different deployment scenarios.
Creating Your First Cluster Configuration
Essential cluster configuration begins with defining a unique cluster name and network discovery mechanism. Create a custom hazelcast.xml
file in your Hazelcast configuration directory:
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-config-5.5.xsd">
<cluster-name>fedora-hazelcast-cluster</cluster-name>
<network>
<port auto-increment="true" port-count="100">5701</port>
<join>
<multicast enabled="false"/>
<tcp-ip enabled="true">
<member>192.168.1.100</member>
<member>192.168.1.101</member>
<member>192.168.1.102</member>
</tcp-ip>
</join>
</network>
<map name="default">
<backup-count>1</backup-count>
<async-backup-count>0</async-backup-count>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
</map>
</hazelcast>
This configuration establishes TCP/IP discovery with specific member addresses, disables multicast discovery, and sets basic map backup policies. The cluster name ensures member isolation from other Hazelcast clusters on the same network.
Memory configuration optimizes heap allocation and garbage collection behavior:
<properties>
<property name="hazelcast.initial.min.cluster.size">2</property>
<property name="hazelcast.max.no.master.confirmation.seconds">600</property>
<property name="hazelcast.max.no.heartbeat.seconds">600</property>
</properties>
These properties define minimum cluster size requirements and extend timeout values for stable cluster formation.
Network Configuration for Fedora 42
Fedora 42’s firewall requires specific rules to allow Hazelcast cluster communication. Open the necessary ports using firewalld:
sudo firewall-cmd --permanent --add-port=5701-5708/tcp
sudo firewall-cmd --permanent --add-port=54327/tcp
sudo firewall-cmd --reload
These rules accommodate Hazelcast’s default port range and multicast discovery port. Additional ports may be required for Management Center and custom applications.
SELinux contexts might restrict Hazelcast network operations. Create a custom policy or set SELinux to permissive mode for initial testing:
sudo setsebool -P hazelcast_network_connect 1
Network interface binding ensures Hazelcast binds to the correct network adapter in multi-homed systems:
<network>
<interfaces enabled="true">
<interface>192.168.1.*</interface>
<interface>10.0.0.*</interface>
</interfaces>
</network>
This configuration restricts Hazelcast to specific network segments, enhancing security and preventing unintended cluster formations.
Starting and Managing Hazelcast
Starting Hazelcast Service
The Hazelcast CLI provides the simplest method for starting cluster members. Launch a Hazelcast member using:
hz start
This command starts a member with default configuration settings. For custom configurations, specify the configuration file:
hz start -c /path/to/hazelcast.xml
Systemd service management offers better control for production deployments. Create a dedicated user for Hazelcast operations:
sudo useradd -r -s /bin/false hazelcast
sudo mkdir -p /var/log/hazelcast
sudo chown hazelcast:hazelcast /var/log/hazelcast
Configure the systemd service with proper user context:
sudo tee /etc/systemd/system/hazelcast.service << 'EOF'
[Unit]
Description=Hazelcast In-Memory Data Grid
After=network.target
Wants=network.target
[Service]
Type=simple
User=hazelcast
Group=hazelcast
ExecStart=/usr/bin/hz start -c /etc/hazelcast/hazelcast.xml
ExecStop=/bin/kill -TERM $MAINPID
Restart=always
RestartSec=30
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
EOF
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable hazelcast.service
sudo systemctl start hazelcast.service
Monitoring and Verification
Cluster status verification ensures proper member discovery and formation. Check cluster membership using the CLI:
hz cluster list-members
This command displays all active cluster members, their addresses, and status information. Log analysis provides detailed insights into cluster behavior:
sudo journalctl -u hazelcast.service -f
Health checks validate cluster functionality and member connectivity:
hz cluster health
The health command reports cluster state, member count, and any detected issues. Regular monitoring prevents performance degradation and identifies potential problems before they impact applications.
Creating a Multi-Node Cluster
Multi-node cluster deployment extends Hazelcast’s capabilities across multiple servers for enhanced performance and fault tolerance. Configure each node with identical cluster names but unique network addresses.
Node-specific configuration files contain member-specific settings:
<network>
<public-address>192.168.1.100:5701</public-address>
<port auto-increment="false">5701</port>
</network>
Staggered startup prevents race conditions during cluster formation. Start the first node and wait for full initialization before starting additional members. Monitor cluster formation through logs and CLI commands.
Network topology considerations include subnet configurations, routing tables, and firewall rules across all cluster nodes. Consistent configuration ensures reliable member discovery and communication.
Installing and Configuring Management Center
Management Center Installation
Hazelcast Management Center provides comprehensive cluster monitoring and management capabilities through a web-based interface. Install Management Center using the RPM repository:
sudo dnf install hazelcast-management-center-5.5.7
Alternative installation methods include Docker deployment:
docker pull hazelcast/management-center:5.5.7
docker run -d -p 8080:8080 --name hazelcast-mc hazelcast/management-center:5.5.7
Binary distribution installation offers maximum flexibility:
wget https://repository.hazelcast.com/download/management-center/hazelcast-management-center-5.5.7.tar.gz
tar -xzf hazelcast-management-center-5.5.7.tar.gz
sudo mv hazelcast-management-center-5.5.7 /opt/hazelcast-mc
Create a systemd service for Management Center:
sudo tee /etc/systemd/system/hazelcast-mc.service << 'EOF'
[Unit]
Description=Hazelcast Management Center
After=network.target
[Service]
Type=simple
User=hazelcast
Group=hazelcast
ExecStart=/usr/bin/hz-mc start
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
Connecting Management Center to Cluster
Management Center requires explicit configuration for cluster connections. Launch Management Center and access the web interface at http://localhost:8080
.
Enable development mode for simplified setup during initial testing. Create a cluster connection using the default settings or specify custom cluster addresses and authentication credentials.
Configure cluster security if authentication is enabled:
<management-center>
<trusted-interfaces>
<interface>192.168.1.*</interface>
</trusted-interfaces>
</management-center>
Add this configuration to your Hazelcast cluster members to allow Management Center connections. Production deployments should implement proper authentication mechanisms and SSL encryption.
Management Center Features Overview
Management Center delivers comprehensive cluster insights through interactive dashboards and real-time monitoring. Key features include cluster topology visualization, member performance metrics, and data structure analysis.
Scripting capabilities enable automated management tasks and custom monitoring solutions. The integrated console provides direct access to cluster operations and data manipulation commands.
Alert configuration helps identify performance bottlenecks and system issues before they impact applications. Custom dashboards can be created for specific monitoring requirements and operational workflows.
Testing Your Installation
Basic Functionality Testing
Validate Hazelcast installation through comprehensive testing procedures. Create a simple test application to verify distributed map functionality:
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;
public class HazelcastTest {
public static void main(String[] args) {
ClientConfig clientConfig = new ClientConfig();
clientConfig.getNetworkConfig().addAddress("127.0.0.1:5701");
HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
IMap<String, String> map = client.getMap("test-map");
map.put("key1", "value1");
System.out.println("Retrieved value: " + map.get("key1"));
client.shutdown();
}
}
Compile and run this test application to verify cluster connectivity and basic operations. Data replication testing ensures proper backup behavior across cluster members.
Performance benchmarking validates system capabilities under various load conditions. Use Hazelcast’s built-in benchmarking tools or custom applications to measure throughput and latency characteristics.
Sample Application Development
Develop sample applications showcasing different Hazelcast features and use cases. Distributed queue implementations demonstrate message passing capabilities:
IQueue<String> queue = hazelcastInstance.getQueue("test-queue");
queue.offer("message1");
String message = queue.poll();
Set implementations provide distributed collection functionality:
ISet<String> distributedSet = hazelcastInstance.getSet("test-set");
distributedSet.add("element1");
boolean contains = distributedSet.contains("element1");
Client-server deployment testing validates remote connectivity and application integration patterns. Embedded deployment testing verifies in-process clustering capabilities for specific use cases.
Troubleshooting Common Issues
Installation and Startup Issues
Package dependency conflicts may prevent successful Hazelcast installation. Resolve dependencies using DNF’s dependency resolution capabilities:
sudo dnf install --best --allowerasing hazelcast-5.5.0
Java version incompatibilities cause startup failures and runtime errors. Verify Java compatibility and upgrade if necessary:
java -version
sudo alternatives --config java
Permission issues affect service startup and file access. Ensure proper ownership and permissions for Hazelcast directories:
sudo chown -R hazelcast:hazelcast /opt/hazelcast
sudo chmod -R 755 /opt/hazelcast
Service startup problems often stem from configuration errors or resource constraints. Examine systemd logs for detailed error information:
sudo journalctl -u hazelcast.service --no-pager
Network and Clustering Issues
Member discovery failures prevent cluster formation and cause split-brain scenarios. Verify network connectivity between cluster members:
telnet 192.168.1.100 5701
nc -zv 192.168.1.100 5701
Firewall restrictions block cluster communication and member discovery. Ensure all required ports are open and accessible:
sudo firewall-cmd --list-ports
sudo ss -tlnp | grep 5701
DNS resolution problems affect hostname-based member discovery. Use IP addresses instead of hostnames for reliable cluster formation:
<tcp-ip enabled="true">
<member>192.168.1.100</member>
<member>192.168.1.101</member>
</tcp-ip>
Split-brain prevention requires proper configuration and monitoring. Implement quorum-based cluster formation to prevent network partition issues.
Performance and Configuration Issues
Memory allocation problems cause OutOfMemoryError exceptions and performance degradation. Tune JVM heap settings for optimal performance:
export JAVA_OPTS="-Xmx4g -Xms4g -XX:+UseG1GC"
Serialization performance impacts data transfer efficiency between cluster members. Implement custom serialization for complex objects:
public class CustomSerializer implements StreamSerializer<CustomObject> {
// Implementation details
}
Configuration validation prevents common setup mistakes and ensures proper cluster behavior. Use Hazelcast’s configuration validation tools to identify potential issues before deployment.
Network optimization improves cluster communication performance and reduces latency. Configure appropriate buffer sizes and connection pooling parameters for high-throughput scenarios.
Security Considerations
Network Security
Transport Layer Security (TLS) encryption protects cluster communication from eavesdropping and tampering. Configure SSL/TLS in your Hazelcast configuration:
<network>
<ssl enabled="true">
<factory-class-name>com.hazelcast.nio.ssl.BasicSSLContextFactory</factory-class-name>
<properties>
<property name="keyStore">/path/to/keystore.jks</property>
<property name="keyStorePassword">password</property>
<property name="trustStore">/path/to/truststore.jks</property>
<property name="trustStorePassword">password</property>
</properties>
</ssl>
</network>
Authentication mechanisms prevent unauthorized cluster access and protect sensitive data. Implement LDAP or custom authentication providers for enterprise environments.
Firewall configuration should follow the principle of least privilege, opening only necessary ports and restricting access to authorized networks. Network segmentation isolates Hazelcast clusters from untrusted networks.
Data Security
Encryption at rest protects stored data from unauthorized access during persistence operations. Configure encryption for Hazelcast’s persistence features:
<persistence enabled="true">
<base-dir>/hazelcast/data</base-dir>
<encryption-at-rest enabled="true">
<algorithm>AES/CBC/PKCS5Padding</algorithm>
<key-id>key1</key-id>
</encryption-at-rest>
</persistence>
Access control mechanisms restrict data structure access based on user roles and permissions. Implement security policies for maps, queues, and other distributed data structures.
Audit logging tracks cluster operations and data access patterns for compliance and security monitoring. Configure comprehensive logging for security-sensitive operations and administrative actions.
Performance Optimization
JVM Tuning for Hazelcast
Garbage collection optimization significantly impacts Hazelcast performance, particularly for memory-intensive workloads. Configure G1 garbage collector for balanced performance:
export JAVA_OPTS="-Xmx8g -Xms8g -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions"
Heap sizing considerations balance memory utilization with garbage collection overhead. Allocate sufficient heap memory for data storage while avoiding excessive GC pauses.
JIT compilation optimization improves long-running application performance. Configure compiler thresholds and optimization flags for production workloads:
export JAVA_OPTS="${JAVA_OPTS} -XX:CompileThreshold=1000 -XX:+TieredCompilation"
Memory monitoring tools help identify allocation patterns and optimize heap usage. Use JProfiler, VisualVM, or similar tools for detailed memory analysis.
Cluster Optimization
Partition distribution affects data locality and query performance across cluster members. Configure appropriate partition counts based on cluster size and data distribution patterns:
<properties>
<property name="hazelcast.partition.count">271</property>
<property name="hazelcast.partition.backup.sync.timeout">30</property>
</properties>
Backup strategies balance data safety with performance characteristics. Synchronous backups provide stronger consistency guarantees while asynchronous backups offer better performance.
Network optimization reduces communication latency and improves cluster throughput. Configure TCP socket parameters and connection pooling for optimal performance:
<network>
<socket-options>
<buffer-direct>true</buffer-direct>
<tcp-no-delay>true</tcp-no-delay>
<keep-alive>true</keep-alive>
</socket-options>
</network>
Storage optimization affects persistence performance and recovery times. Use SSD storage for persistence operations and configure appropriate write policies for performance-critical applications.
Congratulations! You have successfully installed Hazelcast. Thanks for using this tutorial for installing Hazelcast real-time data platform on Fedora 42 Linux system. For additional help or useful information, we recommend you check the official Hazelcast website.