github.com/mattyw/juju@v0.0.0-20140610034352-732aecd63861/cmd/juju/help_topics.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package main
     5  
     6  const helpBasics = `
     7  Juju -- devops distilled
     8  https://juju.ubuntu.com/
     9  
    10  Juju provides easy, intelligent service orchestration on top of environments
    11  such as Amazon EC2, HP Cloud, OpenStack, MaaS, or your own local machine.
    12  
    13  Basic commands:
    14    juju init             generate boilerplate configuration for juju environments
    15    juju bootstrap        start up an environment from scratch
    16  
    17    juju deploy           deploy a new service
    18    juju add-relation     add a relation between two services
    19    juju expose           expose a service
    20  
    21    juju help bootstrap   more help on e.g. bootstrap command
    22    juju help commands    list all commands
    23    juju help glossary    glossary of terms
    24    juju help topics      list all help topics
    25  
    26  Provider information:
    27    juju help azure-provider       use on Windows Azure
    28    juju help ec2-provider         use on Amazon EC2
    29    juju help hpcloud-provider     use on HP Cloud
    30    juju help local-provider       use on this computer
    31    juju help openstack-provider   use on OpenStack
    32  `
    33  
    34  const helpProviderStart = `
    35  Start by generating a generic configuration file for Juju, using the command:
    36  
    37    juju init
    38  
    39  This will create the '~/.juju/' directory (or $JUJU_HOME, if set) if it doesn't
    40  already exist and generate a file, 'environments.yaml' in that directory.
    41  `
    42  const helpProviderEnd = `
    43  See Also:
    44  
    45    juju help init
    46    juju help bootstrap
    47  
    48  `
    49  
    50  const helpLocalProvider = `
    51  The local provider is a Linux-only Juju environment that uses LXC containers as
    52  a virtual cloud on the local machine.  Because of this, lxc and mongodb are
    53  required for the local provider to work. All of these dependencies are tracked
    54  in the 'juju-local' package. You can install that with:
    55  
    56    sudo apt-get update
    57    sudo apt-get install juju-local
    58  
    59  After that you might get error for SSH authorised/public key not found. ERROR
    60  SSH authorised/public key not found.
    61  
    62    ssh-keygen -t rsa
    63  
    64  Now you need to tell Juju to use the local provider and then bootstrap:
    65  
    66    juju switch local
    67    juju bootstrap
    68  
    69  The first time this runs it might take a bit, as it's doing a netinstall for
    70  the container, it's around a 300 megabyte download. Subsequent bootstraps
    71  should be much quicker. You'll be asked for your 'sudo' password, which is
    72  needed because only root can create LXC containers. When you need to destroy
    73  the environment, do 'juju destroy-environment local' and you could be asked
    74  for your 'sudo' password again.
    75  
    76  You deploy charms from the charm store using the following commands:
    77  
    78    juju deploy mysql
    79    juju deploy wordpress
    80    juju add-relation wordpress mysql
    81  
    82  For Ubuntu deployments, the local provider will prefer to use lxc-clone to create
    83  the machines for the trusty OS series and later.
    84  A 'template' container is created with the name
    85    juju-<series>-template
    86  where <series> is the OS series, for example 'juju-trusty-template'.
    87  You can override the use of clone by specifying
    88    lxc-clone: true
    89  or
    90    lxc-clone: false
    91  in the configuration for your local provider.  If you have the main container
    92  directory mounted on a btrfs partition, then the clone will be using btrfs
    93  snapshots to create the containers. This means that clones use up much
    94  less disk space.  If you do not have btrfs, lxc will attempt to use aufs
    95  (an overlay type filesystem). You can explicitly ask Juju to create
    96  full containers and not overlays by specifying the following in the provider
    97  configuration:
    98    lxc-clone-aufs: false
    99  
   100  
   101  References:
   102  
   103    http://askubuntu.com/questions/65359/how-do-i-configure-juju-for-local-usage
   104    https://juju.ubuntu.com/docs/getting-started.html
   105  `
   106  
   107  const helpOpenstackProvider = `
   108  Here's an example OpenStack configuration:
   109  
   110    sample_openstack:
   111      type: openstack
   112  
   113      # Specifies whether the use of a floating IP address is required to
   114      # give the nodes a public IP address. Some installations assign public
   115      # IP addresses by default without requiring a floating IP address.
   116      # use-floating-ip: false
   117  
   118      # Specifies whether new machine instances should have the "default"
   119      # Openstack security group assigned.
   120      # use-default-secgroup: false
   121  
   122      # Usually set via the env variable OS_AUTH_URL, but can be specified here
   123      # auth-url: https://yourkeystoneurl:443/v2.0/
   124  
   125      # The following are used for userpass authentication (the default)
   126      # auth-mode: userpass
   127  
   128      # Usually set via the env variable OS_USERNAME, but can be specified here
   129      # username: <your username>
   130  
   131      # Usually set via the env variable OS_PASSWORD, but can be specified here
   132      # password: <secret>
   133  
   134      # Usually set via the env variable OS_TENANT_NAME, but can be specified here
   135      # tenant-name: <your tenant name>
   136  
   137      # Usually set via the env variable OS_REGION_NAME, but can be specified here
   138      # region: <your region>
   139  
   140  If you have set the described OS_* environment variables, you only need "type:".
   141  References:
   142  
   143    http://juju.ubuntu.com/docs/provider-configuration-openstack.html
   144    http://askubuntu.com/questions/132411/how-can-i-configure-juju-for-deployment-on-openstack
   145  
   146  Other OpenStack Based Clouds:
   147  
   148  This answer is for generic OpenStack support, if you're using an OpenStack-based
   149  provider check these questions out for provider-specific information:
   150  
   151    https://juju.ubuntu.com/docs/config-hpcloud.html
   152  
   153  `
   154  
   155  const helpEC2Provider = `
   156  Configuring the EC2 environment requires telling Juju about your AWS access key
   157  and secret key. To do this, you can either set the 'AWS_ACCESS_KEY_ID' and
   158  'AWS_SECRET_ACCESS_KEY' environment variables[1] (as usual for other EC2 tools)
   159  or you can add access-key and secret-key options to your environments.yaml.
   160  These are already in place in the generated config, you just need to uncomment
   161  them out. For example:
   162  
   163    sample_ec2:
   164      type: ec2
   165      # access-key: YOUR-ACCESS-KEY-GOES-HERE
   166      # secret-key: YOUR-SECRET-KEY-GOES-HERE
   167  
   168  See the EC2 provider documentation[2] for more options.
   169  
   170  Note If you already have an AWS account, you can determine your access key by
   171  visiting your account page[3], clicking "Security Credentials" and then clicking
   172  "Access Credentials". You'll be taken to a table that lists your access keys and
   173  has a "show" link for each access key that will reveal the associated secret
   174  key.
   175  
   176  And that's it, you're ready to go!
   177  
   178  References:
   179  
   180    [1]: http://askubuntu.com/questions/730/how-do-i-set-environment-variables
   181    [2]: https://juju.ubuntu.com/docs/provider-configuration-ec2.html
   182    [3]: http://aws.amazon.com/account
   183  
   184  More information:
   185  
   186    https://juju.ubuntu.com/docs/getting-started.html
   187    https://juju.ubuntu.com/docs/provider-configuration-ec2.html
   188    http://askubuntu.com/questions/225513/how-do-i-configure-juju-to-use-amazon-web-services-aws
   189  `
   190  
   191  const helpHPCloud = `
   192  HP Cloud is an Openstack cloud provider.  To deploy to it, use an openstack
   193  environment type for Juju, which would look something like this:
   194  
   195    sample_hpcloud:
   196      type: openstack
   197      tenant-name: "juju-project1"
   198      auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
   199      auth-mode: userpass
   200      username: "xxxyour-hpcloud-usernamexxx"
   201      password: "xxxpasswordxxx"
   202      region: az-1.region-a.geo-1
   203  
   204  See the online help for more information:
   205  
   206    https://juju.ubuntu.com/docs/config-hpcloud.html
   207  `
   208  
   209  const helpAzureProvider = `
   210  A generic Windows Azure environment looks like this:
   211  
   212    sample_azure:
   213      type: azure
   214  
   215      # Location for instances, e.g. West US, North Europe.
   216      location: West US
   217  
   218      # http://msdn.microsoft.com/en-us/library/windowsazure
   219      # Windows Azure Management info.
   220      management-subscription-id: 886413e1-3b8a-5382-9b90-0c9aee199e5d
   221      management-certificate-path: /home/me/azure.pem
   222  
   223      # Windows Azure Storage info.
   224      storage-account-name: juju0useast0
   225  
   226      # Override OS image selection with a fixed image for all deployments.
   227      # Most useful for developers.
   228      # force-image-name: b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-DEVELOPMENT-20130713-Juju_ALPHA-en-us-30GB
   229  
   230      # Pick a simplestreams stream to select OS images from: daily or released
   231      # images, or any other stream available on simplestreams.  Leave blank for
   232      # released images.
   233      # image-stream: ""
   234  
   235  This is the environments.yaml configuration file needed to run on Windows Azure.
   236  You will need to set the management-subscription-id, management-certificate-
   237  path, and storage-account-name.
   238  
   239  Note: Other than location, the defaults are recommended, but can be updated to
   240  your preference.
   241  
   242  See the online help for more information:
   243  
   244    https://juju.ubuntu.com/docs/config-azure.html
   245  `
   246  
   247  const helpConstraints = `
   248  Constraints constrain the possible instances that may be started by juju
   249  commands. They are usually passed as a flag to commands that provision a new
   250  machine (such as bootstrap, deploy, and add-machine).
   251  
   252  Each constraint defines a minimum acceptable value for a characteristic of a
   253  machine.  Juju will provision the least expensive machine that fulfills all the
   254  constraints specified.  Note that these values are the minimum, and the actual
   255  machine used may exceed these specifications if one that exactly matches does
   256  not exist.
   257  
   258  If a constraint is defined that cannot be fulfilled by any machine in the
   259  environment, no machine will be provisioned, and an error will be printed in the
   260  machine's entry in juju status.
   261  
   262  Constraint defaults can be set on an environment or on specific services by
   263  using the set-constraints command (see juju help set-constraints).  Constraints
   264  set on the environment or on a service can be viewed by using the get-
   265  constraints command.  In addition, you can specify constraints when executing a
   266  command by using the --constraints flag (for commands that support it).
   267  
   268  Constraints specified on the environment and service will be combined to
   269  determine the full list of constraints on the machine(s) to be provisioned by
   270  the command.  Service-specific constraints will override environment-specific
   271  constraints, which override the juju default constraints.
   272  
   273  Constraints are specified as key value pairs separated by an equals sign, with
   274  multiple constraints delimited by a space.
   275  
   276  Constraint Types:
   277  
   278  arch
   279     Arch defines the CPU architecture that the machine must have.  Currently
   280     recognized architectures:
   281        amd64 (default)
   282        i386
   283        arm
   284  
   285  cpu-cores
   286     Cpu-cores is a whole number that defines the number of effective cores the
   287     machine must have available.
   288  
   289  mem
   290     Mem is a float with an optional suffix that defines the minimum amount of RAM
   291     that the machine must have.  The value is rounded up to the next whole
   292     megabyte.  The default units are megabytes, but you can use a size suffix to
   293     use other units:
   294  
   295        M megabytes (default)
   296        G gigabytes (1024 megabytes)
   297        T terabytes (1024 gigabytes)
   298        P petabytes (1024 terabytes)
   299  
   300  root-disk
   301     Root-Disk is a float that defines the amount of space in megabytes that must
   302     be available in the machine's root partition.  For providers that have
   303     configurable root disk sizes (such as EC2) an instance with the specified
   304     amount of disk space in the root partition may be requested.  Root disk size
   305     defaults to megabytes and may be specified in the same manner as the mem
   306     constraint.
   307  
   308  container
   309     Container defines that the machine must be a container of the specified type.
   310     A container of that type may be created by juju to fulfill the request.
   311     Currently supported containers:
   312        none - (default) no container
   313        lxc - an lxc container
   314        kvm - a kvm container
   315  
   316  cpu-power
   317     Cpu-power is a whole number that defines the speed of the machine's CPU,
   318     where 100 CpuPower is considered to be equivalent to 1 Amazon ECU (or,
   319     roughly, a single 2007-era Xeon).  Cpu-power is currently only supported by
   320     the Amazon EC2 environment.
   321  
   322  tags
   323     Tags defines the list of tags that the machine must have applied to it.
   324     Multiple tags must be delimited by a comma. Tags are currently only supported
   325     by the MaaS environment.
   326  
   327  networks
   328     Networks defines the list of networks to ensure are available or not on the
   329     machine. Both positive and negative network constraints can be specified, the
   330     later have a "^" prefix to the name. Multiple networks must be delimited by a
   331     comma. Not supported on all providers. Example: networks=storage,db,^logging
   332     specifies to select machines with "storage" and "db" networks but not "logging"
   333     network. Positive network constraints do not imply the networks will be enabled,
   334     use the --networks argument for that, just that they could be enabled.
   335  
   336  Example:
   337  
   338     juju add-machine --constraints "arch=amd64 mem=8G tags=foo,bar"
   339  
   340  See Also:
   341     juju help set-constraints
   342     juju help get-constraints
   343     juju help deploy
   344     juju help add-unit
   345     juju help add-machine
   346     juju help bootstrap
   347  `
   348  
   349  const helpGlossary = `
   350  Bootstrap
   351    To boostrap an environment means initializing it so that Services may be
   352    deployed on it.
   353  
   354  Charm
   355    A Charm provides the definition of the service, including its metadata,
   356    dependencies to other services, packages necessary, as well as the logic for
   357    management of the application. It is the layer that integrates an external
   358    application component like Postgres or WordPress into Juju. A Juju Service may
   359    generally be seen as the composition of its Juju Charm and the upstream
   360    application (traditionally made available through its package).
   361  
   362  Charm URL
   363    A Charm URL is a resource locator for a charm, with the following format and
   364    restrictions:
   365  
   366      <schema>:[~<user>/]<collection>/<name>[-<revision>]
   367  
   368    schema must be either "cs", for a charm from the Juju charm store, or "local",
   369    for a charm from a local repository.
   370  
   371    user is only valid in charm store URLs, and allows you to source charms from
   372    individual users (rather than from the main charm store); it must be a valid
   373    Launchpad user name.
   374  
   375    collection denotes a charm's purpose and status, and is derived from the
   376    Ubuntu series targeted by its contained charms: examples include "precise",
   377    "quantal", "oneiric-universe".
   378  
   379    name is just the name of the charm; it must start and end with lowercase
   380    (ascii) letters, and can otherwise contain any combination of lowercase
   381    letters, digits, and "-"s.
   382  
   383    revision, if specified, points to a specific revision of the charm pointed to
   384    by the rest of the URL. It must be a non-negative integer.
   385  
   386  Endpoint
   387    The combination of a service name and a relation name.
   388  
   389  Environment
   390    An Environment is a configured location where Services can be deployed onto.
   391    An Environment typically has a name, which can usually be omitted when there's
   392    a single Environment configured, or when a default is explicitly defined.
   393    Depending on the type of Environment, it may have to be bootstrapped before
   394    interactions with it may take place (e.g. EC2). The local environment
   395    configuration is defined in the ~/.juju/environments.yaml file.
   396  
   397  Machine Agent
   398    Software which runs inside each machine that is part of an Environment, and is
   399    able to handle the needs of deploying and managing Service Units in this
   400    machine.
   401  
   402  Provisioning Agent
   403    Software responsible for automatically allocating and terminating machines in
   404    an Environment, as necessary for the requested configuration.
   405  
   406  Relation
   407    Relations are the way in which Juju enables Services to communicate to each
   408    other, and the way in which the topology of Services is assembled. The Charm
   409    defines which Relations a given Service may establish, and what kind of
   410    interface these Relations require.
   411  
   412    In many cases, the establishment of a Relation will result into an actual TCP
   413    connection being created between the Service Units, but that's not necessarily
   414    the case. Relations may also be established to inform Services of
   415    configuration parameters, to request monitoring information, or any other
   416    details which the Charm author has chosen to make available.
   417  
   418  Repository
   419    A location where multiple charms are stored. Repositories may be as simple as
   420    a directory structure on a local disk, or as complex as a rich smart server
   421    supporting remote searching and so on.
   422  
   423  Service
   424    Juju operates in terms of services. A service is any application (or set of
   425    applications) that is integrated into the framework as an individual component
   426    which should generally be joined with other components to perform a more
   427    complex goal.
   428  
   429    As an example, WordPress could be deployed as a service and, to perform its
   430    tasks properly, might communicate with a database service and a load balancer
   431    service.
   432  
   433  Service Configuration
   434    There are many different settings in a Juju deployment, but the term Service
   435    Configuration refers to the settings which a user can define to customize the
   436    behavior of a Service.
   437  
   438    The behavior of a Service when its Service Configuration changes is entirely
   439    defined by its Charm.
   440  
   441  Service Unit
   442    A running instance of a given Juju Service. Simple Services may be deployed
   443    with a single Service Unit, but it is possible for an individual Service to
   444    have multiple Service Units running in independent machines. All Service Units
   445    for a given Service will share the same Charm, the same relations, and the
   446    same user-provided configuration.
   447  
   448    For instance, one may deploy a single MongoDB Service, and specify that it
   449    should run 3 Units, so that the replica set is resilient to failures.
   450    Internally, even though the replica set shares the same user-provided
   451    configuration, each Unit may be performing different roles within the replica
   452    set, as defined by the Charm.
   453  
   454  Service Unit Agent
   455    Software which manages all the lifecycle of a single Service Unit.
   456  
   457  `
   458  
   459  const helpLogging = `
   460  Juju has logging available for both client and server components. Most
   461  users' exposure to the logging mechanism is through either the 'debug-log'
   462  command, or through the log file stored on the bootstrap node at
   463  /var/log/juju/all-machines.log.
   464  
   465  All the agents have their own log files on the individual machines. So
   466  for the bootstrap node, there is the machine agent log file at
   467  /var/log/juju/machine-0.log.  When a unit is deployed on a machine,
   468  a unit agent is started. This agent also logs to /var/log/juju and the
   469  name of the log file is based on the id of the unit, so for wordpress/0
   470  the log file is unit-wordpress-0.log.
   471  
   472  Juju uses rsyslog to forward the content of all the log files on the machine
   473  back to the bootstrap node, and they are accumulated into the all-machines.log
   474  file.  Each line is prefixed with the source agent tag (also the same as
   475  the filename without the extension).
   476  
   477  Juju has a hierarchical logging system internally, and as a user you can
   478  control how much information is logged out.
   479  
   480  Output from the charm hook execution comes under the log name "unit".
   481  By default Juju makes sure that this information is logged out at
   482  the DEBUG level.  If you explicitly specify a value for unit, then
   483  this is used instead.
   484  
   485  Juju internal logging comes under the log name "juju".  Different areas
   486  of the codebase have different anmes. For example:
   487    providers are under juju.provider
   488    workers are under juju.worker
   489    database parts are under juju.state
   490  
   491  All the agents are started with all logging set to DEBUG. Which means you
   492  see all the internal juju logging statements until the logging worker starts
   493  and updates the logging configuration to be what is stored for the environment.
   494  
   495  You can set the logging levels using a number of different mechanisms.
   496  
   497  environments.yaml
   498   - all environments support 'logging-config' as a key
   499   - logging-config: ...
   500  environment variable
   501   - export JUJU_LOGGING_CONFIG='...'
   502  setting the logging-config at bootstrap time
   503   - juju bootstrap --logging-config='...'
   504  juju set-environment logging-config='...'
   505  
   506  Configuration values are separated by semicolons.
   507  
   508  Examples:
   509  
   510    juju set-environment logging-config "juju=WARNING; unit=INFO"
   511  
   512  Developers may well like:
   513  
   514    export JUJU_LOGGING_CONFIG='juju=INFO; juju.current.work.area=TRACE'
   515  
   516  Valid logging levels:
   517    CRITICAL
   518    ERROR
   519    WARNING
   520    INFO
   521    DEBUG
   522    TRACE
   523  `