2019-12-03
For the three TitanHouse environments: development, staging, and production.
chrome-extension://ffmkiejjmecolpfloofpjologoblkegm/elasticsearch-head/index.html
ssh-jump-box.pem
key file and move it to your home ssh folder ~/.ssh/
or other convenient place.sudo nano /etc/hosts
or use favorite text editor with admin privilege. At bottom or anywhere you like, add these two lines:
127.0.0.1 th_elastic_dev-qa.us-east-1.es.amazonaws.com
127.0.0.1 th_elastic_prod.us-east-1.es.amazonaws.com
nano ~/.ssh/config
or use favorite text editor. Add (and change ~/.ssh/
key file if needed):
Host estunnel_dev_qa
HostName jumpbox.titanhouseapp.net
User ec2-user
IdentityFile ~/.ssh/ssh-jump-box.pem
LocalForward 9201 vpc-dev-qa-elasticsearch-56-5woww2b5uknp7pvi6gqwuiohbu.us-east-1.es.amazonaws.com:443
Host estunnel_prod
HostName jumpbox.titanhouseapp.net
User ec2-user
IdentityFile ~/.ssh/ssh-jump-box.pem
LocalForward 9202 vpc-elastic-uat-o5sx4clul237c6at4r7k7g7o2m.us-east-1.es.amazonaws.com:443
ssh -N estunnel_dev_qa
(or) ssh -N estunnel_prod
~/.bash_profile
and add something like:
alias estunnel_dev_qa='ssh -N estunnel_dev_qa'
alias estunnel_prod='ssh -N estunnel_prod'
Then in Terminal run one or both: estunnel_dev_qa
(or) estunnel_prod
Make sure to use the right URL and port number for the intended environment.
staging (QA): https://th_elastic_dev-qa.us-east-1.es.amazonaws.com:9201/
ES Head should display dev-qa-elasticsearch-56
.
production: https://th_elastic_prod.us-east-1.es.amazonaws.com:9202/
ES Head should display elastic-uat
.
Control-C
to close tunnels.If you are working on a branch of the api, and require usage of the dev/qa elastic search. Then the following namespace needs to be included in the configuration for the driver to use the correct indices.
Under titanhouse-api
project packages/cp-api/src/config/local.example.js
and packages/search-api/src/config/local.example.js
there is an example elastic {}
config block, which should be taken and modified for CP-API
and SEARCH-API
.
elastic: {
apiVersion: '5.5',
keepAlive: true,
host: 'https://th_elastic_dev-qa.us-east-1.es.amazonaws.com:9201',
namespace: 'dev'
},
The End