From 7a494f26dee63a1ccffd02338305d391fd344a3c Mon Sep 17 00:00:00 2001 From: tohsa <38312328+tohsa@users.noreply.github.com> Date: Mon, 23 Apr 2018 00:27:09 -0700 Subject: [PATCH] Small changes to README.MD and .gitignore (#476) * added es_sync_config.json and minified js to .gitignore * reordered README.md to reflect that MySQL Binlogging must be enabled before running import_to_es.py --- .gitignore | 5 +++++ README.md | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 3e7e4a4..4fe76c2 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,12 @@ __pycache__ # Application /install/* /config.py +/es_sync_config.json /test_torrent_batch +# Build Output +nyaa/static/js/bootstrap-select.min.js +nyaa/static/js/main.min.js + # Other *.swp diff --git a/README.md b/README.md index 93a4440..ffcbeca 100644 --- a/README.md +++ b/README.md @@ -77,18 +77,6 @@ Continue below to learn about database migrations and enabling the advanced sear - Run `curl -XGET 'localhost:9200'` and make sure ES is running - Optional: install [Kibana](https://www.elastic.co/products/kibana) as a search debug frontend for ES -### Setting up ES -- Run `./create_es.sh` to create the indices for the torrents: `nyaa` and `sukebei` - - The output should show `acknowledged: true` twice -- Stop the Nyaa app if you haven't already -- Run `python import_to_es.py` to import all the torrents (on nyaa and sukebei) into the ES indices. - - This may take some time to run if you have plenty of torrents in your database. - -Enable the `USE_ELASTIC_SEARCH` flag in `config.py` and (re)start the application. -Elasticsearch should now be functional! The ES indices won't be updated "live" with the current setup, continue below for instructions on how to hook Elasticsearch up to MySQL binlog. - -However, take note that binglog is not necessary for simple ES testing and development; you can simply run `import_to_es.py` from time to time to reindex all the torrents. - ### Enabling MySQL Binlogging - Edit your MariaDB/MySQL server configuration and add the following under `[mariadb]`: ``` @@ -103,6 +91,18 @@ However, take note that binglog is not necessary for simple ES testing and devel - Verify that the result of `SHOW VARIABLES LIKE 'binlog_format';` is `ROW` - Execute `GRANT REPLICATION SLAVE ON *.* TO 'username'@'localhost';` to allow your configured user access to the binlog +### Setting up ES +- Run `./create_es.sh` to create the indices for the torrents: `nyaa` and `sukebei` + - The output should show `acknowledged: true` twice +- Stop the Nyaa app if you haven't already +- Run `python import_to_es.py` to import all the torrents (on nyaa and sukebei) into the ES indices. + - This may take some time to run if you have plenty of torrents in your database. + +Enable the `USE_ELASTIC_SEARCH` flag in `config.py` and (re)start the application. +Elasticsearch should now be functional! The ES indices won't be updated "live" with the current setup, continue below for instructions on how to hook Elasticsearch up to MySQL binlog. + +However, take note that binglog is not necessary for simple ES testing and development; you can simply run `import_to_es.py` from time to time to reindex all the torrents. + ### Setting up sync_es.py `sync_es.py` keeps the Elasticsearch indices updated by reading the binlog and pushing the changes to the ES indices.