After reading the previous post, you should have a basic idea how to deploy services using ensemble.
So I will skip how it works here, but try to explain to you the command that we use before are doing what:
1. The NUMBER ONE Command that you will need to start using ensemble:
2. To deploy a service (wordpress, in this example):
juju deploy –repository=. wordpress
So this command will use the wordpress formula and deploy the services. But what is the –repository=. doing here?
Well, actually, the –repository specify where the formula is. If you are not in the correct directory, you will be getting an error saying:
2011-07-28 15:55:10,596 ERROR Formula ‘wordpress’ not found in repository /usr/share/principia-tools
That is why we need to make sure that you have all the formulas in the current directory. Or you can specify the absolute path and tell ensemble where to look for the formula:
juju deploy –repository=/usr/share/principia-tools/formulas wordpress
Sometimes, after the service name, you will see another parameter. What does that mean? It is just an a name that we give to identify the services, myblog in this case:
juju deploy –repository=. wordpress myblog
Same thing goes to the mysql services:
juju deploy –repository=. mysql mydb
3. To bind all the services together, we use the add-relation command:
juju add-relation mydb:db myblog
If you named your database service as mydb, that is what you need to use here and same thing goes to mywebsite. However, I always wondering what the :db means there.
The :db here defines that the mysql providing the db resource which is required by the wordpress service. If you are interested, you can actually look into the metadata.yaml
file under both /usr/share/principia-tools/formulas/wordpress and /usr/share/principia-tools/formulas/mysql directory. In there, it defines what is required and what kind of relation can be provided.
For example, my wordpress metadata.yaml looks like:
summary: “WordPress is a full featured web blogging tool”
WordPress is a full featured web blogging tool:
- Instant publishing (no rebuilding)
- Comment pingback support with spam protection
- Non-crufty URLs
- Plugin support
And the mysql metadata.yaml looks like:
summary: MySQL is a fast, stable and true multi-user, multi-threaded SQL database
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.