This is a master class about Tarantool Cloud.
Star, share, raise issues and send pull requests :)
Here you will find key commands I eneted on my notebook during the demo, as well as any reference materials we will be going over.
This will run Tarantool and immediately put you into command-line prompt.
docker run --rm -t -i tarantool/tarantoolPress ^C to exit.
To do what I just did, you will need to install Docker:
- On Linux
- On Mac (Installer)
- On Windows (Installer)
docker run --rm -t -i -p 3301:3301 tarantool/tarantoolAnd then connect to port 3301 on localhost!
docker run --rm -t -i tarantool/tarantool:1.7or
docker run --rm -t -i tarantool/tarantool:1.5docker run --rm -t -i -e TARANTOOL_SLAB_ALLOC_ARENA=0.7 tarantool/tarantoolSave the following as docker-compose.yml:
version: '2'
services:
tarantool1:
image: tarantool/tarantool:1.7
environment:
TARANTOOL_REPLICATION_SOURCE: "tarantool1,tarantool2"
networks:
- mynet
ports:
- "3301:3301"
tarantool2:
image: tarantool/tarantool:1.7
environment:
TARANTOOL_REPLICATION_SOURCE: "tarantool1,tarantool2"
networks:
- mynet
ports:
- "3302:3301"
networks:
mynet:
driver: bridgeAnd then run:
docker-compose upYou will have 2 containers with Tarantool 1.7 with master-master replication.
Go to http://tarcl1.dev.mail.ru. (Sorry guys, only internal page at this time)
Press "Create" and wait for 20 seconds. You will get a fault-tolerant memcached instance.
I will be using Python, but you can use any language.
easy_install pymemcacheThen write the following python code (replace 10000 with your own port):
from pymemcache.client.hash import HashClient
client = HashClient([
('tarcl1.dev.mail.ru', 10000),
('tarcl2.dev.mail.ru', 10000)
])
client.set('some_key', 'stored value')
result = client.get('some_key')
print(result)2 services:
- tarantool/cloud: an Instance Manager
- mailru/cloud-exposer: Load-Balancer-As-A-Service (not open-source for now)
The 'exposer' is needed to automatically reroute traffic from broken to live instances. Everything else is done with Instance Manager.
Clone the repository
git clone https://github.com/tarantool/cloud.git
cd cloudNow use docker-compose to run the cloud:
docker-compose upIn a few seconds, go to http://localhost:5061 and try creating Tarantool instances.
./taas -H localhost:5061 run --name myinstance 0.3There are solutions for sharding and dynamic code reloading, but they don't give you the full solution. We will change that.
So, in future cloud project will give you:
- Tarantool binary protocol
- Transparent horizontal scaling
- Code deployment (blue/green and feature flags)
- App marketplace
