Archive for the ‘Ubuntu Tips & Tricks’ Category

Shang Wu

Juju Commands in detail (was ensemble)

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:

juju bootstrap

2. To deploy a service (wordpress, in this example):

juju deploy –repository=. wordpress

2a.
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

2b.
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:

ensemble: formula
name: wordpress
revision: 30
summary: “WordPress is a full featured web blogging tool”
description: |
WordPress is a full featured web blogging tool:
- Instant publishing (no rebuilding)
- Comment pingback support with spam protection
- Non-crufty URLs
- Themable
- Plugin support
requires:
db:
interface: mysql
provides:
website:
interface: http

And the mysql metadata.yaml looks like:

ensemble: formula
name: mysql
revision: 98
summary: MySQL is a fast, stable and true multi-user, multi-threaded SQL database
description: |
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.
provides:
db:
interface: mysql
db-admin:
interface: mysql
shared-db:
interface: mysql-shared
master:
interface: mysql-oneway-replication
munin:
interface: munin-node
requires:
slave:
interface: mysql-oneway-replication

Enjoy!

Shang Wu

Ubuntu Cloud Days just finished!

Many interesting topic were discussed at the Ubuntu Cloud Days. If you miss it, here are the logs for you to catch up!


Getting started with Ensemble — kim0
Introduction to Cloudinit — koolhead17
Orchestra and Ensemble (part1) — smoser
Orchestra and Ensemble (part2) — RoakSoax
Eucalyptus 3: cloud HA and ID management — nurmi


Getting started with OpenStack Compute — soren
UEC on Ubuntu 10.04 LTS — TeTeT
Node.js/Mongo with Ensemble — m_3
OpenStack: An open cloud infrastructure project — ttx

Shang Wu

Setting up Apt-Cacher-NG

In order to save some bandwidth for the servers that I have setup, I decided to install the apt-cacher-ng on my natty server box.

To start, using the command:

sudo apt-get install apt-cacher-ng

on the server that you would like to cache all the packages.

Then, configure the server itself to cache all the packages you will need to change the sources.list file from /etc/apt directory using the command below:

sudo sed -i ‘s/http:\/\//http:\/\/localhost:3142\//’ /etc/apt/sources.list

Now, start the update/upgrade/install packages on the machine. All the packages should be cached on the local and ready to be use.

From client side, where you want to take the advantage of the cached packages, run the same command except you will need to change the localhost to the first server ip address (10.10.10.10 in my case):

sudo sed -i ‘s/http:\/\//http:\/\/10.10.10.10:3142\//’ /etc/apt/sources.list

Once, that is done, you can start update/upgrade/install packages onto the system. All the packages have been cached previously will be picked up by the system.

Also, you can be able to see the statistic report from your browser (10.10.10.10 in my case):

http://10.10.10.10:3142/acng-report.html

Shang Wu

[How-To] Changing your default language in Ubuntu.

Today, I got asked by someone how to change the default language in Ubuntu. So, I took some time to do a screenshot and wrote a simple instruction, hope this will be useful.

Step 0: Make sure you are connected to the Internet

Step 1: Select Language Support from System > Administration

Step 2: Ignore or Install the first dialog

Step 3: Click on Install / Remove Languages

Step 4: Find your preferred language and click the check box, then Apply Changes

Step 5. Log out the current session and go back to the login page

Step 6. Click on your user name entry and type in your password

Step 7: Before you click on the login button, select your preferred language at the bottom

Step 8: Click Login now to Enter the system with your new language environment.

Shang Wu

[How-To] Upgrade Kernel 3.0 on your Ubuntu Natty system

Update on July 27, 2011: The official 3.0 kernel can be found at:

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-oneiric/

After upgrade to Natty, my Toshiba Satellite U300 had problem suspend/hibernate. As soon as I close my lid of my laptop, the system will go into suspend, and the system is freezed after that. A bug report was filed, if anyone is having similar problem, feel free to take a look at my bug report #788436. Unfortunately, other than filed the bug report, I have not spend enough time to investigate the issue.

Yesterday, I saw Andy’s post about the new kernel 3.0. I thought this might be the cure for the issue. Today I took some time to give that a try, and it WORKED!!

Here is what you need to do, if you want to update your system to kernel 3.0 as well:

1. Download the dependency(module-init-tools) for the kernel 3.0
i386 from the following URL:

https://launchpad.net/ubuntu/oneiric/i386/module-init-tools/3.13-1ubuntu1

amd64:

https://launchpad.net/ubuntu/oneiric/amd64/module-init-tools/3.13-1ubuntu1

2. Install the module-init-tools on your computer by double click on the packages!

3.Select the proper architecture for your system, and download the kernel 3.0 package (linux-image and linux-header) onto your computer from below
i386:

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-headers-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_i386.deb

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-image-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_i386.deb

amd64:

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-image-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_amd64.deb

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0-rc4-oneiric/linux-headers-3.0.0-0300rc4-generic_3.0.0-0300rc4.201106210911_amd64.deb

4. Double click on the two packages that you download and install them via the software center.

5. When finish, reboot your system! You should be on the kernel 3.0 from now on! Enjoy~

(Optional)
6. In case you want to verify if the installation is successful or not, you can open a terminal and run the following command:

uname -r

If you see the output like:

3.0.0-0300rc4-generic

Then you are on the kernel 3.0!!

Shang Wu

Quick Tips on UbuntuOne

Yesterday, I was having some issue syncing the file to UbuntuOne. It turns out to be a disk space issue in the end, but during the process I learned couple tricks that is quite useful for troubleshooting UbuntuOne. So, I thought someone else might be interested in this as well:

UbuntuOne lesson 101:

To enable debug logging you need to:

1) Quit syncdaemon

killall ubuntuone-syncdaemon

2) Append the following lines in the ~/.config/ubuntuone/syncdaemon.conf

[__main__]

level = DEBUG

3) Then, the logging can be found in ~/.cache/ubuntuone/log/syncdaemon.log

UbuntuOne lesson 102:

Using the following command to see the current file transfering status:

u1sdtool –current-transfers

UbuntuOne lesson 103:

To request a “rescan” on a specific folder

u1sdtool –refresh /full/path/to/folder

Shang Wu

I’m new!

Hi All,

I have been with Canonical for almost 3 years now. Just started this blog and intend to talk about mainly the Ubuntu related issues, solutions, tips and tricks that I pick up here and there. Hope that will be helpful for somebody.

Since I just got my new toy HTC Hero last December, perhaps you will see some of that here too!

Cheers,



Create a new blog