Difference between revisions of "LXD/LXC Containers"
Tag: visualeditor-switched |
Tag: visualeditor-switched |
||
| Line 57: | Line 57: | ||
Set the other properties similarly. This how my bridge network has been set up | Set the other properties similarly. This how my bridge network has been set up | ||
[[File:Lxd network.png|thumb|left]] | [[File:Lxd network.png|thumb|left]] | ||
| + | |||
| + | |||
| + | |||
| + | |||
Revision as of 13:43, 27 July 2021
- Creator/Maintainter: Yogan Naidoo (talk) - nTier Software Services
- Current Version: 1.0.0
- License: GPLv2
Credits
- Canonical Ltd
Background
I have just started dabbling with LXC containers and I am excited with my experience thus far. I find them easy to use with command line instructions. I like how lightweight these containers are and that one can use various Linux distros as the os of the container. So stopping, starting, creating, moving, copying and deleting are all easily achievable and happens quickly. I will document my use case below. My intention, however, is to introduce this technology to others so that more people can experiment with these containers. Ultimately more innovative use cases may be shared thus raising the productivity of our iDempiere community.
Resources
The following were helpful to me:
- Getting started with LXC containers - https://www.youtube.com/watch?v=CWmkSj_B-wo&list=PL34sAs7_26wPfLNZ5NKoH0RKbTAWMlh2I&index=2
- Beginners guide on using LXC profiles - Linux Containers - https://www.youtube.com/watch?v=ZEL1BSoUhSI&list=PL34sAs7_26wPfLNZ5NKoH0RKbTAWMlh2I&index=3
- LXD Containers backup, import, export, migrate between lxd instances - https://www.youtube.com/watch?v=RebZppmY8nw&list=PL34sAs7_26wPfLNZ5NKoH0RKbTAWMlh2I&index=4
- https://blog.simos.info/tag/lxd/
- LXD 4.0 quick recipe: LXC and KVM coexisting - https://discourse.ubuntu.com/t/lxd-4-0-quick-recipe-lxc-and-kvm-coexisting/15222
...used a major portion of this article's profile as my own
- https://linuxcontainers.org/lxd/advanced-guide/
- cloud-init Documentation - https://cloudinit.readthedocs.io/en/latest/
Aliases
I use the following aliases:
- lxc alias add login 'exec @ARGS@ --mode interactive -- /bin/sh -xac $@yogan - exec /bin/login -p -f '
...This allows me to log into a container with user name 'yogan' like: lxc login <container>
- lxc alias add delete 'delete -f'
- lxc alias add shell 'exec @ARGS@ -- bash
...This allows me to log into a container with 'root' like: lxc shell <container>
My Use Case
My personal laptop is the host. The os is Ubuntu 20.04.2 LTS. The MEGA/sources is where the various customer/idempiere repositories are. I share this with all new containers that are created.
I created a container called ID82z using os image: Ubuntu 20.04.2 LTS. I downloaded Eclipse, OpenJDK 11, maven, etc in here. Used the source from the shared directory.
I created another container called database using os image: Ubuntu 20.04.2 LTS. I downloaded PostgreSql 13 here. Changed the access port from 5432 and ensured that the db is available from outside.
So my lxc list looks like:
The Steps
- Install Lxd: snap install lxd
- LXD initial configuration: sudo /snap/bin/lxd init
...I chose the defaults and set the storage to 'dir'
- sudo usermod -a -G lxd <user>
...register your user into the lxd group and not to use sudo the entire time
- I set the Lxd network as follows: lxc network set lxdbr0 ipv4.address 172.16.0.1/24
Set the other properties similarly. This how my bridge network has been set up
- lxc launch images:ubuntu/focal/cloud
...I chose the image that has cloud-init support. This is important if you want cloud-init to automate some of your profile tasks
iDempiere Changes
- Pack in the WooCommerce Defaults window and WooCommerce process from 'WooCommerce packin.zip' This file is located in root of the plugin source
- The plugin jar:'za.co.ntier.woocommerce...jar' is located in root of the plugin source
- Create tax rates to match the rates on WooCommerce
- Create an inclusive sales price list
- Create pos tender types exactly as follows:
Search Key|1000000, Name|Credit Card, Tender type|Credit Card Search Key|1000001, Name|Cash, Tender type|Cash Search Key|1000002, Name|EFT, Tender type|Direct Deposit Search Key|1000003, Name|OnCredit, Tender type|Account
- In the System Configurator, set:
PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CREDIT_CARD to 'N' CLIENT_ACCOUNTING to M
- Populate the WooCommerce Defaults window. Ensure the 'organisation' is set correctly
For example:
Run WooCommerce process from iDempiere
- Click on the menu item 'WooCommerce'
- Inspect your sales orders on iDempiere to see if your 'Completed' WooCommerce orders reflect
- The sales orders must be successfully completed on iDempiere
If you want to provide additional comments, please use the iDempiere forum post: iDempiere forum post
