Deploy the platform¶
Warning
From now on, all the commands for this tutorial will have to be run on the Punch Deployer VM.
Use vagrant ssh deployer
to connect to this VM.
Configure Environment¶
Add the punchplatform-deployer.sh
script to your PATH:
echo "export PATH=~/punch-deployer-6.4.5-SNAPSHOT/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc
Create deployment folder¶
Create a folder to add deployment configuration:
mkdir ~/pp-deployment-conf
cp ~/punch-deployer-6.4.5-SNAPSHOT/examples/platforms/getting_started_deployer/deployment-conf/punchplatform-deployment.settings ~/pp-deployment-conf
cp ~/punch-deployer-6.4.5-SNAPSHOT/examples/platforms/getting_started_deployer/deployment-conf/resolv.yaml ~/pp-deployment-conf
cp -R ~/punch-deployer-6.4.5-SNAPSHOT/examples/platforms/getting_started_deployer/deployment-conf/security/ ~/pp-deployment-conf
The punchplatform-deployment.settings
file describes your target platform.
It specifies what, where and how components should be installed on your target nodes.
The resolv.yaml
files adds parameters to your configuration files.
In this tutorial, we will use it to make standalone configuration works on a 3-node platform.
The security/
folder contains all the files for passwords for authentication and credentials for TLS.
Finally, set the mandatory PUNCHPLATFORM_CONF_DIR
variable to point to your deployment configuration folder:
echo "export PUNCHPLATFORM_CONF_DIR=~/pp-deployment-conf" >> ~/.bashrc
source ~/.bashrc
Generate inventory¶
Execute:
punchplatform-deployer.sh --generate-inventory
punchplatform-deployment.settings
in the $PUNCHPLATFORM_CONF_DIR
and generates a complete set of Ansible inventories to deploy the corresponding components on your target servers.
You can check the newly generated inventories in $PUNCHPLATFORM_CONF_DIR/generated_inventory
.
The main inventory is current-deployment.inv
. The other inventories are specific for each component.
Deploy Zookeeper¶
To deploy Zookeeper use:
punchplatform-deployer.sh --deploy --tags zookeeper -e @/home/vagrant/pp-deployment-conf/security/deployment_secrets.json
Zookeeper will be deployed on your target servers according to the configuration
specified in your punchplatform-deployment.settings
:
cat $PUNCHPLATFORM_CONF_DIR/punchplatform-deployment.settings | jq .zookeeper
It returns the part of the file where Zookeeper is configured.
{
"zookeeper_version": "apache-zookeeper-3.7.0-bin",
"zookeeper_nodes_production_interface": "eth1",
"zookeeper_childopts": "-server -Xmx128m -Xms128m",
"clusters": {
"common": {
"hosts": [
"server3"
],
"cluster_port": 2181,
"punchplatform_root_node": "/punchplatform-primary"
}
}
}
Deploy other COTS¶
You can use --tags
to deploy components one by one.
You can also deploy all the components without using this option.
Let's deploy the other components required for the rest of this tutorial.
punchplatform-deployer.sh --deploy -t zookeeper,kafka,shiva,operator,elasticsearch,kibana -e @/home/vagrant/pp-deployment-conf/security/deployment_secrets.json
Info
The -e @/home/vagrant/pp-deployment-conf/deployment_secrets.json
specifies a file containing credentials.
In this tutorial, the file only has the credentials to deploy Elasticsearch with admin:admin
.
On a production platform, it contains all the credentials and is encrypted with Ansible Vault.