2

I need to integrate Elasticsearch to my website. I have installed elasticsearch in localhost XAMPP server. I am checking the static datas using http://localhost:9200. My data's are in mysql db. So i have installed river-jdbc in Elasticsearch/plugins folder perfectly. Following code is config.json file

 {  "type" : "jdbc",
    "jdbc" :{
        "strategy" : "oneshot",
        "driver" : "com.mysql.jdbc.Driver",
        "url" : "jdbc:mysql://localhost:9200/dbname",
        "user" : "root",
        "password" : "",
        "sql" : "select * from tablename",
        "poll" : "1h",
        "scale" : 0,
        "autocommit" : false,
        "fetchsize" : 100,
        "max_rows" : 0,
        "max_retries" : 3,
        "max_retries_wait" : "10s",
        "locale" : "it",
        "digesting" : true,
    },
}

updated the .json file using following code curl -XPUT http://127.0.0.1:9200/_river/jdbcriver/_meta" -d @config.json. It was created. Now i have a confusion to show the data's in my website. Here is the issues i am facing

  • Is the database is connected with the file? how can i pull the data's to my web

  • In PHP how can i retrieve the data and show in web page?

  • How can i configure the same in live domain?

skr07
  • 707
  • 1
  • 10
  • 36
  • 1
    Note that the port in your JDBC URL looks wrong, for mysql the standard port is 3306, 9200 is the ES HTTP port. – Val Sep 08 '15 at 07:13
  • @val okay i have changed the port number as 3306. Again i tried to update the code using `curl -XPUT http://127.0.0.1:3306/_r iver/jdbcriver/_meta" -d @config.json'.` but it thrown an error `5.6.1 [(TMg?Ez  ☻ ⌂ǧ Z2(s,!]2$XqR mysql_native_password ! ☺ ä♦#08S0 1Got packets out of order` – skr07 Sep 08 '15 at 09:05
  • 1
    You changed the wrong url, the one I'm talking about is the one in your config.json file (i.e. `jdbc.url`), not the ES one you use to install the config. – Val Sep 08 '15 at 09:12
  • okay i changed the `url` as `jdbc:mysql://localhost:3306/dbname`. and it was updated. then how can i view the results from the table – skr07 Sep 08 '15 at 09:29
  • @satheesh : i am stil facing issue with elasticsearch .. if you were able to sort out the issue , can you please guide me ? – Yaxita Shah Mar 22 '16 at 11:09

0 Answers0