prebid-cache icon indicating copy to clipboard operation
prebid-cache copied to clipboard

Amazon Keyspaces as a backend

Open pboisso opened this issue 2 years ago • 3 comments

Hi,

I'm wondering if anyone successfully ran prebid-cache using an AWS Keyspaces managed cache backend?

My first try is resulting in this error : Error creating Cassandra backend: gocql: unable to create session: unable to discover protocol version: dial tcp 3.234.248.205:9042: i/o timeout

Hosts and keyspace settings were defined the config.yaml

Any insights would be helpful. Thanks.

pboisso avatar Dec 01 '22 18:12 pboisso

For those interested, I got it working following instructions in this page : https://docs.aws.amazon.com/keyspaces/latest/devguide/using_go_driver.html

Had to modify cassandra.go Init function adding these lines...

// AWS Keyspaces service support

c.cluster.Authenticator = gocql.PasswordAuthenticator{
        Username: "username",
        Password: "password"}
		
// provide the path to the sf-class2-root.crt
c.cluster.SslOpts = &gocql.SslOptions{
        CaPath: "sf-class2-root.crt",
        EnableHostVerification: false,            
 }
 
//Override default Consistency to LocalQuorum
c.cluster.Port = 9142
 c.cluster.Consistency = gocql.LocalQuorum
 c.cluster.DisableInitialHostLookup = false

I see prebid-cache now reading and writing to Amazon Keyspaces. Note that I also had to manually create the table in Amazon Keyspaces.

pboisso avatar Dec 01 '22 21:12 pboisso

Thanks for posting a solution @pboisso - will keep this issue open and add to docs somewhere.

bretg avatar Dec 02 '22 20:12 bretg

@pboisso We have not forgotten about this request, but it is relatively low on our priority list. If you (or anyone) needs it sooner than we can get to it, you're welcomed to open a PR.

SyntaxNode avatar Jul 10 '23 17:07 SyntaxNode