-
Notifications
You must be signed in to change notification settings - Fork 102
Troubleshooting Opensearch and Quepid
The traditional way to connect Quepid to Opensearch is to configure Opensearch to accept requests from the browser and is documented below.
You will need to configure Opensearch to accept requests from the browser using CORS. To enable CORS, the following config is available in the opensearch-compose.yml file in the environment section. It can be configured as desired.
- http.cors.enabled=true
- "http.cors.allow-origin=/https?:\/\/localhost(:[0-9]+)?/"
If you are using Basic Authentication, ie a URL in the format of [http|https]://[username:password@][host][:port]/[collectionName]/_search
then you will need to add:
- http.cors.enabled=true
- http.cors.allow-credentials=true
- "http.cors.allow-origin=/https?:\/\/localhost(:9200)?/"
- "http.cors.allow-headers=X-Requested-With, Content-Type, Content-Length,if-modified-since,Authorization"
The last two lines allow for the authentication to happen via headers, which is the way Opensearch likes it. Notice the allow-origin
is set up to only allow access from localhost port 9200. If you don't care, just use "*".
Encountered a locked down Opensearch cluster? For example, using AWS Opensearch that has a private subnet?
One option is to use a local ssh port forward into the cluster that forwards requests to your local http://localhost:9200/<index>/_search
, and use that URL in Quepid.
ssh -i ~/.ssh/<gateway-machine-security-file>.pem -L9200:<es-cluster-ip>:443 ec2-user@<gateway-machine>
The -L
parameter is critical, the -i
is machine-dependent.
We now have a setup of Opensearch deployed with the TMDB dataset using some basic aut.
-
https://reader:reader@quepid-opensearch.dev.o19s.com:9200/tmdb/_search
is Opensearch v1.2.4