nilsteampassnet / TeamPass

Collaborative Passwords Manager
https://www.teampass.net
1.68k stars 550 forks source link

Configuration in HA #779

Closed xFRaNeRx closed 7 years ago

xFRaNeRx commented 10 years ago

Hello,

We are trying to deploy TeamPass as a High Availability solution. We have tried to use two frontends (web server) and a multimaster galera cluster of mysql, balanced by an HAProxy, but it doesn't works. There are errors in mysql.

There are some recommended configuration to do an Teampass HA deployment?

Thanks in advance, Fran

dbiers commented 10 years ago

Can you provide the errors that you are receiving? What part of the solution is not working?

xFRaNeRx commented 10 years ago

I made a clean install on galera multimaster cluster, on first access i see the message: "It is recommended to update your TeamPass installation. Click HERE".

I try to change an option in settings screen, and when I save, this error is shown:

"Error: Field 'field_1' doesn't have a default value Query: UPDATE teampass_misc SET valeur=NULL WHERE type = 'admin' AND intitule = 'ldap_user_attribute'"

If I apply the update, the update is applied succesfully, but after applied, I can not login to web interface.

I've seen that one of the limitations of galera cluster is that every table must have a primary key. Not all teampass database tables have a primary key. I don't know if this could be the problem, or the problem is another limitation of galera clusters.

xFRaNeRx commented 10 years ago

With teampass updated, I can access to interface, but it delays a lot. When I try to change some setting, I get the same error.

ImNtReal commented 9 years ago

I've actually been trying to get a similar setup working. I've managed to get a second server pointed at my MariaDB Galera cluster, but my production server throws a 500 error.

ImNtReal commented 9 years ago

After some more investigation, it seem my issue is actually connecting to my database through our load balancer. I still have to figure out why it works from one web server, but not the other.

dbiers commented 9 years ago

I am assuming they are able to all ping one another. Is it a permission denied or does the connection time out?

Also make sure you create the user twice, once for each server IE

mysql> GRANT PRIVILEGES on teampass.* to 'user'@'SERVERA' identified by 'password'; mysql> GRANT PRIVILEGES on teampass.* to 'user'@'SERVERB' identified by 'password'; mysql> flush privileges;

On Thu, Dec 4, 2014 at 8:58 AM, Jameson Pugh notifications@github.com wrote:

After some more investigation, it seem my issue is actually connecting to my database through our load balancer. I still have to figure out why it works from one web server, but not the other.

— Reply to this email directly or view it on GitHub https://github.com/nilsteampassnet/TeamPass/issues/779#issuecomment-65643441 .

David Biers

System Administrator

ProfitBricks, Inc.

Mobile: 1-361-549-3395

Support Hotline: 1-866-936-0764

Email: david.biers@profitbricks.com

Web: Learn why we're the Price/Performance leader in Cloud Computing http://www.profitbricks.com/

http://www.profitbricks.com/

ImNtReal commented 9 years ago

I'm currently using a Netscaler to balance the SQL cluster. I think I'll have to take it up with Citrix. When I try to connect from one server to the load balanced VIP, it works fine, but the other doesn't allow it. On the SQL server, I granted privileges using 'teampass'@'%'.

ImNtReal commented 9 years ago

Found my issue. Galera doesn't sync MyISAM tables by default, only InnoDB. There is a global variable you have to switch to on in order to get it to work.

mattdunn4465 commented 8 years ago

I have a similar issue. I am using galera + mariadb on ubuntu 12.04 x64. My issue isn't load balancing since its a multi-master setup so I have bypassed my load balancer (maxscale) all together. Database is replicated fine as its alread a InnoDB type. Collation's look fine. Permissions look fine. I was able to update all dependencies during install and seemed successful. However now when first trying to hit the page after install, I get an error "You are not allowed to see this page." in chrome, but a 500 error in IE. I don't see any debugging options other then ldap. This is a fresh install btw with the latest version of teampass

mattdunn4465 commented 8 years ago

I take that back... I just downloaded 2.1.26_RC1 and did a fresh install on the front end, but left the back end alone. Seems fine and now pages pull up. I noticed languages has values in it now on the db so that "may" have been my issue. Please disregard my comments since new version seems fine.

mattdunn4465 commented 8 years ago

Well for whomever reads hits, I had to add a column for can_manage_all_users in the database for it to work. This really isn't the place for this note, but helpful non the less to others