MySQL: fresh startup script
[ root @ dbversity : /tmp ] cat mysql_fresh_start.sh service mysql stop & sleep 10; cd /var/lib/mysql rm -rf /var/lib/mysql/* mysql_install_db & sleep 10; chown mysql:mysql /var/lib/mysql/ -R echo -e “\n” service mysql start & sleep 5; echo -e “\n”…
[MongoDB]: How to configure & reconfigure a RS
[root@ip-10-0-0-28 /]# ps -ef | grep mongo root 7135 2216 0 01:26 pts/0 00:00:00 mongod –replSet rs2 –dbpath /root/data4 –logpath /root/data4/mongod1.log –port 27010 –smallfiles –nojournal root 7191 2216 0 01:26 pts/0 00:00:00 mongod –replSet rs2 –dbpath /root/data5 –logpath /root/data5/mongod2.log –port…
MySQL Fabric setup document
MySQL Fabric is a framework for managing groups of MySQL Servers and using those servers to provide services. It is designed to be extensible so that over time many different services can be added. In the current version the services…
[MongoDB]: Aggregation with date
When we need to count the number of subdocuments based on certain criteria, including a date field. Looking for options on how best to handle the date field for this requirement. Sample document: { “_id” : “FCa123”, “txnUidSid” : “123”,…
[MySQL]: Master-slave replication for a new-setup
Master: 1. Install MySQL as per the standard procedure 2. Edit my.cnf of Master server with below parameters server-id = 8 # Should be unique id between 2 and 2^32 – 1 log-bin = /home/mysql5/mysql-binlogs/’hostname’binlog # required for replication log-bin-index…
[MongoDB]: How to truncate/chop off time-stamp from Date
How to truncate/chop off time-stamp from Date > db.dbversity.find({},{tradeDate:1}) { “_id” : “1”, “tradeDate” : ISODate(“2015-06-25T18:30:00Z”) } { “_id” : “2”, “tradeDate” : ISODate(“2015-06-25T18:30:00Z”) } { “_id” : “3”, “tradeDate” : ISODate(“2015-06-24T18:30:00Z”) } { “_id” : “4”, “tradeDate” : ISODate(“2015-06-23T18:30:00Z”)…
[ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/host.frm’ (errno: 13)
[ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/host.frm’ (errno: 13) [ERROR] Fatal error: Can’t open and lock privilege tables: Can’t find file: ‘./mysql/host.frm’ (errno: 13) We usually see above errors while we’re trying to start an additional MySQL instances on the…
[MySQL]: How to start multiple instances on a single server
[ root @ dbversity : /tmp ] [ root @ dbversity : /tmp ] ll -lhtr MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar -rw-r–r– 1 sm70768 mongod 213M Jun 22 08:25 MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar [ root @ dbversity : /tmp ] [ root @ dbversity : /tmp…
[CouchBase] : How Wierd is MongoDB + WiredTiger?
How Wired is MongoDB + WiredTiger? MongoDB 3.0 is a major release with long awaited improvements. The most notable? The optional storage engine WiredTiger. After all, WiredTiger was founded by the people behind Berkeley DB. MongoDB claims WiredTiger write performance…
MongoDB WiredTiger
A Technical Introduction to WiredTiger Document-level Concurrency In-memory performance Multi-core scalability Checksums Compression Durability with & without journaling MongoDB 3.0 introduces a new pluggable storage engine API and a new storage engine called WiredTiger. The engineering team behind WiredTiger…