github.com/mwhudson/juju@v0.0.0-20160512215208-90ff01f3497f/scripts/win-installer/README.txt (about)

     1  Introduction to Juju
     2  
     3  This tutorial will show you how to get started with Juju, including installing, configuring and bootstrapping a new Juju model. Before you start you will need:
     4  
     5  * An Ubuntu, Windows or OSX machine to install the client on.
     6  
     7  * A model which can provide a new server with an Ubuntu cloud operating system image on-demand. This includes services such as Microsoft Azure, Amazon EC2, HP Cloud, or an OpenStack installation.
     8  
     9  * An SSH key-pair. Juju expects to find ssh keys called id_rsa and id_rsa.pub in a .ssh folder in your home directory.
    10  
    11  Configuring
    12  
    13  Now the Juju software is installed, it needs to be configured to use your particular cloud provider. This is done by generating and editing a file, "environments.yaml", which will live in your %LOCALAPPDATA%\Juju directory. You can generate the models file manually, but Juju also includes a boilerplate configuration option that will flesh out most of the file for you and minimise the amount of work (and potential errors).
    14  
    15  To generate an initial config file, you simply need to run:
    16  
    17  > juju generate-config
    18  
    19  This causes the file to be written to your %LOCALAPPDATA%\Juju directory if an environments.yaml file does not already exist. It will also create the %LOCALAPPDATA%\Juju directory if that does not exist.
    20  
    21  This file will contain sample profiles for different types of cloud services, but you will need to edit the files to provide specific information for your cloud provider. Sections are created for Amazon (AWS) services, HPCloud and a generic OpenStack instance. For more specifics on what needs to be changed, see https://juju.ubuntu.com/docs/getting-started.html
    22  
    23  Testing your setup
    24  
    25  Once you have installed and configured Juju, it is probably a good idea to take it for a bit of a test drive and check that everything is working as expected. Because Juju makes it really easy to deploy services, this is actually quick and straightforward.
    26  
    27  
    28  The first thing to do is set up a bootstrap model. This is an instance in the cloud that Juju will use to deploy and control other services with. It will be created according to the configuration you have provided, and your SSH key will automatically be uploaded so that Juju can communicate securely with the bootstrap instance.
    29  
    30  > juju bootstrap
    31  
    32  Note: If you have multiple models configured, you can choose which one to address with a particular command by adding the -e switch followed by the model name, E.g. "-e hpcloud".
    33  
    34  You may have to wait a few moments for this command to return, as it needs to perform various tasks and contact your cloud provider.
    35  
    36  Assuming it returns successfully (otherwise see common error messages and what to do about them - https://juju.ubuntu.com/docs/getting-started.html#errors), we can now deploy some services and explore the basic operations of Juju.
    37  
    38  To start with, we will deploy Wordpress, by running this command:
    39  
    40  > juju deploy wordpress
    41  
    42  Now juju will fetch the Wordpress charm and use it, through the bootstrap instance to request and deploy whatever resources it needs to set up this service.
    43  
    44  Wordpress needs a database though, so we will also deploy one of those:
    45  
    46  > juju deploy mysql
    47  
    48  Once again, juju will do whatever is necessary to deploy this service for you, and it may take some time for the command to return.
    49  
    50  Note: If you want to get more information on what is actually happening, or to help resolve problems, you can add the -v switch to the juju command to get verbose output.
    51  
    52  Although we have deployed Wordpress and a MySQL database, they are not linked together in any way yet. To do this we should run:
    53  
    54  > juju add-relation wordpress mysql
    55  
    56  This command uses information provided by the relevant charms to associate these services with each other in whatever way makes sense. There is much more to be said about linking services together which is covered in the juju command documentation, but for the moment, we just need to know that it will link these services together.  Juju command documentation: https://juju.ubuntu.com/docs/getting-started.html#add-relation
    57  
    58  In order to make our Wordpress public, we now need to expose this service:
    59  
    60  > juju expose wordpress
    61  
    62  This service will now be configured to respond to web requests, so visitors can see it. But where exactly is it? If we run the juju status command, we will be able to see what services are running, and where they are located.
    63  
    64  > juju status
    65  
    66  The output from this command should look something like this:
    67  
    68  > juju status 
    69  machines:   
    70  	"0":     
    71  		agent-state: started     
    72  		agent-version: 1.10.0     
    73  		dns-name: ec2-50-16-167-135.compute-1.amazonaws.com     
    74  		instance-id: i-781bf614     
    75  		series: precise   
    76  	"1":     
    77  		agent-state: started     
    78  		agent-version: 1.10.0     
    79  		dns-name: ec2-23-22-225-54.compute-1.amazonaws.com     
    80  		instance-id: i-9e8927f6     
    81  		series: precise   
    82  	"2":     
    83  		agent-state: started     
    84  		agent-version: 1.10.0     
    85  		dns-name: ec2-54-224-220-210.compute-1.amazonaws.com     
    86  		instance-id: i-5c440436     
    87  		series: precise 
    88  services:   
    89  	mysql:     
    90  		charm: cs:precise/mysql-18     
    91  		exposed: false     
    92  		relations:       
    93  			db:       
    94  			- wordpress     
    95  		units:       
    96  			mysql/0:         
    97  				agent-state: started         
    98  				agent-version: 1.10.0         
    99  				machine: "1"         
   100  				public-address: ec2-23-22-225-54.compute-1.amazonaws.com   
   101  	wordpress:     
   102  		charm: cs:precise/wordpress-12     
   103  		exposed: true     
   104  		relations:       
   105  			db:       
   106  			- mysql       
   107  			loadbalancer:       
   108  			- wordpress     
   109  		units:       
   110  			wordpress/0:         
   111  				agent-state: started         
   112  				agent-version: 1.10.0         
   113  				machine: "2"         
   114  				public-address: ec2-54-224-220-210.compute-1.amazonaws.com 
   115  
   116  
   117  There is quite a lot of information here. the first section, titled machines:, details all the instances which are currently running. For each you will see the version of Juju they are running, their hostname, instance id and the series or version of Ubuntu they are running.
   118  
   119  After that, the sections list the services which are currently deployed. The information here differs slightly according to the service and how it is configured. It will however, always list the charm that was used to deploy the service, whether it is exposed or not, its address and whatever relationships exist.
   120  
   121  From this status readout, we can see that wordpress is exposed and ready. If we simply copy the address into a web browser, we should be able to see it running.
   122  
   123  Congratulations, you have just deployed a service with Juju!
   124  
   125  Now you are ready to deploy whatever service you really want from the 100s available at the Juju Charm Store: http://jujucharms.com/
   126  
   127  To remove all current deployments and clear up everything in your cloud, you can run the command:
   128  
   129  > juju destroy-model
   130  
   131  This will remove everything, including the bootstrap node.
   132  
   133  To learn more about charms, including configuring options and managing running systems, you should continue to read the charm documentation here: https://juju.ubuntu.com/docs/charms.html