Level 1: Getting Started¶
The punchplatform deployment tools are powerful and modular. It is possible (and recommended) to start small and add more components or resources as you go, in particular if you discover the punchplatform and are not sure yet what will be your use case(s).
This chapter focuses on explaining the logic of deploying a single component (zookeeper) and setting up a platform operator. Once these are clear, it will be very simple for you to add more components and operators to compose your final platform.
We assume you have three target empty servers (server1
,
server2
and server3
) where you will deploy a
cluster of 3 zookeeper servers, and an operator on server1. We will do
that from the deployer
server, acting as the installer
laptor .
The deployer can be your macos or linux laptop. Here is the starting situation.
Configure Zookeeper¶
Edit first the punchplatform.properties
with your favorite
text editor file and include the following content
1 2 3 4 5 6 7 8 9 10 11 12 | { "zookeeper" : { "clusters" : { "common" : { "hosts" : ["server1", "server2", "server3"], "cluster_port" : 2181, "punchplatform_root_node" : "/punchplatform" } }, "install_dir": "/data/opt/zookeeper-3.5.5-bin" } } |
Next edit the punchplatform-deployment.settings
file and include the
following:
1 2 3 4 5 6 7 8 9 10 11 | { "setups_root" : "/data/opt", "remote_data_root_directory" : "/data", "remote_logs_root_directory" : "/var/log/punchplatform", "punchplatform_daemons_user" : "punchplatform", "punchplatform_group" : "punchplatform", "zookeeper_version" : "zookeeper-3.5.5-bin", "zookeeper_nodes_production_interface" : "eth1", "zookeeper_admin_cluster_name": "common", "zookeeper_childopts" : "-server -Xmx256m -Xms256m" } |
Info
Adapt the properties to suit your environment in particular the
zookeeper_nodes_production_interface
, as well as unix user and
groups.
For example if you use a vagrant box the user is likely to be
'ubuntu' and the network interface 'enp0s8'. In doubt you can find out what is the right
network intefaces using the ifconfig
command.
Make sure you have the requirements installed on the deployer and target servers. In particular the deployer must have ssh access to the target server.
Check and Generate Your Configurations¶
First execute this command:
1 | $ punchplatform-deployer.sh --generate-inventory |
Or in short:
1 | $ punchplatform-deployer.sh -gi |
This command generates a complete set of so-called inventories from your two configuration files. It should output something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | $ punchplatform-deployer.sh --generate-inventory LOG: checking your dependencies... LOG: all the required packages are installed ! LOG: audit the punchplatform configuration... LOG: found punchplatform.properties: /Users/dimi/Punch/deployer/conf/punchplatform.properties LOG: found punchplatform-deployment.settings: /Users/dimi/Punch/deployer/conf/punchplatform-deployment.settings LOG: generating deployment configuration from punchplatform.properties + punchplatform-deployment.settings... LOG: Following groups and tags can bu used as additional parameters like: punchplatform-deployer.sh --deploy [-Kk] [-l group1,group2] [-t tag1,tag2] - group: punchplatform_cluster tag: N/A - group: zookeeper_servers tag: zookeeper LOG: configuration is ready for the deployment ! |
If that succeeds you can proceed.
Deploy Your Component(s)¶
From the deployer, make sure you can access your target server using ssh. Depending on your ssh configuration this may require a ssh password. Simply execute the following command.
1 | punchplatform-deployer.sh --deploy -Kk --tags zookeeper |
Note
You will be prompted (or not) for a ssh password. This depends on your ssh configuration.
Check your deployment¶
1 2 3 4 5 6 | ssh server1 # On Ubuntu sudo supervisorctl status zookeeper RUNNING pid 903, uptime 1:16:39 # On systemctl sudo systemctl status zookeeper |
This only confirm that the zookeeper server process is launched.
In order to confirm the overall zookeeper cluster status, you can refer to Zookeeper status checking HOWTO.
If your zookeeper cluster is UP, then you can push the first version of your reference platform configuration :
1 | punchplatform-putconf.sh -zkn common -pf |
Note than from a deployed operator environment, the '-zkn common' options would not be needed, because the operator environment have the PUNCHPLATFORM_CONF_URL set to provide the admin zookeeper instance connection string.
Add more components¶
We suggest you now add a Storm r Kafka cluster to your platform. For this refer to the punchplatform.properties and punchplatform_deployment.settings. Add in each file the required properties and simply reexecute the deployer.
1 | punchplatform-deployer.sh --deploy -Kk --tags storm |
You are ready to go.