Nuxeo Stack Tuned for AWS
Yet another ansible script repo to provision a Nuxeo stack on AWS
The test profile will provision and setup the following stack of 5 instances:
- mongodb: m4.2xlarge (8cpu, 30g ram, 200g SSD)
- elasticsearch: m4.2xlarge (8cpu 30g ram, 200g SSD)
- nuxeo: c4.2xlarge (8cpu, 15g ram, 120g)
- redis: cache.m3.xlarge
- monitoring: c4.xlarge (4cpu, 7g, 30g SSD)
Cost: ~$2.10/h
git clone git@github.com:bdelbosc/nst4a.git
cd ./nst4a
-
Install the ansible requirement:
virtualenv venv source venv/bin/activate pip install -q -r ansible/ansible-requirements.txt -
Install ansible plugin, this require a write access to
/etc/ansiblesudo chown $USER.$USER -R /etc/ansible ansible-galaxy install --force -r requirements.txt sudo chown root.root -R /etc/ansible
-
Edit the
ansible/group_vars/all/main.ymlto set yourkeypair, the AWS region and project name akabench_tag -
Make sure your
awscliis setup with a valid AWS access in your~/.aws/credentialsthis is used by the inventory (ec2 boto) you can generate aSecurity Credentialfrom the AWS console: IAM/Users/(keypair)/Security Credential/Create access Key -
Before running ansible command you need to activate the virtual environment:
source venv/bin/activate export ANSIBLE_HOST_KEY_CHECKING=False
Run the playbook to create the needed instances:
cd ./ansible
ansible-playbook -vv provision.yml
This can take few minutes. Once it is done you can list the inventory:
python ./ansible/inventory.py
Here you need to have an ssh access to the instances, you may need to edit your ~/.ssh/config to use your keypair like this:
Host 54.*
User ubuntu
IdentityFile "/home/ben/.ssh/mykey-us-east-1.pem"
Once you have the ssh access you can run the ansible playbook to setup the stack:
pushd ./ansible
ansible-playbook -vv -i inventory.py site.yml
The Nuxeo is not yet started. Note that at the moment you may need to run multiple time the site playbook, there is a java8 installation that requires to rerun the playbook.
Get the public ip from the inventory (see section above).
- Nuxeo: http://nuxeo-ip:8080/nuxeo/
- Monitoring Grafana: http://monitoring-ip/
- Monitoring Graphite: http://monitoring-ip:8080/
For now do it from nuxeo host:
sudo service nuxeo start|stop
On Nuxeo:
sudo service nuxeo stop
echo "flushall" | redis-cli -h nyt-re-o81tzf435j2i.ocegtk.0001.euw1.cache.amazonaws.com
curl -XDELETE elastic1:9200/nuxeo-audit;curl -XDELETE elastic1:9200/nuxeo;curl -XDELETE elastic1:9200/nuxeo-uidgen
On Mongo:
service mongod stop && rm -rf /ssd1/mongodb/* && service mongod start
From the nuxeo host:
curl -XGET -vv -u Administrator:Administrator "http://127.0.0.1:8080/nuxeo/site/randomImporter/run?targetPath=/default-domain/workspaces&batchSize=30&nbThreads=20&interactive=false&nbNodes=1000000&fileSizeKB=0&bulkMode=true&onlyText=false&withProperties=true&blockAsyncProcessing=true&blockSyncPostCommitProcessing=true&lang=en_US"
This will stop (pause) all ec2 instances
ansible-playbook -vv stop.py
To restart ec2 instances that have been stopped with the previous stop operation:
ansible-playbook -vv start.py
Note that at the moment you may need to run multiple time the start playbook.
- Log into the grafana UI (admin/admin)
- Define a Data source named
graphitethat point tohttp://graphite/ - Upload the dashboard
ansible/roles/management/files/nst4a-grafana.jsonand use the ̀grahitedata source.
- provide more playbook: reset-data, restart nuxeo, import
- upload automatically the Grafana dashboard
- impl the prod profile with a Nuxeo cluster
- Use the nuxeo-importer-queue importer
Nuxeo dramatically improves how content-based applications are built, managed and deployed, making customers more agile, innovative and successful. Nuxeo provides a next generation, enterprise ready platform for building traditional and cutting-edge content oriented applications. Combining a powerful application development environment with SaaS-based tools and a modular architecture, the Nuxeo Platform and Products provide clear business value to some of the most recognizable brands including Verizon, Electronic Arts, Netflix, Sharp, FICO, the U.S. Navy, and Boeing. Nuxeo is headquartered in New York and Paris. More information is available at www.nuxeo.com.