Tutorial

1.) Review the help file

Get into the oscg base directory at the command line.

Now run the help command to see that things are as expected


   $ ./io help

      Usage: io command [component1 component2 ...]

      Available commands:
        help       - Show this help file
        info       - Display OS or component information
        list       - Display installed & available components 
        status     - Display status of installed server components 
        start      - Start server components
        stop       - Stop server components
        enable     - Enable a server component
        disable    - Disable a server component from starting automatically
        update     - Retrieve new list of available components
        upgrade    - Upgrade installed components to newer (compatible) versions
        install    - Install a component  


2.) Demonstrate the io command line environment.

The info command lists information about the OS or a component
   $ ./io info

      User & Host: denisl  localhost  127.0.0.1
               Os: Mac OS X 12.4 x64
         Hardware: 16 GB, 8 x Intel Core i7-2820QM @ 2.30GHz


   $ ./io info pg14

        Project: pg (http://postgresql.org)
      Component: pg14  14.3 (linux64, osx64, win64)
            Doc: http://www.postgresql.org/docs/14/

The list command displays installed and available components. It confirms that only the core
Postgres server component, in this case pg14, is installed and enabled by default.

   $ ./io list

        Component     Version       Port    Status      
        ------------  ------------  ------  ------------
        pg11          11.16                 Not Installed   
        pg12          12.11                 Not Installed   
        pg13          13.7                  Not Installed   
        pg14          14.3          5432    Installed   

The status command confirms whether server components are listening on their assigned ports.
     
   $ ./io status

       pg14    stopped on port 5432

The start command will start up whatever servers are installed (in this case pg14)
     
   $ ./io start

       pg14 starting...

Running the status command displays information about installed server components.
     
   $ ./io status

       pg14 running on port 5432
Now lets use the stop command to shutdown postgres.
     
   $ ./io stop

       pg14 stopping...

3.) Install additional components

Use the install command to provision additional components such as pg12. Using the "--start" option will install and then start PG with the default passwd = 'password'. Because port 5432 was in use, we automagically start on port 5433.
   $ ./io install pg12 --start

        Get:2 pg12-12.11-amd
          Unpacking pg12-12.11-amd.tar.bz2
          pg12 Installed & Started


   $ ./io list

        Component     Version    Port    Status      
        ------------  --------  ------  ------------
        pg11          11.16              Not Installed                       
        pg12          12.11      5433    Installed   
        pg13          13.7               Not Installed
        pg14          14.3       5432    Installed   

We now run the status command to confirm that both the PG servers are installed.
   $ ./io status

        pg12 (Started on port 5433)
        pg14 (Stopped on port 5432)

The start command is used to start back up PostgreSQL 14
   $ ./io start pg14

       pg14 starting...

Running the status command displays information about installed server components.
     
   $ ./io status

       pg12  (Running on port 5433)
       pg14  (Running on port 5432)
 
© 2022 OSCG Partners.  All rights reserved. luss@oscg.io