IndexMissingException [[wham] missing

View: http://127.0.0.1:9200/wham/_search
Gives me:

{
  "error": "IndexMissingException[[wham] missing]",
  "status": 404
}

I installed everything according to these docs:

The last one is most useful at the moment.
Which is sad, I used two different "installation" requests through curl to create my river:

curl -XPUT 'localhost:9200/_river/wham/_meta' -d '{
  "type": "jdbc",
  "jdbc": {
    "url": "jdbc:postgresql://localhost:5432/testdb",
    "user": "postgres",
    "password": "passywordu",
    "index": "source",
    "type": "wham",
    "sql": "select * from testtable;"
  }
}'

And then I tried this, this is a modified version of the last link above.

curl -XPUT 'localhost:9200/_river/wham/_meta' -d '{
  "type": "jdbc",
  "jdbc": {
    "strategy": "simple",
    "poll": "5s",
    "scale": 0,
    "autocommit": false,
    "fetchsize": 10,
    "max_rows": 0,
    "max_retries": 3,
    "max_retries_wait": "10s",
    "url": "jdbc:postgresql://localhost:5432/testdb",
    "user": "postgres",
    "password": "passywordu",
    "sql": "select * from testtable",
    "index": "wham"
  }
}'

, http://127.0.0.1:9200/_river/wham/_status :

{
  "_index": "_river",
  "_type": "wham",
  "_id": "_status",
  "_version": 4,
  "found": true,
  "_source": {
    "node": {
      "id": "v1DmcsEOSbKfEbjRdwLYOg",
      "name": "Miles Warren",
      "transport_address": "inet[/192.168.43.211:9300]"
    }
  }
}

, , , postgresql. :

su - postgres
initdb --locale en_US.UTF-8 -E UTF8 -D '/tmp/testdb'
postgres -D /tmp/testdb
createdb testdb
psql -d testdb

CREATE TABLE testtable (
    source      varchar(20) NOT NULL,
    destination varchar(20) NOT NULL,
    service     int, NOT NULL
);

INSERT INTO testtable VALUES('192.168.0.10', '192.168.0.1', 80)
INSERT INTO testtable VALUES('192.168.0.11', '192.168.0.2', 21)

, .
? elasticsearch /wham/_search SQL-?

+4
1

,

1)

  curl -XPUT 'localhost:9200/_river/wham/_meta' -d '{
        "type" : "jdbc",
        "jdbc" : {
            "url" : "jdbc:postgresql://localhost:5432/testdb",
            "user" : "postgres",
            "password" : "passywordu",
            "index" : "source",
            "type" : "wham",
            "sql" : "select * from testtable;"
        }
   }'

source. wham. curl. ,

    http://127.0.0.1:9200/source/wham/_search

"" "wham".

2)

curl -XPUT 'localhost:9200/_river/wham/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
    "strategy" : "simple",
    "poll" : "5s",
    "scale" : 0,
    "autocommit" : false,
    "fetchsize" : 10,
    "max_rows" : 0,
    "max_retries" : 3,
    "max_retries_wait" : "10s",
    "url" : "jdbc:postgresql://localhost:5432/testdb",
    "user" : "postgres",
    "password" : "passywordu",
    "sql" : "select * from testtable",
    "type": "typename", //add the type of documents to be indexed[like tables in RDBMS]
    "index" : "wham"
}
      }'

" wham". wham. curl. ,

    http://127.0.0.1:9200/wham/typename/_search [or]   
    http://127.0.0.1:9200/wham/_search

"wham" indextype "typename".

, curl.delete index_river try.If , ..!

, ..!

+5

Source: https://habr.com/ru/post/1532436/


All Articles