zoukankan      html  css  js  c++  java
  • Openstack & Ansible

    Opennstack

    • Open source software for creating private and public clouds

    • Manages the servers at these sites so you can create Virtual Machines (VMs) for your apps / services to run on

    • Can create VMs using the UI or through scripts

    • Once created, can click on the instance name in the UI to find the IP

    • nslookup on the IP to find the hostname (hostname can be worked out from the Openstack account and the instance name as well)

    • SSH onto the IP / host as root, using the appropriate private key

    • Check instance has correct resources by running lscpu / free -h / df -h

    Heat

    • Heat is the main project in the OpenStack Orchestration program (Orchestration: Coordinate servers to work together). It implements an orchestration engine to launch multiple composite cloud applications based on templates in the form of text files that can be treated like code.

    • A heat template can create multiple volumes & VMs

    • heat stack-create
      -f openstack/templates/demo-template.yaml
      cr-demo

    Openstack vs  AWS vs Raw tin

    • Openstack is mainly for creating private cloud and is open source while AWS is mainly a public cloud.

    • Network speed in AWS would be slower than that in Openstack, as the AWS machines are in Ireland.

    • Network speed in Openstack would be slower than that in raw tin servers, as the openstack servers have an virtualization layer.

    Ansible

    • After created blan VM in openstack, could use Ansible to create non-root users, copy ssh keys, install java, install/delete cronjobs

    • “[Ansible] can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates”

    • Why not Puppet / Chef / x?

      • No need for a ‘master’ node (just run from your laptop!)

    • Inventory Files

      • Specify which servers to configure

      • Group servers together (eg. ‘Dash Servers’)

      • Can be Static or Dynamic

        • Static = hard-coded IPs or hostnames

        • Dynamic = query a provider like AWS… Or Openstack!

    • Roles

      • Define a set of tasks to apply to a group of servers

      • Eg. group together tasks for a standard Java app server, and apply those tasks to all Java app servers

    • Tasks

      • Define specific actions to carry out on a server

      • Eg. Install Java 8

      • Eg. Copy file x from my Ansible repo to the server

      • Eg. Copy template y from my Ansible repo to the server

      • Eg. Restart service z on the server

    • Variables

      • Tasks and templates may reference variables

      • Variables can be set against:

        • Specific servers (in inventory files / inventory folders)

        • Groups of servers (in group_vars)

    Conclusion

    • Statically create VMs in Openstack
    • Use Ansible to manage VMs
        • Installing software (Java, sqlite, filebeat, etc)

        • Managing app scripts (deploy / stop / start)

        • Managing cronjobs (log deletion scripts)

        • Managing SSH Keys

        • Managing config (New Relic, filebeat)

  • 相关阅读:
    Socket异步通信
    以读取博客园随笔备份为例 将xml 序列化成json,再序列化成对象
    NhibernateProfiler写个自动破解工具
    关于下载GAE High Replication Datastore数据
    .text 0.958 数据添加
    C#实现RTP数据包传输参照RFC3550
    在线商城表结构
    相似字符串
    .net 4.0 的Socket写的支持跨平台双工的轻量级通讯组件
    写一个迷你版Smarty模板引擎,对认识模板引擎原理非常好(附代码)
  • 原文地址:https://www.cnblogs.com/codingforum/p/6583821.html
Copyright © 2011-2022 走看看