The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

After turning on dns cluster can not add account on slave server

Discussion in 'cPanel Developers' started by johnny021, Nov 4, 2010.

  1. johnny021

    johnny021 Registered

    Joined:
    Nov 4, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    [SOLVED ]After turning on dns cluster can not add account on slave server

    Ok this is nightmare.

    1st server (for ftp, master dns)
    2nd server (for email, slave dns)

    After turning on cluster on master server I can not add accounts via cpanel api to 2nd server. When I turn off cluster everything works just fine.

    I do not have anything in log files, etc.
    Here is some code for this:

    PHP:
    //hosting account
    $xmlapi = new xmlapi(HOSTING_CPANEL_IP);
    $xmlapi->password_auth(HOSTING_CPANEL_USER,HOSTING_CPANEL_PASS);
    $acct1 = array( username => $cpanel_userpassword => $cpanel_passdomain => $domain);
    $xmlapi->createacct($acct1); // create hosting account
    $xmlapi->setsiteip(USERS_SERVER_IP_1,$cpanel_user); // set to local ip ex. 10.0.0.1
    $xmlapi->editzonerecord($domain,16,array(address => HOSTING_CPANEL_IP));

    //mail accounts
    $xmlapi_email = new xmlapi(EMAILS_CPANEL_IP);
    $xmlapi_email->password_auth(EMAILS_CPANEL_USER,EMAILS_CPANEL_PASS);

    $acct2 = array( username => $cpanel_userpassword => $cpanel_passdomain => $domain );
    $mail_acc_cr $xmlapi_email->createacct($acct2); 

    //some dns edit
    $mail_server_name 'mail.'.$domain;
                
    $xmlapi->editzonerecord($domain,20,array(exchange => $mail_server_name));
    $xmlapi->editzonerecord($domain,22,array(type => 'A'address => EMAILS_CPANEL_IP));
    Any idea?
     
    #1 johnny021, Nov 4, 2010
    Last edited: Nov 5, 2010
  2. johnny021

    johnny021 Registered

    Joined:
    Nov 4, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Solution:

    1. Open first account on slave server
    2. Open account on master server with forcedns set to 1 (forcedns=>'1')

    On this way first server will overwrite default values with real values in second step.
     
Loading...

Share This Page