On 10/10/2014 12:28 PM, Hseu-Ming Chen wrote:
>> did you change a hostname as part of your fix?
>
> My bad. Since it was late at night, i went to bed (after shut down my
> Linux boxes) and resumed the journey next day. However, thanks to the
> DHCP at home, the IP of GitSlave changed. i did change the
> ~/.ssh/config accordingly but the git [origin|upstream] still contains
> the old IP.
>
> The IP assignment for tonight is:
> GitMaster 192.168.1.107
> GitSlave 192.168.1.104
I think you're asking for trouble if you try to setup mirroring on
DHCP-ed servers. In theory there're probably ways to solve this but in
practice it sucks big time and probably won't work reliably/consistently.
> Early this evening i wiped everything out on both GitMaster and
> GitSlave and tried to see if i have any luck just mirroring some
> simple changes in testing.git. Unfortunately even that simple
> mirroring does not appear to work for me:
>
> <tailing of the log, ~gitolite/.gitolite/logs/gitolite-2014-10.log, on GitServer>
> ...
> 2014-10-10.02:11:52 9510 ssh ARGV=hseuming SOC=git-receive-pack 'testing' FROM=192.168.1.107
> 2014-10-10.02:11:52 9510 pre_git testing hseuming W any refs/.*
> 2014-10-10.02:11:52 9510 mirror,pre_git,testing,user=hseuming,sender=,mode=slave
> 2014-10-10.02:11:52 9510 die GitSlave: pushing 'testing' to slave 'GitSlave' not allowed
You can't push to the slave (normally). You have to push to the master.
> The ~gitolite/.gitolite/conf/gitolite.conf on GitSlave is as follows:
> ====================================
> repo gitolite-admin
> RW+ = hseuming
> option mirror.master = GitMaster
> option mirror.slaves = GitSlave
>
> repo testing
> RW+ = @all
> option mirror.master = GitMaster
> option mirror.slaves = GitSlave
>
> repo ming
> RW+ = @all
> option mirror.master = GitMaster
> option mirror.slaves = GitSlave
> ====================================
>
> Which is identical to ~gitolite/.gitolite/conf/gitolite.conf on GitMaster.
>
> i tried 3 times but always ran into the same error. i did remove the
> gl-slave-*.status left over on the master server before each try.
>
> Any suggestion?
>
> One more question: i could not get the following to work 2 days ago:
> ssh GitSlave info == from GitMaster
> ssh GitMaster info == from GitSlave
> as described at
>
http://gitolite.com/gitolite/mirroring.html
I'm going to assume that "==" and what follows is not part of the
command you typed (hint: use "#" instead; much more obvious that what
follows is meant to be a comment or a note).
> However, after i did some tweaking which is not documented on the
> mirroring page, both ssh commands started working. This is what i
> did: assuming i use alice.pub in
> gitolite setup -pk alice.pub
> while setting up Gitolite. After i copied Alice's PRIVATE key over
> to ~gitolite/.ssh/id_rsa (with the line "identityfile ~/.ssh/id_rsa"
> in ~gitolite/.ssh/config) on both GitMaster & GitSlave, then the
> following commands both work fine:
> ssh GitSlave info == from GitMaster
> ssh GitMaster info == from GitSlave
> Is the tweaking right?
Probably not, but I didn't actually understand. Who is "alice"?
"alice.pub" is a normal USER key, what does that have to do with
mirroring? Mirroring is between hosts, whose keys, in the "keydir"
directory of your gitolite-admin repo, must always be "server-<name of
host>.pub". (Without the angle brackets, need I add?)
And anytime you have to copy a PRIVATE key from somewhere to somewhere
else, you're doing something wrong. And if I ever say that kind of
nonsense in the gitolite documentation, please shoot me.