Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 18th March 2013, 11:12
snowfly snowfly is offline
Member
 
Join Date: Jul 2006
Posts: 90
Thanks: 0
Thanked 4 Times in 3 Posts
Default Issue creating databases/users after 3.0.5.1 upgrade, multiserver setup

Hi,
Firstly thank you to Falko, Till, and all the other developers/contributors on ISPConfig 3.0.5.1, good work.

Just begun upgrading a multiserver setup today, all gone well, except for the new change to database-user relationship.

We heavily use the API into our own billing control panel.
So for now to keep similar functionality as pre-3.0.5, our CP creates one database with one database user.

However can't get this to work on remote servers.
Steps:
1. Create database user: sites_database_user_add()
2. Create database (with user_id from above): sites_database_add()

This is successful if creating a database on the primary ISPConfig server (e.g. server-CP).
But fails if creating a databaase on a remote server (e.g. server-webX)

The database is created on the remote server, but the user is not.

Checked the primary ISPConfig server 'dbispconfig' database, the 'web_database' table correctly shows both databases, and the 'web_database_user' correctly shows both users, with correct server_id's (1 for primary, and 14 for remote)

Then checked the remote ISPConfig server 'dbispconfig' database, 'web_database' record is correct, but 'web_database_user' does not have user record.

So looks like the remote server does not process the 'sites_database_user_add' command from the primary queue.

Have I missed something?
Reply With Quote
Sponsored Links
  #2  
Old 18th March 2013, 11:48
snowfly snowfly is offline
Member
 
Join Date: Jul 2006
Posts: 90
Thanks: 0
Thanked 4 Times in 3 Posts
Default

Update:

Q: Do databases now need to be linked to a client website (parent_domain_id) using the API in 3.0.5.1?
Previously databases were linked to a client itself, not a website

The API example for sites_database_add() does not appear to take a 'parent_domain_id' param, only a $client_id.
BUT, in the dbispconfig.web_database table there is a parent_domain_id field, which appears to be populated when using the original ISPConfig web interface.

Upon further inspection, when using the original ISPConfig web interface to create a DB+User on a remote server, sys_datalog contains a record like:
dbtable=web_database_user, dbidx=database_user_id:376, action=i
(which suggests insert)

But when creating a DB and user with the API, there is no sys_datalog entry for web_database_user.
Reply With Quote
  #3  
Old 18th March 2013, 12:58
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,774
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

Quote:
Q: Do databases now need to be linked to a client website (parent_domain_id) using the API in 3.0.5.1?
Previously databases were linked to a client itself, not a website
Yes. Databases are now assigned to a website so that the database backup can be included in the website backup. The client selector has been removed as the owendershoip can be determined trogh the website ownership.

Quote:
But when creating a DB and user with the API, there is no sys_datalog entry for web_database_user.
CReate the database user first with the api and then create the db and assign the db to the database user. If a database user exists already that you want to reuse, then you dont have to create a new one.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 18th March 2013, 22:17
snowfly snowfly is offline
Member
 
Join Date: Jul 2006
Posts: 90
Thanks: 0
Thanked 4 Times in 3 Posts
 
Default

Quote:
Originally Posted by till View Post
CReate the database user first with the api and then create the db and assign the db to the database user. If a database user exists already that you want to reuse, then you dont have to create a new one.

Our API scripts were creating the database first, and then the database itself.

Found the problem, we were not passing 'parent_domain_id' into sites_database_add(), as per the API examples.

Once we added 'parent_domain_id', the database would then get created successfully on the remote server.

Interestingly, all our existing databases (pre 3.0.5.1) do not have a 'parent_domain_id' relationship, and we can still update database passwords ok on remote server. Thanks for the backwards compatibility.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Broken Email Server in Multiserver Setup atjensen11 Installation/Configuration 7 7th October 2012 23:57
Setting phpmyadmin on multiserver setup Wisdown Installation/Configuration 11 14th September 2012 08:37
Perfect Setup mixed with Virtual domain setup upgrade? volksman HOWTO-Related Questions 1 25th April 2008 20:36
iptables issue with xen perfect setup - debian alexnz HOWTO-Related Questions 3 25th November 2006 13:49
Apache Setup Issue Using Perfect Setup Suse10.1 E.L. Hibee HOWTO-Related Questions 8 12th June 2006 15:45


All times are GMT +2. The time now is 14:14.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.