Mathoid

From Wikitech
Jump to: navigation, search

Mathoid is a stateless node service on the sca cluster. It gets POST requests from MediaWiki containing mathematical formulas in LaTeX, and returns JSON with MathML and SVG renderings of the formula. An early version used PhantomJS for the rendering, but this was replaced with MathJax directly in nodejs before deploy. As such, this service does not shell out or store anything in the file system.


Deployment

Deployment is currently using trebuchet.

# on tin 
cd /srv/deployment/mathoid/mathoid
git deploy start
git pull
git deploy sync 

Monitoring

Troubleshooting

The service listens on port 10042. Example request:

curl -XPOST -d'q=e=mc^2' http://sca1001:10042/

This should return JSON with 'mml' and 'svg' members.

Logs

/var/log/mathoid/main.log on each node.

Fail-over

The SCA cluster is load balanced through LVS. The failure of an individual node does not affect the availability of the service.

Restarting a node

service mathoid restart

See also