Fórum

How does the portal-ext.properties file work in a cluster?

thumbnail
William Gosse, modificado 8 Anos atrás.

How does the portal-ext.properties file work in a cluster?

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
How does the portal-ext.properties file in a cluster work in a cluster?

Are the settings in one portal-ext.properties for one server applied to all servers in the cluster or is it just applied to the individual server that loads?

Right now we have two servers sharing a common database, data folder and LDAP. The LDAP settings are currently configured in the Control Panel and I assume shared by the two servers via the database. We are thinking of moving that configuration to the portal-ext.properties file. Currently the portal-ext.properties file for both servers are identical.

We were wondering if we could have each server in the cluster point to a different LDAP server via its portal-ext.properties file would that actually work or not? This would be for migrating them both eventually to a new LDAP one at a time?
thumbnail
Olaf Kock, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Liferay Legend Postagens: 6403 Data de Entrada: 23/09/08 Postagens Recentes
It's just working on the machine that you've configured it on. Just as you'll have to make sure to deploy plugins to all machines in the cluster, you'll have to make sure to configure all the cluster machines reasonably identical.

Note the "reasonably": It's totally fine if you have differences - e.g. statically loadbalance between different LDAP servers (1 LDAP for each Liferay node). However, be aware that some configuration might be stored in the database, thus there might be unexpected behaviour if you expect them to be different (but the database has the same information for both)
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Liferay Legend Postagens: 14917 Data de Entrada: 02/09/06 Postagens Recentes
LDAP settings are initially read from the properties file but then stored in the DB. Any changes made in the interface (not in portal-ext.properties) will be stored in the database.

The portal will use the config from the database unless it is deleted from the db, then it will fall back to values from portal-ext.properties.

So you could get two instances pointed at two different LDAPs, but that's where your plan will start to unravel.

When users authenticate against LDAP, Liferay uses the user record info and the password to bind against LDAP; if the bind works, user can get in, if not user is not allowed in.

So if my user record was pulled in on LiferayNode1 which came from Ldap1 and I happen to log in on LiferayNode1, everything should be fine.

But if I try to log in on LiferayNode2, Liferay will try binding against Ldap2 where I may not have come from and authentication will fail, even if I'm a valid user.

You would have to guarantee that I always log in via LiferayNode1 and, at that point, you no longer have a cluster if everyone is hard coded to a single node?
thumbnail
William Gosse, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
Thanks, this question was somewhat hypothetical. In reality we have an ldap cluster as well. However one of the ldaps behind the cluster isn't working correctly so we are getting intermediate authentication failures. So we are trying to figure out a way to bring one of the app server up on the bad one so we could debug it without effecting the other.

One point you said that I need clarification on. If I have my ldap configuration in my portal-ext.properties when liferay server starts up and loads it, it will then store in the database? Is that what you are saying?
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Liferay Legend Postagens: 14917 Data de Entrada: 02/09/06 Postagens Recentes
The first-time startup of Liferay (when it creates all of the Liferay tables), not the regular restarts. Regular restarts will not repopulate the prefs.
thumbnail
William Gosse, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
So when I do an initial install I really don't have anything related to LDAP in the control panel or portal-ext.properties file. All the tables are created at that point. If after I then add the LDAP properties to the portal-ext.properties file, then restart, will these properties then be saved to the database? Sorry if I seem like I'm asking the same question but this whole relationship between portal-ext.properties file and the database seems a little fuzzy.
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Liferay Legend Postagens: 14917 Data de Entrada: 02/09/06 Postagens Recentes
William Gosse:
this whole relationship between portal-ext.properties file and the database seems a little fuzzy.


Yeah, happens to me too.

Here's how I think it works... If you make any changes in the interface, I think the props end up in the database, period.

If you have them in the p-e.props file when the portal is started the first time, the props are copied into the DB and will be stored in there.

After that is the fuzzy spot. My understanding is the portal will not push to DB from props file on subsequent starts. This may end up being version-dependent (and I just don't know it) and likely subject to change, but that is what my impression is.
thumbnail
William Gosse, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
Thanks David! You are always very helpful and its much appreciated.
thumbnail
Denis Signoretto, modificado 8 Anos atrás.

RE: How does the portal-ext.properties file work in a cluster?

Expert Postagens: 375 Data de Entrada: 21/04/09 Postagens Recentes
Hi William,

I had a similar scenario (Liferay two cluster nodes and LDAP auth). From my experience if Liferay was already started (one or more times) without any LDAP database configuration saved in Control Panel, each node takes LDAP settings from portal-properties.

I haven't tried out but I can guess that if you delete any LDAP entry from Control Panel and add to each cluster node its own LDAP settings in each portal-ext.properties you could gain to have different settings per node.

As David said, check in the User_ table if the "user preferred LDAP " (ldapServerId column) column has been set otherwise you can fall in authentication errors.

Regards,
Denis.