jprante / elasticsearch-knapsack

Knapsack plugin is an import/export tool for Elasticsearch
Apache License 2.0
472 stars 77 forks source link

knapsack question #8

Closed jprante closed 10 years ago

jprante commented 11 years ago

I installed knapsack on elasticsearch v0.90.1 successfully.

I tried to export an index named g4 per the README instructions. My command and return value is as follows:

curl -XPOST "http://localhost:9200/g4/file/_export" {"error":"MapperParsingException[failed to parse, document is empty]","status":400}

As you can see the result was an error. Am I supposed to be using curl's -d option to pass in a JSON document, or should this have successfully exported?

thevaluecircle commented 11 years ago

I'm getting the same :( Did you manage to solve it? Thanks

clintonb commented 11 years ago

I am having the same issue on 0.90.5. I followed the example exactly:

[cblackburn@dev-search ~]$ curl -XPUT localhost:9200/test/test/1 -d '{"key":"value 1"}'
{"ok":true,"_index":"test","_type":"test","_id":"1","_version":1}

[cblackburn@dev-search ~]$ curl -XPUT localhost:9200/test/test/2 -d '{"key":"value 2"}'
{"ok":true,"_index":"test","_type":"test","_id":"2","_version":1}

[cblackburn@dev-search ~]$ curl -XPOST localhost:9200/test/test/_export
{"error":"MapperParsingException[failed to parse, document is empty]","status":400}
jprante commented 11 years ago

Just released 2.1.0 with a fix, can you check if the issue still persists?

clintonb commented 11 years ago

Upgrading did not work.

[cblackburn@dev-search ~]$ curl -v localhost:9200
* About to connect() to localhost port 9200 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9200 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:9200
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=UTF-8
< Access-Control-Allow-Origin: *
< Content-Length: 314
< Server: Jetty(8.1.4.v20120524)
< 
{
  "ok" : true,
  "status" : 200,
  "name" : "dev-search",
  "version" : {
    "number" : "0.90.5",
    "build_hash" : "c8714e8e0620b62638f660f6144831792b9dedee",
    "build_timestamp" : "2013-09-17T13:09:46Z",
    "build_snapshot" : false,
    "lucene_version" : "4.4"
  },
  "tagline" : "You Know, for Search"
* Connection #0 to host localhost left intact
}

[cblackburn@dev-search ~]$ curl -XDELETE localhost:9200/test
{"ok":true,"acknowledged":true}

[cblackburn@dev-search ~]$ curl -XPUT localhost:9200/test/test/1 -d '{"key":"value 1"}'
{"ok":true,"_index":"test","_type":"test","_id":"1","_version":1}

[cblackburn@dev-search ~]$ curl -XPUT localhost:9200/test/test/2 -d '{"key":"value 2"}'
{"ok":true,"_index":"test","_type":"test","_id":"2","_version":1}

[cblackburn@dev-search ~]$ curl -XPOST localhost:9200/test/_export
{"error":"InvalidTypeNameException[mapping type name [_export] can't start with '_']","status":400}

[cblackburn@dev-search ~]$ curl -XPOST localhost:9200/_export
{"error":"InvalidIndexNameException[[_export] Invalid index name [_export], must not start with '_']","status":400}

I should also note that knapsack does not appear in the list of installed plugins:

{
  "ok" : true,
  "cluster_name" : "data_search_dev",
  "nodes" : {
    "E33RMmMsTf-LHIEwKLCg1Q" : {
      "name" : "dev-search",
      "transport_address" : "inet[/10.10.3.174:9300]",
      "version" : "0.90.5",
      "http_address" : "inet[/10.10.3.174:9200]",
      "attributes" : {
        "aws_availability_zone" : "us-east-1a",
        "master" : "true"
      },
      "plugins" : [ {
        "name" : "lang-python",
        "description" : "Python plugin allowing to add javascript scripting support",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "cloud-aws",
        "description" : "Cloud AWS Plugin",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "jetty",
        "description" : "Jetty Plugin Version: 0.0.0 (2013-10-04T20:54:01)",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "head",
        "description" : "No description found for head.",
        "url" : "/_plugin/head/",
        "jvm" : false,
        "site" : true
      }, {
        "name" : "bigdesk",
        "description" : "No description found for bigdesk.",
        "url" : "/_plugin/bigdesk/",
        "jvm" : false,
        "site" : true
      } ]
    },
    "lhqB0jXZSSiiq3lTo82wjA" : {
      "name" : "dev-web-api",
      "transport_address" : "inet[/10.10.3.225:9300]",
      "hostname" : "dev-web-api.kyruus.com",
      "version" : "0.90.5",
      "http_address" : "inet[/10.10.3.225:9200]",
      "attributes" : {
        "aws_availability_zone" : "us-east-1a",
        "data" : "false",
        "master" : "false"
      },
      "plugins" : [ {
        "name" : "lang-python",
        "description" : "Python plugin allowing to add javascript scripting support",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "cloud-aws",
        "description" : "Cloud AWS Plugin",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "jetty",
        "description" : "Jetty Plugin Version: 0.0.0 (2013-10-06T02:30:01)",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "head",
        "description" : "No description found for head.",
        "url" : "/_plugin/head/",
        "jvm" : false,
        "site" : true
      } ]
    }
  }
}
jprante commented 11 years ago

Not sure what commands you issued. To install, use the documented command

 ./bin/plugin -remove knapsack
./bin/plugin -url http://bit.ly/17GFBnY -install knapsack
-> Installing knapsack...
Trying http://bit.ly/17GFBnY...
Downloading     ...............................................................................................................................................................................................................................................................................................................................................................................DONE
Installed knapsack into /Users/es/elasticsearch-0.90.5/plugins/knapsack
clintonb commented 11 years ago

I am installing with the commands provided in the README.

[cblackburn@dev-search elasticsearch]$ pwd
/usr/share/elasticsearch

[cblackburn@dev-search elasticsearch]$ sudo ./bin/plugin -url http://bit.ly/17GFBnY -install knapsack
-> Installing knapsack...
Trying http://bit.ly/17GFBnY...
Downloading ...................................................................DONE
Installed knapsack into /usr/share/elasticsearch/plugins/knapsack

[cblackburn@dev-search elasticsearch]$ curl -XDELETE localhost:9200/test
{"error":"IndexMissingException[[test] missing]","status":404}

[cblackburn@dev-search elasticsearch]$ curl -XPUT localhost:9200/test/test/1 -d '{"key":"value 1"}'
{"ok":true,"_index":"test","_type":"test","_id":"1","_version":1}

[cblackburn@dev-search elasticsearch]$ curl -XPUT localhost:9200/test/test/2 -d '{"key":"value 2"}'
{"ok":true,"_index":"test","_type":"test","_id":"2","_version":1}

[cblackburn@dev-search elasticsearch]$ curl -XPOST localhost:9200/test/_export
{"error":"InvalidTypeNameException[mapping type name [_export] can't start with '_']","status":400}

[cblackburn@dev-search elasticsearch]$ curl -v -G -d "pretty=true&plugin=true" localhost:9200/_cluster/nodes
* About to connect() to localhost port 9200 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9200 (#0)
> GET /_cluster/nodes?pretty=true&plugin=true HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:9200
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=UTF-8
< Access-Control-Allow-Origin: *
< Content-Length: 2258
< Server: Jetty(8.1.4.v20120524)
< 
{
  "ok" : true,
  "cluster_name" : "data_search_dev",
  "nodes" : {
    "E33RMmMsTf-LHIEwKLCg1Q" : {
      "name" : "dev-search",
      "transport_address" : "inet[/10.10.3.174:9300]",
      "version" : "0.90.5",
      "http_address" : "inet[/10.10.3.174:9200]",
      "attributes" : {
        "aws_availability_zone" : "us-east-1a",
        "master" : "true"
      },
      "plugins" : [ {
        "name" : "lang-python",
        "description" : "Python plugin allowing to add javascript scripting support",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "cloud-aws",
        "description" : "Cloud AWS Plugin",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "jetty",
        "description" : "Jetty Plugin Version: 0.0.0 (2013-10-04T20:54:01)",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "head",
        "description" : "No description found for head.",
        "url" : "/_plugin/head/",
        "jvm" : false,
        "site" : true
      }, {
        "name" : "bigdesk",
        "description" : "No description found for bigdesk.",
        "url" : "/_plugin/bigdesk/",
        "jvm" : false,
        "site" : true
      } ]
    },
    "lhqB0jXZSSiiq3lTo82wjA" : {
      "name" : "dev-web-api",
      "transport_address" : "inet[/10.10.3.225:9300]",
      "hostname" : "dev-web-api.kyruus.com",
      "version" : "0.90.5",
      "http_address" : "inet[/10.10.3.225:9200]",
      "attributes" : {
        "aws_availability_zone" : "us-east-1a",
        "data" : "false",
        "master" : "false"
      },
      "plugins" : [ {
        "name" : "lang-python",
        "description" : "Python plugin allowing to add javascript scripting support",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "cloud-aws",
        "description" : "Cloud AWS Plugin",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "jetty",
        "description" : "Jetty Plugin Version: 0.0.0 (2013-10-06T02:30:01)",
        "jvm" : true,
        "site" : false
      }, {
        "name" : "head",
        "description" : "No description found for head.",
        "url" : "/_plugin/head/",
        "jvm" : false,
        "site" : true
      } ]
    }
  }
* Connection #0 to host localhost left intact
jprante commented 11 years ago

Did you restart the node? Each plugin install needs a restart.

clintonb commented 11 years ago

Yes, I tried restarting. No change.

clintonb commented 10 years ago

I was able to resolve this issue. It turned out my heap size settings were wrong, leading to the plugin not being loaded.