Rémi (Hooste | 1 Jun 2006 18:39

Secondary server not working

Hello,

I've got two Bind-DLZ servers on two different box. Each has its own mysql
server, replicated each hour with a script of mine. I put my domains on the
dns servers (ns1.hooste.net & ns2.hooste.net), and everything is working
well. Nslookup confirms that each server can answer the queries.

But if I shutdown my primary server (ns1), ns2 won't take the relay. My
domains become unreachable. If I use nslookup on my ns2 server, it responds,
but if I just try to ping the domain name, it's still unreachable.

Is there a special step to take in order to use two bind-dlz server as ns1
and ns2 ?

Thanks,

Rémi
remi <at> hooste.com
www.hooste.com
Rob Butler | 1 Jun 2006 19:06
Picon
Favicon

Re: Secondary server not working

Nope.  But you need to make sure your machines (not
the dns servers, other machines) are configured with
both a primary and secondary DNS server to query in
there TCP config or via DHCP.

Also, since these are meant to be authoritative
servers both should be listed with your registrar.

Rob

--- Rémi (Hooste) <remi <at> hooste.com> wrote:

> Hello,
> 
> I've got two Bind-DLZ servers on two different box.
> Each has its own mysql
> server, replicated each hour with a script of mine.
> I put my domains on the
> dns servers (ns1.hooste.net & ns2.hooste.net), and
> everything is working
> well. Nslookup confirms that each server can answer
> the queries.
> 
> But if I shutdown my primary server (ns1), ns2 won't
> take the relay. My
> domains become unreachable. If I use nslookup on my
> ns2 server, it responds,
> but if I just try to ping the domain name, it's
> still unreachable.
> 
(Continue reading)

William Ahern | 3 Jun 2006 07:36

Re: Replicated BDB

On Thu, 18 May 2006 12:49:23 +0000, Dushyanth Harinath wrote:

> Hey,
> 
>> BDB 4.4 supports master-slave replication, however all the peers can
>> elect a new master, and commits are by majority. So, you effectively
>> have a fairly genuine distributed system.
>> 
>> I already have code for a high-performance replicator daemon:
>> 
>> http://www.25thandclement.com/~william/projects/libevnet.html
> 
> Very interesting. I was looking at something towards these lines to
> replace my Postgres-BindDLZ setup with the High perfomance BDB driver.
> 
> However, iam not able to find any details about the replicator daemon at
> the link you provided.
> 
> As far as i understand from the SleepyCat's BDB reference manual, this
> replication infrastructure is something that needs to be built using the
> library they provide.
> 

Ah, yes. The interface is actually pretty simple, though. All that's
required from the application is to pass opaque messages between the
daemons. All you need to know about each message, for the most part, is
how to map the node ID to a connected host. So, my point was that libevnet
already provides nice non-blocking buffered socket I/O components and
other accoutrements. In my experience you spend upwards of 50% to 75%
just re-writing the same damn code (generic component libraries
(Continue reading)

Paul Augros | 8 Jun 2006 22:21

MySql Performance issues

Hello,
I was wondering if anyone has seen mysql grind the processor at 100%
significantly before reaching the kind of benchmarks mentioned on the DLZ home
page.  

I'm preparing to replace our primary name server (which recieves about 55 DNS
queries per second) with one that uses dlz and mysql.  

The server resolves okay and behaves otherwise properly until I make it live, at
which point it sql shoots up to 100% and queries are slow or go unanswered.

I have a 2.4 GHz machine, so but I'm not getting anywhere near the 600 queries
per second that it is claimed dlz/mysql can handle.  

Here's my config in named.conf:

dlz "Mysql zone" {
   database "mysql
   {host=localhost dbname=DNS user=root pass=b3Ha88y!}
   {select Zone from DNSRecords where Zone = '%zone%';}
   {select TTL, Type, MXPriority, Data, RespPerson, Serial, Refresh, Retry,
Expire, Minimum
        from DNSRecords where Zone = '%zone%' and Host = '%record%';}
";
};

I'm not seeing any errors in /var/log/messages.  I had binary logging enabled in
mysql, and disabled it.  No effect either way.  

Incidentally, running the sql-bench tests that came with mysql also grinds the
(Continue reading)

Max CtRiX | 8 Jun 2006 22:45
Picon
Favicon

Re: MySql Performance issues

Paul Augros wrote:

> I'm not seeing any errors in /var/log/messages.  I had binary logging enabled in
> mysql, and disabled it.  No effect either way.  

Indexes are the most important part.
Please post a mysqldump of your tables (excluding data) so we can see 
what kind of optimizations you have on mysql.

P.S.:

"pass=b3Ha88y!" <--- hope this is not your production pwd!

Max
Paul Augros | 8 Jun 2006 23:15

Re: MySql Performance issues


Yeah, I realized I'd posted my password 
and changed it.  Thanks though.

Here's my mysqldump:

CREATE TABLE `DNSRecords` (
  `ID` int(11) unsigned NOT NULL auto_increment,
  `Zone` text collate utf8_bin,
  `Host` text collate utf8_bin,
  `Type` text collate utf8_bin,
  `Data` text collate utf8_bin NOT NULL,
  `TTL` int(11) default NULL,
  `MXPriority` text collate utf8_bin,
  `Refresh` int(11) default NULL,
  `Retry` int(11) default NULL,
  `Expire` int(11) default NULL,
  `Minimum` int(11) default NULL,
  `Serial` bigint(20) default NULL,
  `RespPerson` text collate utf8_bin,
  `PrimaryNS` text collate utf8_bin,
  `AccountID` int(11) default NULL,
  `OrderID` int(11) default NULL,
  `ChangedAt` datetime default NULL,
  `ChangedBy` varchar(200) collate utf8_bin default NULL,
  `ActionType` varchar(50) collate utf8_bin default NULL,
  PRIMARY KEY  (`ID`),
  KEY `DNSIndex` (`Host`(20),`Zone`(30),`Type`(8))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

(Continue reading)

Max CtRiX | 8 Jun 2006 23:53
Picon
Favicon

Re: MySql Performance issues

Paul Augros wrote:
> Yeah, I realized I'd posted my password 
> and changed it.  Thanks though.
> 
> Here's my mysqldump:

OK.

CREATE INDEX idx_records_zone on DNSRecords(Zone);
CREATE INDEX idx_records_Host on DNSRecords(Host);

(the following not really necessary, but do it anyway)

CREATE INDEX idx_records_ZoneHost on DNSRecords(Zone,Host);

> DROP TABLE IF EXISTS `DNSXFR`;
> CREATE TABLE `DNSXFR` (
>   `ID` int(11) unsigned NOT NULL auto_increment,
>   `Zone` text collate utf8_bin NOT NULL,
>   `Client` text collate utf8_bin NOT NULL,
>   PRIMARY KEY  (`ID`),
>   KEY `XFRIndex` (`Zone`(30),`Client`(20))
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

Same here, left as exercise, but useless 'cause you do not use it in 
your config.

Max
Paul Augros | 9 Jun 2006 14:20

Indexes

Thanks for your help.
I actually already had indexes on that table, 
I just didn't know how to show them.

Now a show index gives:

------+-------------+----------+--------+------+------------+---------+
| Table      | Non_unique | Key_name         | Seq_in_index | Column_name |
Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+------------+------------+------------------+--------------+-------------+---
| DNSRecords |          0 | PRIMARY          |            1 | ID          | A  
    |        8342 |     NULL | NULL   |      | BTREE      |         |
| DNSRecords |          1 | DNSIndex         |            1 | Host        | A  
    |         417 |       20 | NULL   | YES  | BTREE      |         |
| DNSRecords |          1 | DNSIndex         |            2 | Zone        | A  
    |        8342 |       30 | NULL   | YES  | BTREE      |         |
| DNSRecords |          1 | DNSIndex         |            3 | Type        | A  
    |        8342 |        8 | NULL   | YES  | BTREE      |         |
| DNSRecords |          1 | idx_records_zone |            1 | Zone        | A  
    |          78 |       30 | NULL   | YES  | BTREE      |         |
| DNSRecords |          1 | idx_records_host |            1 | Host        | A  
    |         417 |       30 | NULL   | YES  | BTREE      |         |
+------------+------------+------------------+--------------+-------------+---

I'm guessing I only need one set of these.  Could the problem be that the key
name was the same for all my column indexes?  Is there a way to find out if sql
is actually using the index?

Thanks,
Paul
(Continue reading)

Max CtRiX | 9 Jun 2006 15:40
Picon
Favicon

Re: Indexes

Paul Augros wrote:
> Thanks for your help.
> I actually already had indexes on that table, 
> I just didn't know how to show them.
> 

mysqldump --opt -uUSER -pPASS DBNAME >outfile

This dumps The DB and all related data and indexes.
Delete record informations (all inserts) and see it.
Indexes on mysql is quite a complex thing. There are commands to show 
the interpretation of the query and optimize all results.

Documentation on www.mysql.com is quite complete.
You may try to have a look there and see if the bottleneck is the DB.

Max
Paul Augros | 9 Jun 2006 16:09

Re: Indexes

Max CtRiX <ctrix <at> navynet.it> writes:

> 
> Paul Augros wrote:
> > Thanks for your help.
> > I actually already had indexes on that table, 
> > I just didn't know how to show them.
> > 
> 
> mysqldump --opt -uUSER -pPASS DBNAME >outfile
> 
> This dumps The DB and all related data and indexes.
> Delete record informations (all inserts) and see it.
> Indexes on mysql is quite a complex thing. There are commands to show 
> the interpretation of the query and optimize all results.
> 
> Documentation on www.mysql.com is quite complete.
> You may try to have a look there and see if the bottleneck is the DB.
> 
> Max
> 

It's responding *much* quicker after fixing the indexes such that they each have
a unique name.  I'm pretty sure I'll be able to use it in production now.  

Thanks for all your help, especially since sql-specific questions are a bit
outside the scope of this group.

Paul
(Continue reading)


Gmane