???????????MongoDB?
???????????? ???????[ 2016/3/7 11:11:48 ] ???????????????????
???????????????Mongodb??replica set????????????????????????????????????????????????????????????????????keepalived??????????????????down???????????????vip?????????????mongodb down???????????keepavlied?????????????????????vip??
????1. MongoDB?????????
????????????????????????????????????????
????1.1. ??????1???????????
????/usr/local/mongodb/bin/mongod --dbpath=/var/mongodb/data --logpath=/var/mongodb/logs/log.log --master --slave --source 192.168.1.19 --logappend --port=27017 --fork
????1.2. ??????2 ???????????
????/usr/local/mongodb/bin/mongod --dbpath=/var/mongodb/data --logpath=/var/mongodb/logs/log.log --master --slave --source 192.168.1.17 --logappend --port=27017 --fork
????1.3. ???????????
???????????????????д????????????????????????????????
????????mongodb:/usr/local/mongodb/bin/mongo
????????????show dbs;
??????????????????test????????????
????db.test.save({"name":"zhouxiaofei"??"position":"Web tester"});
?????????????????test???д?????????????????????????????????????????
????db.test.find();
????1.4. Keepalived????
????1.4.1. ??????1keepalived????
! Configuration File for keepalived
global_defs {
notification_email {
master@extmail.org
}
notification_email_from yunlei_ma@extmail.org
smtp_server mail.extmail.org
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_script chk_mongodb {
script "/etc/keepalived/mongodb_check.sh"
interval 2
weight 2
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 150
nopreempt
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
track_script {
chk_mongodb
}
virtual_ipaddress {
192.168.1.18
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11