title: Elasticsearch:MySQL Error index_not_found_exception
body: <p>My objective is to extract data from MySQL database using elasticsearch on Centos7.</p>
  
  <p>I followed this link:<a href="https://stackoverflow.com/questions/36152152/elasticsearch-how-to-integrate-with-mysql">ElasticSearch how to integrate with Mysql</a>.</p>
  
  <ul>
  <li>Database named ElasticSearchDatabase created <br>
  
  <ul>
  <li>"test" the table name</li>
  </ul></li>
  <li>Java 8 is installed. <br></li>
  <li>Elasticsearch 6.2.4 is installed.<br></li>
  <li>Elasticsearch-jdbc-2.3.4.1-dist.zip is unzipped under /etc/elasticsearch</li>
  <li>"logs" folder is created under /etc/elasticsearch</li>
  </ul>
  
  <p>I got this result when I have executing : </p>
  
  <blockquote>
    <p>curl -XGET '<a href="http://localhost:9200/?pretty" rel="nofollow noreferrer">http://localhost:9200/?pretty</a>'</p>
  </blockquote>
  
  <pre><code>{
    "name" : "vps.server.com",
    "cluster_name" : "my-application",
    "cluster_uuid" : "ICqEEr1VQHK8mZ82x7J_YQ",
    "version" : {
      "number" : "6.2.4",
      "build_hash" : "ccec39f",
      "build_date" : "2018-04-12T20:37:28.497551Z",
      "build_snapshot" : false,
      "lucene_version" : "7.2.1",
      "minimum_wire_compatibility_version" : "5.6.0",
      "minimum_index_compatibility_version" : "5.0.0"
    },
    "tagline" : "You Know, for Search"
  </code></pre>
  
  <p>Then I have putted :</p>
  
  <pre><code>echo '{                                               
  "type":"jdbc",
  "jdbc":{
  
  "url":"jdbc:mysql://localhost:3306/ElasticSearchDatabase",
  "user":"root",
  "password":"root",
  "sql":"SELECT id as _id, id, name,email FROM test",
  "index":"users",
  "type":"users",
  "autocommit":"true",
  "metrics": {
              "enabled" : true
          },
          "elasticsearch" : {
               "cluster" : "my-application",
               "host" : "localhost",
               "port" : 9300 
          } 
  }
  }' | java -cp "/etc/elasticsearch/elasticsearch-jdbc-2.3.4.1/lib/*" - 
   "Dlog4j.configurationFile=file:////etc/elasticsearch/elasticsearch-jdbc- 
    2.3.4.1/bin/log4j2.xml" "org.xbib.tools.Runner" 
   "org.xbib.tools.JDBCImporter"
  </code></pre>
  
  <p>To get the result that I want I have executed this cmd:</p>
  
  <blockquote>
    <p>curl -XGET <a href="http://localhost:9200/users/_search/?pretty" rel="nofollow noreferrer">http://localhost:9200/users/_search/?pretty</a></p>
  </blockquote>
  
  <p>This is the result that I have got:</p>
  
  <pre><code>{
    "error" : {
      "root_cause" : [
        {
          "type" : "index_not_found_exception",
          "reason" : "no such index",
          "resource.type" : "index_or_alias",
          "resource.id" : "users",
          "index_uuid" : "_na_",
          "index" : "users"
        }
      ],
      "type" : "index_not_found_exception",
      "reason" : "no such index",
      "resource.type" : "index_or_alias",
      "resource.id" : "users",
      "index_uuid" : "_na_",
      "index" : "users"
    },
    "status" : 404
  }
  </code></pre>
  
  <p>Any one have an idea about this error.
  Thank you for your help.</p>