root@lw:~# snap install --channel=latest/edge maas
snap "maas" is already installed, see 'snap help refresh'
root@lw:~# maas status
MAAS is not configured
root@lw:~# maas init
usage: maas init [-h] {region+rack,region,rack} ...
Initialise MAAS in the specified run mode.
options:
-h, --help show this help message and exit
run modes:
{region+rack,region,rack}
region+rack Both region and rack controllers
region Region controller only
rack Rack controller only
When installing region or rack+region modes, MAAS needs a
PostgreSQL database to connect to.
If you want to set up PostgreSQL for a non-production deployment on
this machine, and configure it for use with MAAS, you can install
the maas-test-db snap before running 'maas init':
sudo snap install maas-test-db
sudo maas init region+rack --database-uri maas-test-db:///
the following arguments are required: run_mode
root@lw:~# maas init region+rack
Controller has already been initialized.
Are you sure you want to initialize again (yes/no) [default=no]?
root@lw:~#
root@lw:~# maas init region+rack
Controller has already been initialized.
Are you sure you want to initialize again (yes/no) [default=no]? yes
Database URI:
File "/snap/maas/30029/usr/lib/python3/dist-packages/django/utils/asyncio.py", line 33, in inner
return func(*args, **kwargs)
File “/snap/maas/30029/usr/lib/python3/dist-packages/django/db/backends/postgresql/base.py”, line 187, in get_new_connection
connection = Database.connect(**conn_params)
File “/snap/maas/30029/usr/lib/python3/dist-packages/psycopg2/init.py”, line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: connection to server on socket “/var/snap/maas/common/test-db-socket/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?
No worries!
Thats also a sign for us that we need to improve our documentation for a Quickstart.
So maas-test-db is a snap that will setup test PostgreSQL instance that can be used for dev/testing and not recommended for production setup.
There is a thing in snap that is called Interface and to make things working for you, you need to follow a certain order, so one snap can discover another and connect to proper interfaces.
# just to ensure we start with in a clean state
sudo snap remove maas
# install maas-test-db
sudo snap install maas-test-db
# install maas
sudo snap install maas
# init maas, you can just follow interactive installed
# it will auto-discover and suggest maas-test-db
# then simply setup admin login, password and email
sudo maas init region+rack
When I select 3.2 snap, I can see following section " How to initialise MAAS for production" where I can see steps to setup postgresql. But for 3.4 snap I dont see the same (I am using latest firefox).
It is indeed seems to be missing and that might be because 3.4 is not officially released yet.
For production setup I’d recommend using MAAS versions that do stable channel.
Current latest stable version is 3.3 that can be installed with: sudo snap install maas --channel=3.3/stable