diff --git a/3_Node_Cluster_Linux/README.md b/3_Node_Cluster_Linux/README.md new file mode 100644 index 0000000..2fa8b3c --- /dev/null +++ b/3_Node_Cluster_Linux/README.md @@ -0,0 +1,34 @@ +# Certificate Generation Script for EventStoreDB + +This script automates the process of generating root and node certificates for EventStoreDB clusters on Linux environments. Follow the instructions below to download, prepare, and execute the script. + +## Instructions for use + +### Download the script + +1. Save the script to a file, for example, `generate_certs.sh`. + +### Make it executable + +2. Change the file's permissions to make it executable by running: + +```bash +chmod +x generate_certs.sh + +``` +### Execute the script by running: + +`./generate_certs.sh`. + +## Notes + +- The script will prompt you to manually download the certificate generator from the Event Store CLI repository. +- You will need to replace placeholder paths within the script with actual paths relevant to your envrionment. +- Given the manual download step and the necessity for user input for specific paths and DNS names, this script serves primarily as an instructional guide. + +### Additional resources + +For further details on setting up EventStoreDB clusters and configuring them with generated certificates, refer to the official EventStore documentation: + +- [EventStore Certificate Generation CLI repository](https://github.com/EventStore/es-gencert-cli/releases) +- [cluster with DNS guide](https://developers.eventstore.com/server/v23.10/cluster.html#cluster-with-dns) \ No newline at end of file diff --git a/3_Node_Cluster_Linux/generate_ca.sh b/3_Node_Cluster_Linux/generate_ca.sh new file mode 100644 index 0000000..4c46664 --- /dev/null +++ b/3_Node_Cluster_Linux/generate_ca.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Generating Certificates Script + +# Step 1: Create 'Generate_certificate' folder on the desktop + +echo "Creating 'Generate_certificate' folder on the desktop..." +mkdir -p ~/Desktop/Generate_certificate +echo "Folder created." + +# Step 2: Download and extract the certificate generator +# Note: This step requires manual download from the EventStore Certificate Generation CLI repository +# Visit: https://github.com/EventStore/es-gencert-cli/releases + +echo "Please download the latest version of the certificate generator from the EventStore CLI repository and extract it into the 'Generate_certificate' folder." + +# Step 3: Generating the root certificate and root private key +# Replace [Generate_certificate Path] with the actual path to your 'Generate_certificate' directory + +echo "Generating the root certificate and root private key..." +cd ~/Desktop/Generate_certificate/es-gencert-cli +./es-gencert-cli create-ca -out ~/Desktop/Generate_certificate/ca +echo "Root certificate and private key generated." + +# Instructions for generating node certificates +echo "To generate certificates and private keys for each node, run the following commands one at a time, adjusting the path and node number as necessary." + +# Example command for Node1 + +echo "Example for Node1 (adjust paths and DNS names as needed):" +echo "./es-gencert-cli create-node -ca-certificate /path/to/Generate_certificate/es-gencert-cli_1.2.1_Linux-x86_64/ca/ca.crt -ca-key /path/to/Generate_certificate/es-gencert-cli_1.2.1_Linux-x86_64/ca/ca.key -out /path/to/Cluster/Node1/certificates -dns-names your.node1.dns.com" + +# Reminder for including CA certificate and key paths in each node's configuration file +echo "Remember to include CA certificate and key paths in each node's configuration file as shown in the provided configuration file example." + diff --git a/3_Node_Cluster_Win/README.md b/3_Node_Cluster_Win/README.md new file mode 100644 index 0000000..8ead0ea --- /dev/null +++ b/3_Node_Cluster_Win/README.md @@ -0,0 +1,57 @@ +# EventStoreDB Certificate Generation Guide for Windows + +This guide assists Windows users in generating root and node certificates for EventStoreDB clusters using a batch script. Follow the steps below to use the script effectively. + +## Prerequisites + +Before you begin, ensure you have downloaded the `es-gencert-cli` tool from the EventStore Certificate Generation CLI repository. This tool is required to generate the certificates. + +- [EventStore Certificate Generation CLI Repository](https://github.com/EventStore/es-gencert-cli/releases) + +## Instructions for use + +### 1. Prepare the script + +Save the provided script into a file named `generate_certs.bat`. + +### 2. Download and extract the certificate generator + +Manually download the latest version of the certificate generator (`es-gencert-cli`) from the EventStore Certificate Generation CLI repository. Extract the downloaded archive into a folder named `Generate_certificate` on your desktop or another preferred location. + +### 3. Edit the script to reflect your paths + +Before running the script, you need to edit `[Generate_certificate Path]` within the script to match the actual path where you extracted the `es-gencert-cli` tool. This adjustment is crucial for the script to function correctly. + +### 4. Run the script + +Right-click on `generate_certs.bat` and select "Run as administrator." This step is necessary to ensure the script has sufficient permissions to generate certificates. + +### Generating node certificates + +After generating the root certificate, the script will instruct you to generate certificates and private keys for each node. You must adjust the paths, node numbers, and DNS names as necessary for your specific configuration. + +For example: + +```bat +.\es-gencert-cli.exe create-node -ca-certificate \path\to\folder\Generate_certificate\es-gencert-cli_1.2.1_Windows-x86_64\ca\ca.crt -ca-key \path\to\folder\Generate_certificate\es-gencert-cli_1.2.1_Windows-x86_64\ca\ca.key -out \path\to\folder\Cluster\Node1\certificates -dns-names your.node1.dns.com +``` +Repeat this process for each node in your cluster, ensuring the paths and DNS names are correctly configured. + + +### Configuring each node + +After generating the certificates, you'll need to configure each node by editing its configuration file to include the paths to tis certificate, private key, and the trusted root certificates. Adjust the paths and settings as necessary, based on the example configuration provided in the script comments. + + +## Notes + +- The script will prompt you to manually download the certificate generator from the Event Store CLI repository. +- You will need to replace placeholder paths within the script with actual paths relevant to your envrionment. +- Given the manual download step and the necessity for user input for specific paths and DNS names, this script serves primarily as an instructional guide. + +### Additional resources + +For further details on setting up EventStoreDB clusters and configuring them with generated certificates, refer to the official EventStore documentation: + +- [EventStore Certificate Generation CLI repository](https://github.com/EventStore/es-gencert-cli/releases) +- [cluster with DNS guide](https://developers.eventstore.com/server/v23.10/cluster.html#cluster-with-dns) \ No newline at end of file diff --git a/3_Node_Cluster_Win/generate_ca.bat b/3_Node_Cluster_Win/generate_ca.bat new file mode 100644 index 0000000..6afe434 --- /dev/null +++ b/3_Node_Cluster_Win/generate_ca.bat @@ -0,0 +1,19 @@ +@echo off +:: This script generates the root certificate and root private key for your EventStoreDB cluster on Windows. +:: Ensure you replace [Generate_certificate Path] with the actual path to your 'Generate_certificate' directory. + +.\es-gencert-cli.exe create-ca -out [Generate_certificate Path]\ca +echo Root certificate and private key have been generated. + +:: To generate certificates and private keys for each node, navigate to your 'Generate_certificate' directory. + +:: Run the following commands, one for each node, adjusting paths, node numbers, and DNS names as necessary. + +:: For example, for 'Node1' with certificate generator version 1.2.1: +:: .\es-gencert-cli create-node -ca-certificate \path\to\folder\Generate_certificate\es-gencert-cli_1.2.1_Windows-x86_64\ca\ca.crt -ca-key \path\to\folder\Generate_certificate\es-gencert-cli_1.2.1_Windows-x86_64\ca\ca.key -out \path\to\folder\Cluster\Node1\certificates -dns-names your.node1.dns.com + +:: Repeat the above step for each node, ensuring to use the correct paths and DNS names. + +:: After generating the certificates, configure each node by editing its configuration file. Include paths to its certificate, the private key, and the trusted root certificates. Refer to the provided configuration file example and adjust paths and settings as necessary. + +pause