Open main menu

Changes

10,639 bytes removed ,  03:20, 21 December 2023
remove all the outdated content from 8 or 9 years ago
Juju can deploy to LXC <ref>See also: [[Docker]]</ref> (for local environments), OpenStack (for HP Cloud), Windows Azure, Joyent or Amazon EC2
 
Kapil Thangavelu wrote [https://github.com/kapilt/juju-digitalocean JuDo] - A juju provider for [[Digital Ocean]] using a client side plugin and manual provisioning.
== Links ==
# https://jujucharmsjuju.comis/get-started# https://jujucharms.com/docs/1.20/config-manual# https://jujucharms.com/docs/1.20/config-aws# https://jujucharms.com/docs/1.20/config-digitalocean# https://jujucharms.com/docs/1.20/config-vagrant == TLDR ==<source lang="bash">sudo add-apt-repository ppa:juju/stablesudo apt-get update sudo apt-get install juju-quickstartsudo apt-get install juju-core# to just show existing/default# juju generate-config --showjuju generate-config# edit .juju/environments.yaml to add your AWS KEYSjuju bootstrapjuju status# assuming it shows a single machine numbered '0'juju deploy apache2 --to 0juju deploy mediawiki --to 0# in our test, this deployed cs:trusty/mediawiki-3juju deploy mysql --to 0juju add-relation mediawiki:db mysqljuju expose apache2juju expose mediawikijuju statusjuju ssh 0</source> You'll end up with an address like this <ref>When setting up a service on EC2, make sure to obtain and assign an "elastic IP" so that the instance has a static IP. Otherwise every shutdown will result in a different public IP address being assigned to the instance.</ref>http://52.5.215.128/mediawiki/index.php/Special:Versionwith * Ubuntu 14.04.2 LTS (Trusty Tahr)* Apache 2.4.7 (Ubuntu) (with MaxRequestWorkers at 2048 which would require 32 servers while servers is set at 16 = sloppy)* MediaWiki <code>1.19.14+dfsg-1</code> installed with no extensions, and no git* PHP 5.5.9-1ubuntu4.7 (apache2handler)* MySQL 5.5.41-0ubuntu0.14.04.1-log   You can see what keys were added to the machine<code>juju authorised-keys list</code>and verify the key fingerprint for the key you want to use<code>ssh-keygen -lf /home/user/.ssh/id_rsa</code> but you have to know/guess what user was installed by your charm <code>ssh -i /home/user/.ssh/id_rsa -o IdentitiesOnly=true -vvv ubuntu@ec2-55-5-555-55.compute-1.amazonaws.com</code> The above 'recipe' installs [https://jujucharms.com/mediawiki/trusty/3 this MediaWiki charm] which has been deployed 813 times as of this writing. BFD. It didn't work for me (I had to add [https://jujucharms.com/apache2/trusty/13/ Apache]). Although this charm invokes a2enconf, I don't see any code which installs or verifies Apache2 as a dependency in the [http://bazaar.launchpad.net/~charmers/charms/trusty/mediawiki/trunk/view/head:/hooks/install install hook]. So, yeah, garbage. They should read the docs about [https://jujucharms.com/docs/1.20/authors-charm-writing how to write a charm]. The example explicitly installs, configures and starts Apache as part of a simple web service. But the documentation is very sparse. The only "interface" (a primary element of orchestration) that is documented is 'mysql' and even that is barely covered.  [https://jujucharms.com/wordpress/trusty/2 The Wordpress charm] is [http://bazaar.launchpad.net/~charmers/charms/trusty/wordpress/trunk/files written better] because it works, and actually offers a simple switch between nginx and Apache. Although it's a bit more 'polished' the WordPress Charm is still [http://bazaar.launchpad.net/~charmers/charms/trusty/wordpress/trunk/view/head:/inc/common a bunch of bash scripts] that end up installing things all over the place (standard locations?). It installs [http://php-fpm.org/ php-fpm] (FastCGI Process Manager, which is an alternative PHP FastCGI implementation) It does use git, but is it configurable as to who/what/where you can pull from? I figured out that for the Wordpress charm, you can see the 'components' in the [http://bazaar.launchpad.net/~charmers/charms/trusty/wordpress/trunk/files/head:/files/charm/ 'charm' directory]. In general, I'm '''very''' unimpressed with the implementation of the Charm Store. The underlying technology doesn't seem fully baked either, but I profess that I didn't look into it much.  == Help ==<source lang="bash">juju help</source><pre> Juju -- devops distilledtutorial# https://juju.ubuntucharmhub.comioJuju provides easy, intelligent service orchestration on top of environmentssuch as Amazon EC2, HP Cloud, OpenStack, MaaS, or your own local machine. Basic commands: juju init generate boilerplate configuration for juju environments juju bootstrap start up an environment from scratch  juju deploy deploy a new service juju add-relation add a relation between two services juju expose expose a service  juju help bootstrap more help on e.g. bootstrap command juju help commands list all commands juju help glossary glossary of terms juju help topics list all help topics Provider information: juju help azure-provider use on Windows Azure juju help ec2-provider use on Amazon EC2 juju help hpcloud-provider use on HP Cloud juju help local-provider use on this computer juju help openstack-provider use on OpenStack</pre> === Commands ===<source lang="bash">juju help commands</source><pre>add-machine alias for 'machine add'add-relation add a relation between two servicesadd-unit add one or more units of an already-deployed serviceapi-endpoints print the API server address(es)api-info print the field values used to connect to the environment's API serversauthorised-keys alias for 'authorized-keys'authorized-keys manage authorized ssh keysbackups create, manage, and restore backups of juju's stateblock block an operation that would alter a running environmentbootstrap start up an environment from scratchcached-images manage cached os imagesdebug-hooks launch a tmux session to debug a hookdebug-log display the consolidated log filedeploy deploy a new servicedestroy-environment terminate all machines and other associated resources for an environmentdestroy-machine alias for 'machine remove'destroy-relation alias for 'remove-relation'destroy-service alias for 'remove-service'destroy-unit alias for 'remove-unit'ensure-availability ensure the availability of Juju state serversenv alias for 'switch'environment manage environmentsexpose expose a servicegenerate-config alias for 'init'get get service configuration optionsget-constraints view constraints on the environment or a serviceget-env alias for 'environment get'get-environment alias for 'environment get'help show help on a command or other topichelp-tool show help on a juju charm toolinit generate boilerplate configuration for juju environmentsmachine manage machinespublish publish charm to the storeremove-machine alias for 'machine remove'remove-relation remove a relation between two servicesremove-service remove a service from the environmentremove-unit remove service units from the environmentresolved marks unit errors resolvedretry-provisioning retries provisioning for failed machinesrun run the commands on the remote targets specifiedscp launch a scp command to copy files to/from remote machine(s)set set service config optionsset-constraints set constraints on the environment or a serviceset-env alias for 'environment set'set-environment alias for 'environment set'ssh launch an ssh shell on a given unit or machinestat alias for 'status'status output status information about an environmentswitch show or change the default juju environment namesync-tools copy tools from the official tool store into a local environmentterminate-machine alias for 'machine remove'unblock unblock an operation that would alter a running environmentunexpose unexpose a serviceunset set service config options back to their defaultunset-env alias for 'environment unset'unset-environment alias for 'environment unset'upgrade-charm upgrade a service's charmupgrade-juju upgrade the tools in a juju environmentuser manage user accounts and access controlversion print the current version</pre>  Setting up a MediaWiki instance with Juju, using the https://jujucharms.com/mediawiki/trusty/3 charm was completely unacceptable. The charm doesn't even setup a web server environment at all so it doesn't work "out of the box". When I specified an Apache2 charm https://jujucharms.com/apache2/trusty/13/ the configuration has a miscompiled PHP and also conflicting configurations (ServerLimit, MaxRequestWorkers) that causes errors in the log.
<pre>
root@ip-172-31-57-182:~# /usr/sbin/apache2 -S
[Thu Apr 09 13:42:06.748287 2015] [core:warn] [pid 2247] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Thu Apr 09 13:42:06.748800 2015] [core:warn] [pid 2247] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Thu Apr 09 13:42:06.749138 2015] [core:warn] [pid 2247] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Thu Apr 09 13:42:06.749457 2015] [core:warn] [pid 2247] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Thu Apr 09 13:42:06.749808 2015] [core:warn] [pid 2247] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu Apr 09 13:42:06.786167 2015] [:crit] [pid 2247:tid 139742374446976] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
AH00013: Pre-configuration failed
root@ip-172-31-57-182:~# /usr/sbin/apache2 -M
[Thu Apr 09 13:42:19.687521 2015] [core:warn] [pid 2248] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Thu Apr 09 13:42:19.688010 2015] [core:warn] [pid 2248] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Thu Apr 09 13:42:19.688345 2015] [core:warn] [pid 2248] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Thu Apr 09 13:42:19.688604 2015] [core:warn] [pid 2248] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Thu Apr 09 13:42:19.688886 2015] [core:warn] [pid 2248] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu Apr 09 13:42:19.700934 2015] [:crit] [pid 2248:tid 140047498663808] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
AH00013: Pre-configuration failed
</pre>
{{References}}