Click here to load reader

Using SaltStack To AutoDeploy ElasticSearch

  • View
    1.765

  • Download
    3

Embed Size (px)

DESCRIPTION

ESCC#2 over online meeting,a tutorial about how to deploy elasticsearch by using saltstack. related assets can be found from this link:http://pan.baidu.com/s/1o6NkjCe#dir/path=%2Fsalt-es

Text of Using SaltStack To AutoDeploy ElasticSearch

  • 1.SaltStackES Medcl2014.01.19elasticsearch.cn1

2. Agenda SaltStack Salt Salt ElasticSearchelasticsearch.cn2 3. Whats SaltStack SaltStack is systems and configuration management software used to automate any infrastructure, cloud or DevOps functionelasticsearch.cn3 4. Intro 2011 100%, Apache 2.0 C/S,master/minion elasticsearch.cn4 5. Feature Masterless elasticsearch.cn5 6. Concept Master Minion Salt States Pillar Grains GitFS Targets Render elasticsearch.cn6 7. Grains minion salt '*' grains.ls salt '*' grains.items minion vi /etc/salt/minionelasticsearch.cn7 8. Pillar Pillarkey-valueyaml foo: bar Pillarminion OS RedHathttpdDebianapache2 192ipxxxipxxxxx salt '*' pillar.data {{ pillar['pkgs']['apache'] }} {{ salt['pillar.get']('pkgs:apache', 'httpd') }}elasticsearch.cn8 9. Pillarelasticsearch.cn9 10. Salt States YAMLSLSSaLt State elasticsearch.cn10 11. Salt Stateselasticsearch.cn11 12. Master IP:192.168.56.104 yum install salt-master -y vi /etc/salt/master auto_accept: True/etc/init.d/salt-master startelasticsearch.cn12 13. auto_accept: True file_roots: base: - /srv/salt fileserver_backend: - roots file_ignore_glob: - '*.pyc' - '*.swp' pillar_roots: base: - /srv/pillar elasticsearch.cn13 14. Minion IP:192.168.56.102103 yum install salt-minion -y vi /etc/salt/minion master: 192.168.56.104 id: node-2/etc/init.d/salt-minion restart elasticsearch.cn14 15. salt salt-key minion salt-call salt-run salt-runner salt-ssh SSH salt-syndic Master salt-cp elasticsearch.cn15 16. salt '*' test.ping salt '*.example.net' test.ping salt 'web?.example.net' test.ping salt 'web[1-5]' test.ping salt -E 'es-[1-2]|ufo-1' cmd.run 'ls /usr/local/ salt -L 'web1,web2,web3' test.ping salt -G 'os:CentOS' test.ping salt -N group1 test.ping salt -C 'webser and [email protected]:Debian or [email protected]*' test.ping elasticsearch.cn16 17. http://docs.saltstack.com/ref/modules/all/index.html salt '*' cmd.run 'ls -l /etc salt '*' cmd.run "uptime salt '*' cmd.run 'java -version salt '*' grains.item mem_total salt '*' status.meminfo salt '*' disk.usagesalt '*' pkg.install vim salt '*' network.interfaceselasticsearch.cn17 18. Minionelasticsearch.cn18 19. Salt-SSHelasticsearch.cn19 20. Batch Size salt '*' -b 1 test.ping salt -G 'os:CentOS' --batch-size 25% test.ping Batch Size elasticsearch.cn20 21. halite https://github.com/saltstack/haliteelasticsearch.cn21 22. ELASTICSEARCHelasticsearch.cn23 23. 1.ES 2.ES 3.ES : elasticsearch.cn24 24. States JAVA elasticsearch ElasticSearch ElasticSearch ElasticSearchelasticsearch.cn25 25. Pillar ElasticSearch HEAP_SIZE ElasticSearch elasticsearch.cn26 26. elasticsearch.cn27 27. top.sls base: '*': - base - users - java - elasticsearch salt/top.sls elasticsearch.cn28 28. Demo salt '*' state.highstate salt '*' cmd.run 'java -version salt '*' cmd.run 'netstat -ano|grep 9200 salt '*' cmd.run '/etc/init.d/elasticsearch status curl -XGET http://192.168.56.103:9200/_cluster/healthelasticsearch.cn29 29. Links http://saltstack.org/ https://github.com/saltstack/salt http://elasticsearch.cn http://wiki.elasticsearch.cnelasticsearch.cn30 30. ESCC#2 ES ElasticSearch China Conference 2014 =+elasticsearch.cn31 31. salt -G 'os:CentOS' cmd.run 'poweroff'elasticsearch.cn32 32. Thank you. nihaokefu.com SAASelasticsearch.cn33