Last active
January 19, 2018 06:46
-
-
Save binhqd/34c2d04f44b0934e4975255f59629bd9 to your computer and use it in GitHub Desktop.
Setup mongo to elasticsearch connector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install java-1.8.0-openjdk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install python-pip | |
pip install 'elastic2-doc-manager[elastic5]' | |
# install mongodb | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org | |
# update /etc/elasticsearch/elasticsearch.yml, action.auto_create_index: true | |
echo 'action.auto_create_index: true` > /etc/elasticsearch/elasticsearch.yml | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Bổ sung | |
replication: | |
replSetName: "repl-danangtrade" | |
#Restart lai mongo | |
service mongod restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initiate replication set | |
$ mongo | |
> rs.initiate() | |
# Connect mongo to elasticsearch | |
mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment