пятница, 13 июля 2012 г.

Moving Mysql database folder to mounted disk

Use the instructions bellow: http://article.my-addr.com/?show=how_to_move_the_mysql_data_directory-ubuntu_change_datadir_issue


How to move the mysql data directory in ubuntu

  • Open the terminal
  • Stop MySQL with the command
    /etc/init.d/mysql stop
  • Copy the existing data directory (which is located in /var/lib/mysql) using the command
    cp -R -p /var/lib/mysql /usr/new_datadir
  • All you need are the data files. Delete the others with the command
    rm /usr/new_datadir

    (You will get a message about not being able to delete some directories, but do not care about them)
  • Edit the MySQL configuration file with the command
    vim /etc/mysql/my.cnf
  • Find the entry for datadir, change the path to the new data directory.
  • But there is a trick involved here. Ubuntu uses some security software called AppArmor that specifies the areas of your filesystem applications are allowed to access. Unless you modify the AppArmor profile for MySQL, you'll never be able to restart MySQL with the new datadir location.
  • In the terminal, enter the command
    vim /etc/apparmor.d/usr.sbin.mysqld
  • Copy the lines beginning with /var/lib/mysql
  • Comment out the originals with hash marks (#),(in my way I just added new lines NOT COMMENT) and paste the lines below the originals.
  • Now change /var/lib/mysql in the two new lines with /usr/new_datadir. Save and close the file.
  • Restart the AppArmor profiles with the command
    /etc/init.d/apparmor restart
  • Restart MySQL with the command
    /etc/init.d/mysql restart
  • MySQL should now start without any errors and your data will be stored in the new location. See also article Linux Ubuntu move mysql database to other path in 5 minutes


четверг, 12 июля 2012 г.

Install Jungledisk on the ubuntu

1. Download server and management files from https://www.jungledisk.com/downloads/business/server/linux/.


To check bit version of your system:


uname -a
Result for 32-bit Ubuntu:
Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686i386 GNU/Linux
whereas the 64-bit Ubuntu will show:
Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux



I prefer .deb for my 64-bit Ubuntu


wget https://downloads.jungledisk.com/jungledisk/junglediskserver_316-0_amd64.deb
wget https://downloads.jungledisk.com/jungledisk/junglediskservermanagement_316-0_amd64.deb


2. Install management first and then server deb:
sudo dpkg -i package_file.deb
or to delete
sudo dpkg -r package_file.deb
to see the list of deb packages:
dpkg --get-selections 


So I done:
sudo dpkg -i junglediskservermanagement_316-0_amd64.deb
sudo dpkg -i junglediskserver_316-0_amd64.deb


3. Then you need to set up licence key:
cp /usr/local/share/junglediskserver/junglediskserver-license-EXAMPLE.xml  /etc/jungledisk/junglediskserver-license.xml
And set up license key in the junglediskserver-license.xml file.


4. Restart the service:
sudo service junglediskserver restart


!!!







Set up couchdb on the Ubuntu server

upd: 1.6.1 for ubuntu 14.04 https://github.com/pixelpark/ppnet/wiki/Install-CouchDB-1.6.1-on-Ubuntu-14.04

UPD: 2 Logrotation: https://www.digitalocean.com/community/tutorials/how-to-manage-log-files-with-logrotate-on-ubuntu-12-10


New way:
http://onabai.wordpress.com/2012/05/10/installing-couchdb-1-2-in-ubuntu-12-04/
https://gist.github.com/jsdavo/3054201

old way(not good at all)
The better way to install couchdb 1.2 on the ubuntu:
https://github.com/iriscouch/build-couchdb

Tunning:

1. Set bind_address to 0.0.0.0 to allow couchdb from outside.
2. Set delayed_commits to false

Don't forget to configure logging!


-Setup log rotate:
First off, a lot of people run CouchDB from source which means that in 99% of all installs, the log rotation is not activated.
To fix this (on Ubuntu/Debian), do the following:
sudo ln -s /usr/local/etc/logrotate.d/couchdb /etc/logrotate.d/couchdb
- Don't forget to change the path to match your installation.

Example:

/usr/local/var/log/couchdb/*.log {
       weekly
       rotate 10
       copytruncate
       delaycompress
       compress
       notifempty
       missingok
}

UPDATE... remembered... it's
Code:
sudo logrotate -f /etc/logrotate.conf