InsightDataScience/ansible-playbook
InsightDataScience/ansible-playbook has 67 GitHub stars and 42 forks. Star changes are not measured yet. Last checked 2026-11-14 11:46 UTC. Last push 2017-11-20.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
Ansible playbook to deploy distributed technologies
데이터README.md
OriginalAnsible playbook to deploy distributed technologies
This project is a set of Ansible playbooks to easily install a set of distributed technologies on AWS
Table of Contents
Supported playbooks
- EC2
- Zookeeper
- Kafka
Supported Commands
~$ ansible-playbook <master-playbook>.yml --extra-vars "<var1>=<value1> <var2>=<value2>" --tags "<tag1>,<tag2>"
- EC2 playbook is controlled by a yaml file containing variables for the EC2 instances to be acted on. More details below
- Zookeeper, Kafka, and Vowpal Wabbit playbooks need respective cluster tags to be specified to identify which nodes are in the cluster and need to be acted on. More details below
Setup
On your local/remote machine
- Setup ansible for your system
- Create following folders
~$ mkdir -p /etc/ansible/hosts
- Clone this repo
~$ git clone https://github.com/InsightDataScience/ansible-playbook.git
- Copy the
ec2.pyandec2.inifiles in this repo to/etc/ansible/hosts - Update information in
ansible_example.cfgand move it to/etc/ansible/ansible.cfg - Export AWS credentials as environment variables
export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXX
Using Docker container
- Setup Docker for your system
- Clone this repo
~$ git clone https://github.com/InsightDataScience/ansible-playbook.git
- Build your docker image locally with the following command - run this from the root folder of this repo
~$ docker build -t ansible-playbook -f conf/Dockerfile .
- Run the docker container in interactive mode using the script in the repo -
run_ansible_playbook_container.sh
~$ ./run_ansible_playbook_container.sh
- Update information in
/etc/ansible/ansible.cfgconfig file inside the container - Export AWS credentials in
~/.profileinside the container
export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXX
Playbooks
###EC2
Launch/Start/Stop/Terminate EC2 instances on AWS.
####Variable file:
Update
example_ec2_vars.ymlas per your requirementEC2 playbook is controlled by a yaml file with variables defined for the EC2 instances. An example variable file -
example_ec2_vars.yml- is included in this repo. You can define your own yaml file with the following information:--- key_pair: <key-name> instance_type: <instance-type> region: <region> security_group_id: <security-group-id> num_instances: <num-of-instances> subnet_id: <subent-id> tag_key_vals: Name: <cluster-name> <custom-tag-key1>: <custom-tag-val1> <custom-tag-key2>: <custom-tag-val2>The
Nametag in thetag_key_valsis mandatory to create an identifier for the instances. More tags can be added if needed but are optional.In your terminal, you will likely also need to add your private key to an ssh agent:
ssh-add </path/to/my.pem>####Launch EC2 instances:
~$ ansible-playbook ./ec2.yml --extra-vars "vars_file=./example_ec2_vars.yml" --tags launch####Stop EC2 instances:
~$ ansible-playbook ./ec2.yml --extra-vars "vars_file=./example_ec2_vars.yml" --tags stop####Start EC2 instances:
~$ ansible-playbook ./ec2.yml --extra-vars "vars_file=./example_ec2_vars.yml" --tags start####Terminate EC2 instances:
~$ ansible-playbook ./ec2.yml --extra-vars "vars_file=./example_ec2_vars.yml" --tags terminate
###Zookeeper For Zookeeper playbook, a
zookeeper_tagneeds to be specified to identify the nodes in the cluster. Thiszookeeper_tagcan be any tag specified intag_key_valsin the variable file for [EC2]( while launching EC2 instances.The
zookeeper_tagis specifed as<key>_<value>for one of thetag_key_valsto be used. For example, if the<cluster-name>in the EC2 variable file mentioned above wastest-cluster, thezookeeper_tagwould be specified aszookeeper_tag=Name_test-cluster. It doesn't have to be theNametag but could be any key value pair intag_key_valsspecified aszookeeper_tag=<key>_<value>.####Install Zookeeper:
~$ ansible-playbook ./zookeeper.yml --extra-vars "zookeeper_tag=<cluster_tag>" --tags install####Start Zookeeper:
~$ ansible-playbook ./zookeeper.yml --extra-vars "zookeeper_tag=<cluster_tag>" --tags start####Get info about Zookeeper on the specified cluster:
~$ ansible-playbook ./zookeeper.yml --extra-vars "zookeeper_tag=<cluster_tag>" --tags info####Stop Zookeeper:
~$ ansible-playbook ./zookeeper.yml --extra-vars "zookeeper_tag=<cluster_tag>" --tags stop####Uninstall Zookeeper:
~$ ansible-playbook ./zookeeper.yml --extra-vars "zookeeper_tag=<cluster_tag>" --tags uninstall
###Kafka Kafka has a dependency on Zookeeper for cluster membership, topic configuration, data partition, etc. For Kafka playbook, a
zookeeper_tagand akafka_tagneeds to be specified to identify the nodes in the zookeeper and kafka cluster respectively. Thekafka_tagandzookeeper_tagcan be any tag specified intag_key_valsin the variable file for EC2.The
kafka_tagandzookeeper_tagare specifed as<key>_<value>for one of thetag_key_valsto be used. For example, if the<cluster-name>in the EC2 variable file mentioned above wastest-clusterand we had same cluster for Zookeeper and Kafka, thekafka_tagandzookeeper_tagwould be specified aszookeeper_tag=Name_test-clusterandkafka_tag=Name_test-clusterrespectively. Both Zookeeper and Kafka don't have to be on the same cluster and it doesn't have to be theNametag but it could be any key value pair intag_key_valsspecified aszookeeper_tag=<key>_<value>andkafka_tag=<key>_<value>.####Kafka's dependency on Zookeeper
Kafka's dependency on Zookeeper is taken care of by the Kafka playbook. If you are trying to ssetup Kafka on the cluster specified by
kafka_tag, the playbook will check that Zookeeper is installed on the clusterzookeeper_tagand if it is not setup, the playbook will first setup Zookeeper and then Kafka. By default, any operation on Kafka cluster, likestart,install, etc., will first be executed on the Zookeeper cluster. However, we would want some of the operations to be executed on the Kafka cluster, likestop,uninstall, etc., not be executed on the Zookeeper cluster. This can be achieved by specifying a flag--skip-tags zookeeperwhile running the Kafka playbook. Examples for this behavior are shown below in thestopanduninstalloperations.####Install Kafka:
~$ ansible-playbook ./kafka.yml --extra-vars "zookeeper_tag=<cluster_tag> kafka_tag=<cluster_tag>" --tags install####Start Kafka:
~$ ansible-playbook ./kafka.yml --extra-vars "zookeeper_tag=<cluster_tag> kafka_tag=<cluster_tag>" --tags start####Get info about Kafka on the specified cluster:
~$ ansible-playbook ./kafka.yml --extra-vars "zookeeper_tag=<cluster_tag> kafka_tag=<cluster_tag>" --tags info####Stop Kafka:
~$ ansible-playbook ./kafka.yml --extra-vars "zookeeper_tag=<cluster_tag> kafka_tag=<cluster_tag>" --tags stop --skip-tags zookeeper####Uninstall Kafka:
~$ ansible-playbook ./kafka.yml --extra-vars "zookeeper_tag=<cluster_tag> kafka_tag=<cluster_tag>" --tags uninstall --skip-tags zookeeper
Vowpal Wabbit
Vowpal Wabbit is a fast out-of-core Machine Learning system. Installation can take upwards of 10 minutes on micro instances, as it compiles a lot of C++ with high optimization levels using Clang.
####Install Vowpal Wabbit:
~$ ansible-playbook ./vw.yml --extra-vars "vw_tag=class_vw" --tags install
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,725 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,897 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,491 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,522 스타