SessionStorage
Jump to navigation
Jump to search
This page is currently a draft. More information and discussion about changes to this draft on the talk page. |
Session storage utilizes Kask, a RESTful opaque key/value storage abstraction on top of Apache Cassandra.
Production Environment
Service endpoints
https://sessionstore.discovery.wmnet:8081/sessions/v1
eqiad
https://sessionstore.svc.eqiad.wmnet:8081/sessions/v1
codfw
https://sessionstore.svc.codfw.wmnet:8081/sessions/v1
staging
https://staging.svc.eqiad.wmnet:8081
Prometheus metrics
https://sessionstore.discovery.wmnet:8081/metrics
Readiness
https://sessionstore.discovery.wmnet:8081/healthz
Deployment
Deployment-prep
Unlike production, Docker is used to deploy the session storage service in the deployment-prep environment.
In a web browser:
- Visit https://horizon.wikimedia.org
- Select the deployment-prep project
- Select Project → Instances (in the sidebar)
- Locate and select the deployment-sessionstore02 instance
- Select the Puppet Configuration tab
- Scroll to the bottom of the page, and click edit for Hiera Config (see below)
- Click "Apply Changes"
- Run
sudo puppet agent -tv
from deployment-sessionstore02
Sample Hiera Config
profile::cassandra::instances:
deployment-sessionstore02.deployment-prep.eqiad1.wikimedia.cloud: {}
profile::docker::engine::declare_service: true
profile::docker::engine::settings: {}
profile::docker::engine::version: 1.12.6-0~debian-jessie
profile::docker::runner::service_defs:
mediawiki-services-kask:
config:
base_uri: /sessions/v1
cassandra:
authentication:
password: cassandra
username: cassandra
hosts:
- deployment-sessionstore02.deployment-prep.eqiad1.wikimedia.cloud
keyspace: sessions
table: values
default_ttl: 86400
listen_address: 0.0.0.0
listen_port: 8080
openapi_spec: /go/src/gerrit.wikimedia.org/r/mediawiki/services/kask/openapi.yaml
service_name: sessions
namespace: wikimedia
override_cmd: ./kask --config /etc/mediawiki-services-kask/config.yaml
port: 8080
version: 2019-06-11-154352-production
![]() | The contents of mediawiki-services-config.config are written verbatim to the container as /etc/mediawiki-services-kask/config.yaml (the Kask configuration file) |
![]() | Use mediawiki-services-kask.version to specify the Kask Docker image tag. Use mediawiki-services-kask.port to assign the port Kask will listen on. |
k8s
See also: Migrating from scap-helm
Staging
![]() | Deployments performed from a deployment.{eqiad,codfw}.wmnet secure shell session |
cd /srv/deployment-charts/helmfile.d/services/staging/sessionstore
source .hfenv
helmfile diff
helmfile apply
Production
![]() | Deployments performed from a deployment.{eqiad,codfw}.wmnet secure shell session |
cd /srv/deployment-charts/helmfile.d/services/eqiad/sessionstore
source .hfenv
helmfile diff
helmfile apply
cd /srv/deployment-charts/helmfile.d/services/codfw/sessionstore
source .hfenv
helmfile diff
helmfile apply
Command cheetsheet
helmfile {status,diff,apply}
kubectl get pods <POD> -o yaml
# Tailing log files
kubectl logs -f --since 60m -c kask-staging <POD ID>
kubectl describe pod <POD> -n sessionstore
kubectl get events # Doesn't work, open phab request
# Port forward to the service running on <POD> (useful for testing)
kubectl -n sessionstore port-forward <POD> :8081