mongodb - PHP Mongo Session Handler and Sharding -
i using
as session handler php app.
our app expecting high volume traffic, experimenting sharding mongo store session.
i have set shard according the document, , things fine before shard collection (i can see session document being created in session
collection).
as enabled sharding on session
using sharding key sess_id
, no session document gets created (i.e. count never change), , see these lines in mongos
log whenever visit php page: resetting shard version of mydb.session on my.hsard.ip.address:port, version zero
i have tried shard other collection , works fine, tells me sharding setup correct.
anybody have clue of might wrong? i'm using mongo 2.2.3.
found cause.
it because write
function in mongodbsessionhandler.php
comes symfony version using not work sharding.
the mongodbsessionhandler.php
using implements write
this:
$mongo->update({shardkey:1}, {shardkey:1, data:2}, {upsert:true})
which not allowed, because cannot change shard key.
solution use latest version of mongodbsessionhandler.php
in github.
Comments
Post a Comment