Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 5.83 KB | None | 0 0
  1. INSERT INTO `bolt_entries` (`id`, `slug`, `datecreated`, `datechanged`, `datepublish`, `username`, `status`, `title`, `image`, `teaser`, `video`, `body`, `kudos`, `test`)
  2. VALUES
  3.     (1, 'migrating-from-wordpress-to-bolt', '2012-11-19 00:31:01', '2012-11-21 21:43:51', '2012-11-19 00:10:00', 'niels', 'published', 'Migrating from WordPress to Bolt', '', '', 'Array', 'I\'ve been addicted to WordPress for now 4 years. Many of my personal and customers websites are based on WordPress (over 40 by now).\r\n\r\n__But …__\r\n\r\n<p>WordPress has come a long way since the first release. The simple blog tool has grown up into a full-featured CMS system and with that growth have come a number of drawbacks :</p>\r\n\r\n* __Security issues__ that are related to its popularity among developpers and users.\r\n* __Performance</strong> issues due to the number of features and a codebase that should be refactored on many levels.\r\n\r\nOk so when I wanted to bring up this new personal blog, I began to research a system that was simple & lightweight enough while letting me edit content quickly without a high learning curve.\r\n\r\nAs an active reader of [Hacker News](http://news.ycombinator.com/), I stumbled upon the great article about [Ghost - Rethinking WordPress](http://john.onolan.org/ghost/) by [Jon O\'Nolan](http://john.onolan.org/) and was impressed by his vision. What if a simple system blogging platform like this existed ?\r\n\r\n__I introduce you to [Bolt](http://bolt.cm).__\r\n\r\n![Bolt](/files/bolt.jpg).\r\n\r\n* Straightforward and intuitive interface\r\n* Full responsive backend\r\n* Custom post types right from the config file\r\n* Markdown editor\r\n* Twig themes\r\n* And, nonetheless, based on the micro-framework [Silex](http://silex.sensiolabs.org/) which is a lightweight fork of Symfony2.\r\n\r\nDon\'t hesitate to inspect this page and see how Bolt has rendered in no time (around 100ms) without any cache system enabled.\r\n\r\nCompatible with all major databases system and written in PHP, Bolt is a breeze to setup thanks to the dependency manager composer :\r\n\r\n<pre><code>git clone git://github.com/bobdenotter/bolt.git bolt\r\ncd bolt \r\ncurl -s http://getcomposer.org/installer | php\r\nphp composer.phar install</code></pre>\r\n\r\nTwo minutes later, you\'re ready to blog.\r\n\r\nEven if Bolt doesn\'t benefit of the large WordPress community building themes and plugins, the core team is building a wonderful gem that you can customize and setup in no time.\r\n\r\nAs a matter of fact, I needed to pull up a new theme for this site to run. Based on the Svbtle graphical interface, you can find this theme (work in progress) on [Github - bolt-svbtle](https://github.com/gmoigneu/bolt-svbtle).', 53.000000000, ''),
  4.     (2, 'setting-up-masterslave-mysql-replication', '2012-11-21 09:03:40', '2012-11-21 09:05:14', '2012-11-21 09:03:00', 'niels', 'published', 'Setting up Master/Slave MySQL replication', '', '', 'Array', '## Our setup\r\n\r\n* elrond : MySQL Master\r\n* arwen : MySQL Slave\r\n\r\n## 1. Configure your servers\r\n\r\nOn the master server, edit my.cnf to add these lines :\r\n\r\n<pre><code>server-id               = 1\r\nlog_bin                 = /home/log/mysql/mysql-bin.log\r\nexpire_logs_days        = 10\r\nmax_binlog_size         = 100M\r\n</code></pre>\r\n\r\nOn the slave server, edit my.cnf to add these lines :\r\n\r\n<pre><code>server-id               = 2\r\nlog_bin                 = /home/log/mysql/mysql-bin.log\r\nexpire_logs_days        = 10\r\nmax_binlog_size         = 100M\r\n</code></pre>\r\n\r\nThe <code>server-id</code> values should be unique on all connected servers.\r\n\r\nRestart both servers\r\n\r\n## 2. Copy your data\r\n\r\nLaunch your MySQL command-line and lock your tables :\r\n\r\n<pre><code>mysql> FLUSH TABLES WITH READ LOCK;</code></pre>\r\n\r\nStop your slave server:\r\n\r\n<pre><code>root@arwen: /etc/init.d/mysql stop</code></pre>\r\n\r\nCopy over your master data :\r\n\r\n<pre><code>root@elrond: scp -r /var/lib/mysql/dbname root@arwen:/var/lib/mysql/</code></pre>\r\n\r\nAnd binlogs : \r\n\r\n<pre><code>root@elrond: scp -r /home/log/mysql/ root@arwen:/home/log/mysql/</code></pre>\r\n\r\nwhere <code>dbname</code> is your database name.\r\n\r\nChange ownership of the newly created files :\r\n\r\n<pre><code>root@arwen: chown -R mysql:mysql /var/lib/mysql\r\nroot@arwen: chown -R mysql:mysql /home/log/mysql</code></pre>\r\n\r\n## 3. Activate the replication\r\n\r\nRestart your slave MySQL instance : \r\n\r\n<pre><code>root@arwen: /etc/init.d/mysql start</code></pre>\r\n\r\nOn your master MySQL instance, check the master status :\r\n\r\n<pre><code>mysql> SHOW MASTER STATUS;</code></pre>\r\n\r\nIt should return the log name and offset : \r\n\r\n<pre><code>mysql > SHOW MASTER STATUS;\r\n+---------------+----------+--------------+------------------+\r\n| File          | Position | Binlog_Do_DB | Binlog_Ignore_DB |\r\n+---------------+----------+--------------+------------------+\r\n| mysql-bin.008 | 3250     | dbname       | mysql            |\r\n+---------------+----------+--------------+------------------+\r\n1 row in set (0.06 sec)\r\n</code></pre>\r\n\r\nNow set the master info your slave instance :\r\n\r\n<pre><code>mysql> CHANGE MASTER TO\r\nMASTER_HOST=\'elrond\',\r\nMASTER_USER=\'arwen\',\r\nMASTER_PASSWORD=\'**************\',\r\nMASTER_LOG_FILE=\'mysql-bin.008\',\r\nMASTER_LOG_POS=3250;\r\n\r\nmysql> START SLAVE;\r\n</code></pre>\r\n\r\nJust reactivate your master write/read capabilities :\r\n\r\n<pre><code>mysql> UNLOCK TABLES;</code></pre>\r\n\r\n## 4. Monitor your replication\r\n\r\nYou can, at anytime, use slave and master status to check if everything going smooth :\r\n\r\nOn your master server :\r\n\r\n<pre><code>mysql> SHOW MASTER STATUS;</code></pre>\r\n\r\nOn your slave one :\r\n\r\n<pre><code>mysql> SHOW SLAVE STATUS;</code></pre>\r\n\r\nAnd you\'re now all set.', 27.000000000, '');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement