Comments (5)
Hi @y80x86ol, did you add the $myCert = 'path/to/cacert.pem';
line on that page for self-signed certificates? The default demo certificate that Open Distro for Elasticsearch uses is self-signed.
from for-elasticsearch-docs.
Hi @y80x86ol, did you add the
$myCert = 'path/to/cacert.pem';
line on that page for self-signed certificates? The default demo certificate that Open Distro for Elasticsearch uses is self-signed.
I add the cacert pem in my code, but still can't connection es.
ps: i used the Open Distro for Elasticsearch demo certificate
from for-elasticsearch-docs.
Hi @y80x86ol, I was able to get this working after some struggles. Can you try the following?
<?php
require 'vendor/autoload.php';
use Elasticsearch\ClientBuilder;
$hosts = ['https://admin:admin@localhost:9200'];
$myCert = '/full/path/to/root-ca.pem';
$client = ClientBuilder::create()
->setHosts($hosts)
->setSSLVerification($myCert)
->build();
$params = [
'index' => 'test-index',
'type' => '_doc',
'id' => '1',
'body' => ['testField' => 'abc']
];
$response = $client->index($params);
print_r($response);
?>
Then at the command line:
$ php -n -S 0.0.0.0:8000 index.php
And navigate to 0.0.0.0:8000
in your browser. Let me know. Thanks!
from for-elasticsearch-docs.
@aetter thank you for your reply!
I tried you code ,but still echo 'No alive nodes found in your cluster'.
I disabling SSL verification,it works!
code like this:
$hosts = ['https://admin:[email protected]:9210'];
$client = ClientBuilder::create()
->setHosts($hosts)
->setSSLVerification(false)
->build();
there are some same issues in other github:
elastic/elasticsearch-php#854
elastic/elasticsearch-php#850
from for-elasticsearch-docs.
Hi @y80x86ol, gotcha, I'm going to close this one out. Thanks!
from for-elasticsearch-docs.
Related Issues (20)
- 403 - Acess denied error while installing elasticsearch alerting plugin
- Should be POST request when searching with body?
- ODBC Driver 1.9.00
- Forward to OpenSearch? HOT 1
- Access rights to management page HOT 1
- PPL Command Doc Type
- Opensearch crashing on Macbook Pro M1 Max (Docker) HOT 3
- No handler for type [knn_vector]
- Update docs to reflect 1.13.3 HOT 4
- opendistro-for-elasticsearch-kibana version 1.13.3 HOT 1
- opendistroforelasticsearch yum repo not updated with 1.13.3 HOT 1
- mitigate vulnerability log4j
- Failing to use fetch_size parameter with query
- openid not working with opendistro kibana. As per steps which are provided by openditsro. kindly help us
- [Urgent] I can't make notebooks with recently created visualizations.
- mapped users option is missing
- alerting index permission
- Unable to use window functions in version 1.13.0
- OpenDistro Index Management
- opendistro-alerting-alert-history alerts disable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from for-elasticsearch-docs.