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
               Os: Linux EL8 x64
         Hardware: 16 GB, 8 x Intel Core i7-2820QM @ 2.30GHz

   $ ./io info pg15

        Project: pg (http://postgresql.org)
      Component: pg15  15.1 (Linux amd64 & arm64, OSX)
            Doc: http://www.postgresql.org/docs/15/

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

   $ ./io list

        Component     Version       Port    Status      
        ------------  ------------  ------  ------------
        pg14          14.6                  Not Installed   
        pg15          15.1            5432  Installed   

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

       pg15    stopped on port 5432

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

       pg15 starting...

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

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

       pg15 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 pg14 --start

        Get:2 pg14-14.6-amd
          Unpacking pg14-14.6-amd.tar.bz2
          pg14 Installed & Started

   $ ./io list

        Component     Version    Port    Status      
        ------------  --------  ------  ------------
        pg14          14.6         5433  Installed   
        pg15          15.1         5432  Installed   

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

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