{"action":"created","issue":{"url":"https://api.github.com/repos/yasp-dota/yasp/issues/516","labels_url":"https://api.github.com/repos/yasp-dota/yasp/issues/516/labels{/name}","comments_url":"https://api.github.com/repos/yasp-dota/yasp/issues/516/comments","events_url":"https://api.github.com/repos/yasp-dota/yasp/issues/516/events","html_url":"https://github.com/yasp-dota/yasp/issues/516","id":94276399,"number":516,"title":"mongodb 3/wiredtiger/disk upgrade","user":{"login":"howardc93","id":3134520,"avatar_url":"https://avatars.githubusercontent.com/u/3134520?v=3","gravatar_id":"","url":"https://api.github.com/users/howardc93","html_url":"https://github.com/howardc93","followers_url":"https://api.github.com/users/howardc93/followers","following_url":"https://api.github.com/users/howardc93/following{/other_user}","gists_url":"https://api.github.com/users/howardc93/gists{/gist_id}","starred_url":"https://api.github.com/users/howardc93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howardc93/subscriptions","organizations_url":"https://api.github.com/users/howardc93/orgs","repos_url":"https://api.github.com/users/howardc93/repos","events_url":"https://api.github.com/users/howardc93/events{/privacy}","received_events_url":"https://api.github.com/users/howardc93/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"albertcui","id":3838552,"avatar_url":"https://avatars.githubusercontent.com/u/3838552?v=3","gravatar_id":"","url":"https://api.github.com/users/albertcui","html_url":"https://github.com/albertcui","followers_url":"https://api.github.com/users/albertcui/followers","following_url":"https://api.github.com/users/albertcui/following{/other_user}","gists_url":"https://api.github.com/users/albertcui/gists{/gist_id}","starred_url":"https://api.github.com/users/albertcui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertcui/subscriptions","organizations_url":"https://api.github.com/users/albertcui/orgs","repos_url":"https://api.github.com/users/albertcui/repos","events_url":"https://api.github.com/users/albertcui/events{/privacy}","received_events_url":"https://api.github.com/users/albertcui/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-07-10T10:24:40Z","updated_at":"2015-07-21T11:05:24Z","closed_at":"2015-07-21T11:05:02Z","body":"Might give us a free performance boost, but would require some downtime.\r\n\r\nWe can possibly get away with not increasing disk size if we dump the collections one-by-one and compress them.\r\n\r\nShould probably practice on a VM/devbox a few times to make we don't screw it up :)\r\n\r\nhttp://docs.mongodb.org/manual/release-notes/3.0-upgrade/\r\n\r\n- [x] set up maintenance page\r\n- [x] stop yasp-core\r\n- [x] stop GCE\r\n- [x] snapshot once for backup\r\n- [x] create new disk from snapshot\r\n- [x] attach disk to GCE and restart\r\n- [x] stop yasp-core again\r\n- [x] Delete log files /var/log/foreman and /var/log/mongodb to make some more space.\r\n\r\n- [x] Do the upgrade\r\n ```\r\nsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10\r\necho \"deb http://repo.mongodb.org/apt/ubuntu \"$(lsb_release -sc)\"/mongodb-org/3.0 multiverse\" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list\r\nsudo apt-get update\r\nsudo apt-get install -y mongodb-org\r\nsudo rm /var/lib/mongodb/test*\r\nsudo service mongod restart\r\n#check to make sure mongodb3 is running\r\n\r\nmongodump \r\nOR\r\nmongodump --db dota --collection matches --out - | gzip > matches.gz\r\nmongodump --db dota --collection players --out - | gzip > players.gz\r\n\r\nsudo service mongod stop\r\n\r\n#clear the old data\r\nsudo rm /var/lib/mongodb/*\r\n\r\nedit /etc/mongod.conf: \r\nstorageEngine=wiredTiger\r\n\r\nsudo service mongod restart\r\n\r\nmongorestore\r\nOR\r\ngzip -dc matches.gz | mongorestore --dir - --collection matches --db dota\r\ngzip -dc players.gz | mongorestore --dir - --collection players --db dota\r\n\r\nrm -rf dump\r\nOR\r\nrm *.gz\r\n```\r\n- [x] remove maintenance page ` cd /etc/nginx/sites-enabled && rm default && ln -s ../sites-available/yasp yasp && sudo service nginx restart`\r\n- [x] `git pull origin master && npm run build && sudo npm run yasp-core`\r\n- [x] start yasp-core `sudo start foreman`\r\n- [ ] delete snapshot"},"comment":{"url":"https://api.github.com/repos/yasp-dota/yasp/issues/comments/123263349","html_url":"https://github.com/yasp-dota/yasp/issues/516#issuecomment-123263349","issue_url":"https://api.github.com/repos/yasp-dota/yasp/issues/516","id":123263349,"user":{"login":"howardc93","id":3134520,"avatar_url":"https://avatars.githubusercontent.com/u/3134520?v=3","gravatar_id":"","url":"https://api.github.com/users/howardc93","html_url":"https://github.com/howardc93","followers_url":"https://api.github.com/users/howardc93/followers","following_url":"https://api.github.com/users/howardc93/following{/other_user}","gists_url":"https://api.github.com/users/howardc93/gists{/gist_id}","starred_url":"https://api.github.com/users/howardc93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howardc93/subscriptions","organizations_url":"https://api.github.com/users/howardc93/orgs","repos_url":"https://api.github.com/users/howardc93/repos","events_url":"https://api.github.com/users/howardc93/events{/privacy}","received_events_url":"https://api.github.com/users/howardc93/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T11:05:24Z","updated_at":"2015-07-21T11:05:24Z","body":"delete the snapshot when we're reasonably confident the data is migrated properly"}}