Link to home
Start Free TrialLog in
Avatar of chalie001
chalie001

asked on

lxc/lxd container

hi how can i install oracle datbase in lxd container i did this

lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]: storage
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]:
Port to bind LXD to [default=8443]:
Trust password for new clients:
Again:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
docker@docker-VirtualBox:~$ ps -ef | grep lxd
root        5691       1  0 04:53 ?        00:00:00 /bin/sh /snap/lxd/21835/commands/daemon.start
root        5843       1  0 04:53 ?        00:00:00 lxcfs /var/snap/lxd/common/var/lib/lxcfs -p /var/snap/lxd/common/lxcfs.pid
root        5854    5691  0 04:53 ?        00:00:01 lxd --logfile /var/snap/lxd/common/lxd/logs/lxd.log --group lxd
lxd         7567    5854  0 05:09 ?        00:00:00 dnsmasq --keep-in-foreground --strict-order --bind-interfaces --except-interface=lo --pid-file= --no-ping --interface=lxdbr0 --dhcp-rapid-commit --quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address=10.209.245.1 --dhcp-no-override --dhcp-authoritative --dhcp-leasefile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases --dhcp-hostsfile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.hosts --dhcp-range 10.209.245.2,10.209.245.254,1h -s lxd --interface-name _gateway.lxd,lxdbr0 -S /lxd/ --conf-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.raw -u lxd -g lxd
docker      7673    3582  0 05:10 pts/0    00:00:00 grep --color=auto lxd


Avatar of David Favor
David Favor
Flag of United States of America image

I suggest you destroy your entire LXD installation + start again.

Here's how I do this... because every new machine requires a 100% common setup with me...

lxd init --auto --storage-backend=dir
lxc network attach-profile lxdbr0 default $base-interface

Open in new window


In other words, skip all other init options, as they can cause near impossible to debug problems.

If all's well, you should be able to run this command, where command runs showing no containers running...

lxc list

Open in new window


Then to install Oracle...

lxc launch ubuntu:focal c1
lxc exec c1 bash

# Now setup your container IP - /etc/netplan/60-public-init.yaml - or some file to run after 10-lxc.yaml, so any higher number will work.
# cat /etc/netplan/60-public-init.yaml 
network:
    version: 2
    ethernets:
        eth0:
          addresses:
          - 51.79.59.83/32

# Then install Oracle, as same as you'd install Oracle on any machine.

# Then restart your container, to bring up your IP + ensure Oracle restarts correctly.

Open in new window


At this point only item remaining is to make sure you're running a route command periodically to regenerate all your routes, as every SNAP update (can be many a day sometimes), will lose all routes.

Open a new question about Route Revivification, if you haven't worked out this detail yet.
Avatar of chalie001
chalie001

ASKER

why should i install oracle in ubuntu i what to use oracle linux
lxc list
+------+---------+-----------------------+------+-----------+-----------+
| NAME |  STATE  |         IPV4          | IPV6 |   TYPE    | SNAPSHOTS |
+------+---------+-----------------------+------+-----------+-----------+
| acor | RUNNING | 10.209.245.221 (eth0) |      | CONTAINER | 0         |
+------+---------+-----------------------+------+-----------+-----------+


1) Excellent!

Looks like you have a container running now!

2) You asked, "why should i install oracle in ubuntu i what to use oracle linux".

Only you can answer this, as you'll chose to create an Ubuntu container or Oracle Linux container.

My personally, I always use Ubuntu as Ubuntu is the development reference Distro for LXD, so Ubuntu always has most testing + most correct problem solutions in forums.

3) If I had to run Oracle, I'd create an Ubuntu container + install Oracle... which looks like... installing one of the linux-oracle packages.
lxc network attach-profile lxdbr0 default $base-interface
Error: unknown shorthand flag: 'i' in -interface
react@react-VirtualBox:~/Documents/images$


s$ sudo snap install certbot --classic
certbot 1.22.0 from Certbot Project (certbot-eff✓) installed
react@react-VirtualBox:~/Documents/images$ sudo snap install nmap
nmap 7.92 from Maximiliano Bertacchini (maxiberta) installed
react@react-VirtualBox:~/Documents/images$ sudo snap connect nmap:network-control
react@react-VirtualBox:~/Documents/images$
react@react-VirtualBox:~/Documents/images$ lxd init --auto --storage-backend=dir
react@react-VirtualBox:~/Documents/images$ lxc network attach-profile lxdbr0 default $base-interface
Error: unknown shorthand flag: 'i' in -interface
react@react-VirtualBox:~/Documents/images$ lxc list
To start your first container, try: lxc launch ubuntu:20.04
Or for a virtual machine: lxc launch ubuntu:20.04 --vm

+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+


You must replace "$base-interface" with your actual interface, which only you know.

Might be eth0 or en0 or any number of interface names, which are all dependent on your specific hosting company.
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial