prebid-cache
prebid-cache copied to clipboard
Amazon Keyspaces as a backend
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.
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.
Thanks for posting a solution @pboisso - will keep this issue open and add to docs somewhere.
@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.