Slack and MySQL

Google presented a talk about the MySQL conference about how they deploy MySQL.

We use the same general technique here at Tailrank.

But they published a pretty interesting hack/trick for fast network IO:

on the target:

nc ­l ­p 12345 | tar xvf ­ 

no the source:

tar cvf ­ * | nc target 12345

  1. I think you’re missing a couple dashes in your commands. Specifying a dash for the filename in tar means stdin/stdout, depending on operation. So, it’d be:

    nc l p 12345 | tar xvf –
    tar cvf – * | nc target 12345

    You can combine things using ssh:

    tar cBf – * | (ssh target; tar xBf -)

  2. Well that looks familiar. I have scripts using that trick from ~2001 or so. I wonder if I remembered to put that in the book… Hm.

  3. Laine

    Here’s right from Google’s presentation. 12345 being generic port# obviously

    On the target:
    – Start nc listening for incoming data
    nc l p 12345 | tar xvf •

    On the source:
    – Push tar’ed files to the target
    tar cvf * | nc target 12345






%d bloggers like this: