Repositry Creation on Windows

Hi,

I have installed ElasticSearch on my Windows machine. While creating a repository i pointed the location to my Windows location and executed the below command

PUT http://localhost:9200/_snapshot/backup
{
"type": "fs",
"settings": {
"location": "C:\Users\Downloads\elasticsearch-1.6.0\es_backup_folder"
}
}

i received the below error

{
"error": "ElasticsearchIllegalArgumentException[failed to parse repository source [{\n"type": "fs",\n"settings": {\n"location": "C:\Users\Downloads\elasticsearch-1.6.0\es_backup_folder"\n}\n}\n]]; nested: JsonParseException[Unrecognized character escape 'U' (code 85)\n at [Source: {\n"type": "fs",\n"settings": {\n"location": "C:\Users\Downloads\elasticsearch-1.6.0\es_backup_folder"\n}\n}\n; line: 4, column: 18]]; ",
"status": 400
}

Please advice how to create repository.

Thanks

Your JSON is not valid, you need to escape the backslashes.

{
    "type": "fs",
    "settings": {
        "location": "C:\\Users\\Downloads\\elasticsearch-1.6.0\\es_backup_folder"
    }
}

Hi Dan

I executed the code as shared above, but unlucky received error

{
"error": "RepositoryException[[backup] failed to create repository]; nested: CreationException[Guice creation errors:\r\n\r\n1) Error injecting constructor, org.elasticsearch.repositories.RepositoryException: [backup] location [C:\Users\Downloads\elasticsearch-1.6.0\es_backup_folder] doesn't match any of the locations specified by path.repo because this setting is empty\r\n at org.elasticsearch.repositories.fs.FsRepository.(Unknown Source)\r\n while locating org.elasticsearch.repositories.fs.FsRepository\r\n while locating org.elasticsearch.repositories.Repository\r\n\r\n1 error]; nested: RepositoryException[[backup] location [C:\Users\t.islam.siddiqui\Downloads\elasticsearch-1.6.0\es_backup_folder] doesn't match any of the locations specified by path.repo because this setting is empty]; ",
"status": 500
}

Did you set path.repo in elasticsearch.yml?

Hi Mark

i installed Elastisearch on Windows and unable to find elasticsearch.yml in it.

It'll be in the config directory in where ever you extracted the zip file.

Hi Mark

Please help to correct my entries

My code
.............

PUT http://localhost:9200/_snapshot/backup -d
{
"type": "fs",
"settings": {
"location": "C:\Users\\t.islam.siddiqui\Downloads\elasticsearch-1.6.0\es_backup_folder"
}
}

Entry in elasticsearch.yml
.......................................

path.data: C:\Users\Downloads\elasticsearch-1.6.0\es_backup_folder

Message Received
......................

{
"error": "ElasticsearchParseException[Failed to derive xcontent from PUT http://localhost:9200/_snapshot/backup -d \n{\n"type": "fs",\n"settings": {\n"location": "C:\\Users\\\t.islam.siddiqui\\Downloads\\elasticsearch-1.6.0\\es_backup_folder"\n}\n}\n]",
"status": 400
}