Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDB Advanced Server compatibilites #13

Open
dirkkrautschick-edb opened this issue Nov 22, 2022 · 8 comments
Open

EDB Advanced Server compatibilites #13

dirkkrautschick-edb opened this issue Nov 22, 2022 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@dirkkrautschick-edb
Copy link

Hi,

should pgbasenv also be capable to scan EDB Advanced Server installations including clusters as well?
As far I could test it doesn't find a EPAS Home at all (installed for e.g. Red Hat derivates at /usr/edb/as14 for version 14).
A created cluster was found by the installation but it somehow doesn't recognized the full status.

LAST_START_HOME and LAST_START will be shown in pgup but the cluster isn't marked a running with STAT=UP, PID, PORT etc.
Maybe it is because there are wrappers or symlinks called like edb-postmaster as a starting process.

Thanks and best regards

Dirk

mmuehlbeyer added a commit that referenced this issue Nov 23, 2022
@rolandstirnimann
Copy link
Collaborator

Hi Dirk, could you already test it with the change from @mmuehlbeyer? Download bin/pgup.sh from the master branch to your VM. If there are still issues we will look into that again. Thank you.
Regards
Roli

@dirkkrautschick-edb
Copy link
Author

Hi Roland,

that solves the problem getting the status of the existing cluster. So that one is solved. But at least in my environment it still do not find the HOME. Actually I haven't found the point in the source yet where and how you scan the folders for the home directories.

Cheers

Dirk

@rolandstirnimann rolandstirnimann self-assigned this Mar 23, 2023
@rolandstirnimann rolandstirnimann added the bug Something isn't working label Mar 23, 2023
@rolandstirnimann
Copy link
Collaborator

Hi Dirk, can you provide me an EDB installation or the source resp. access to the yum repo? If yes, I will fix it.
Cheers Roli

@dirkkrautschick-edb
Copy link
Author

dirkkrautschick-edb commented Mar 27, 2023 via email

@dirkkrautschick-edb
Copy link
Author

dirkkrautschick-edb commented Apr 13, 2023 via email

@rolandstirnimann
Copy link
Collaborator

rolandstirnimann commented Apr 21, 2023

Hi Dirk, I did some tests and found the reason for the behavior. I installed EDBAS on a new VM (only EDB no community PostgreSQL). The it works without any problems.

[opc@lpg02 ~]$ sudo su - enterprisedb
Last login: Fri Apr 21 12:11:04 GMT 2023 on pts/1

pgBasEnv v2.2 by Trivadis AG

Installation homes:
┌────────┬─────────┬─────────────────┬──────────────┐
│ALIAS   │     VER │         OPTIONS │ HOME DIR     │
├────────┼─────────┼─────────────────┼──────────────┤
│pgh1520 │  15.2.0 │       ssl:1G:8K │ /usr/edb/as15│
└────────┴─────────┴─────────────────┴──────────────┘

Cluster data directories:
┌──────┬───────┬──────┬───────┬─────────┬───────┬────────────────────────┬──────────────────┬────────────────┐
│ALIAS │   VER │ STAT │  PORT │     PID │  SIZE │ PGDATA                 │       LAST START │ LAST START HOME│
├──────┼───────┼──────┼───────┼─────────┼───────┼────────────────────────┼──────────────────┼────────────────┤
│pgd15 │    15 │   UP │  5444 │  165411 │   88M │ /var/lib/edb/as15/data │ 2023-04-21 11:36 │ /usr/edb/as15  │
└──────┴───────┴──────┴───────┴─────────┴───────┴────────────────────────┴──────────────────┴────────────────┘


---[pgd15]:

         Installation home: /usr/edb/as15
    Cluster data directory: /var/lib/edb/as15/data
              Cluster port: 5444
            Cluster status: UP
           Cluster version: 15
        Cluster start time: 2023-04-21 11:36
   Size of all tablespaces: 56MB
      Cluster archive mode: off
               Cluster age: 9
         Autovacuum status: ACTIVE
         Cluster databases: postgres,edb,template1,template0

---[21.04.2023 12:11]

lpg02:/var/lib/edb [pgd15]$

Once you have EDB and community PostgreSQL on the same VM installed it depends if your OS users postgres and enterprisedb can read the PGDATA of each other. If yes, the tool does not work properly. Our current cluster home and cluster instance detection behaves not consistent.

  • The home detection (pghometab) distinguishes between the two users resp. the homes and detects only homes that belong to the currently logged on user. Therefore, you see in your output above only homes from community PostgreSQL since you are logged in with postgres user.
  • The cluster instance detection on the other hand does currently not distinguish between the two OS users resp. EDB and community. If the two users can read each others PGDATA the tool shows you the clusters for both users. In my case, where the two users have no permission to each others PGDATA it works since the cluster instance detection cannot look into PGDATA.

My proposal
I change the pgBasEnv detection the way that it behaves consistent. This means, it display you only the clusters and homes belonging to the current user you are logged in. Furthermore, with enterprisedb user you see only EDB homes and instances and with postgres community user you see only homes and instances belonging to it.
Does that make sense for you?

I think we should not display homes and clusters from other vendors resp. OS users since you can anyway not use it properly.

@rolandstirnimann
Copy link
Collaborator

@dirkkrautschick-edb, small update. I implemented the fix that only clusters of the same user are detected. Please download the latest pgbasenv.sh and test it.
If you have v2.2 installed please execute pgbasenv --clean-pgclustertab or just delete $PGBASENV_BASE/etc/pgclustertab and re-login. Then you should see with postgres user only the community stuff and with enterprisedb user only the EDBAS stuff.

@dirkkrautschick-edb
Copy link
Author

dirkkrautschick-edb commented Apr 23, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants