Archive

Posts Tagged ‘upgrade’

Ubuntu 18.04

I upgraded some of my machines to Ubuntu 18.04. It looks good and the installation went flawlessly. Here is a nice post with some post-installations tips: Things To Do After Installing Ubuntu 18.04 Bionic Beaver Linux.

I did the followings:

  • install Gnome Tweaks
  • place titlebar buttons to the left
  • Make workspaces static. Number of workspaces: 4.
  • Install the the Gnome shell extension TaskBar. With this I can see the running apps in a bottom panel.
  • Redefine the lock screen shortcut to Ctrl + Alt + L.
  • force Alt + TAB to switch only on current workspace (read more)
Categories: ubuntu Tags: , ,

DigitalOcean has new droplet plans

January 17, 2018 Leave a comment

DigitalOcean has some new droplet plans (more info here). The cheapest droplet was 5 USD, and you got 512 MB RAM and 20 GB SSD for this price. Now, for the same price you get 1 GB RAM and 25 GB SSD.

If you have a standard droplet, you can upgrade it for free. I did it today and it was just one click :) Of course, I made a snapshot first, but the upgrade went smoothly, so after some testing I removed the snapshot.

If you want to try DigitalOcean, here is my referral link: https://m.do.co/c/01da80980c60. If you sign up through this link, you also support me :)

Alternatives

Categories: linux Tags: ,

[mongo] Upgrade to version 3.6, 4.0, 4.2

January 1, 2018 1 comment

Problem
Under Manjaro, my MongoDB 3.4 was upgraded to version 3.6 and it stopped working. Great!

Solution
In the log file I found this error: “IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.

Visiting the link in the error message, it was suggested to execute a DB command in the mongo shell. But the Mongo server was not willing to start, thus I couldn’t connect to it with the Mongo shell!

So I downgraded to version 3.4 just to be able to start the Mongo shell and execute the command “db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )“. Now I upgraded MongoDB to version 3.6 and it started happily.

Update (20190911)
Today I wanted to update MongoDB 3.6 to MongoDB 4.2 under Manjaro. The package manager contained a binary package that I could install easily but when I started it, the shell was version 4.2 but the server was still version 3.6! A few hours later I figured out that the problem was caused by the old server (v3.6) that was still running when I updated MongoDB. So the winning strategy was the following:

  • Remove 4.2 and put back 3.6. Start the mongo shell to see that everything works.
  • Stop the mongo server: “systemctl stop mongodb“.
  • Update to version 4.0 (using a binary package), start the server (“systemctl start mongodb“) and launch the mongo shell to verify that everything is OK.
  • In the mongo shell issue the command “db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )“.
  • Now we can move on to version 4.2. Stop the mongo server: “systemctl stop mongodb“.
  • Update to version 4.2 (using a binary package), start the server and launch the mongo shell to verify that everything is OK.
  • In the mongo shell issue the command “db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )“.

When you start / stop the server with systemctl, you’ll have to wait a few seconds to see its effect. You can verify the status of the server with “systemctl status mongodb“. It’s highly recommended that you install a binary package. Installing from source takes several hours even on a decent machine.

List of installed mongo packages: “pacman -Q | grep mongo“. When you want to upgrade, it’ll show you what packages to remove.

Categories: linux, manjaro, mongodb Tags: , ,

MongoDB: upgrade to the WiredTiger storage engine

February 7, 2016 Leave a comment

Problem
I started to use the MongoDB 2.x series and since then I’ve upgraded to MongoDB 3.2. MongoDB 3.0 introduced pluggable storage engines. In 3.0 the default was MMAPv1 but in 3.2 the default became the WiredTiger storage engine that has some advantages: document level concurrency, compression on data and indexes, etc. So naively, I checked my configuration:

$ mongo
MongoDB shell version: 3.2.0
connecting to: test
> db.serverStatus().storageEngine
{ "name" : "mmapv1", "supportsCommittedReads" : false }

What???

Solution
Well, since I had some MMAPv1 databases when I upgraded MongoDB, it continued to use the old storage engine, so it’s understandable why I didn’t have WiredTiger. When I got over the shock, I decided to upgrade to the new engine. Here are the steps (under Manjaro):

Make a full backup of your databases:

$ mongodump --out <exportDirectory>

Stop the mongod process:

$ systemctl stop mongodb

Try to start the mongo shell with the command “mongo”. If it fails, then the server is correctly stopped.

Rename your database folder and create a new one. The “#” prompt means a root prompt.

# cd /var/lib
# mv mongodb mongodb.mmapv1
# mkdir mongodb
# chown mongodb mongodb
# chgrp daemon mongodb

Make a copy of your log file:

# cd /var/log/mongodb
# mv mongod.log mongod.log.mmapv1

Edit the config file /etc/mongodb.conf . I still had the old format (the new format uses YAML), but if it works then I don’t replace it yet. Add the following line to its end:

storageEngine=wiredTiger

Now restart the server:

$ systemctl start mongodb

And check if it uses the new engine:

$ mongo
MongoDB shell version: 3.2.0
connecting to: test
> db.serverStatus().storageEngine
{ "name" : "wiredTiger", "supportsCommittedReads" : true }

Great! Now restore the databases that we backed up in the first step.

$ mongorestore <exportDirectory>

It will take a while. Let’s do a final check. Print the stats of a collection (sample):

$ mongo
MongoDB shell version: 3.2.0
connecting to: test
> show dbs
mydb
> use mydb
switched to db mydb
> show collections
mycoll
> db.mycoll.stats()
{
        "ns" : "crunchbase.companies",
        "count" : 18801,
        "size" : 72236994,
        "avgObjSize" : 3842,
        "storageSize" : 36052992,
        "capped" : false,
        "wiredTiger" : {
                "metadata" : {
                        "formatVersion" : 1
                },
        ...

It’s in WiredTiger format. Awesome.

If you want, you can delete the folder /var/lib/mongodb.mmapv1 with the old databases. But first make sure that everything works as before the migration.

Links

Upgrade to Ubuntu 13.10

October 24, 2013 Leave a comment

Since last week I have upgraded 3 machines on Ubuntu 13.10. Everything went flawlessly. After restart I had the feeling that I still have the 13.04 :) So far this upgrade has been the easiest.

Well, on one machine the date and time indicator disappeared from the top panel, but a

killall unity-panel-service

solved the issue. (Tip from here.)

Update (20140228)
It is added to my jabbatron installer script under the main menu entry “(140) Ubuntu“.

Categories: ubuntu Tags: ,

Ubuntu 13.04

April 26, 2013 4 comments

So far I’ve upgraded two machines. I like the new Ubuntu (though it looks and feels like 12.10 :)) but the upgrade was not as smooth as before.

First, on my workplace machine the upgrade process stopped at 30% and the machine simply froze down. I could move the mouse but nothing else worked. Even the clock in the top right corner stopped. I gave it a try, restarted the machine and to my greatest surprise it came back alive and I even had a graphical interface. Wow! With my good_shape_safe.sh script (it’s the second one) I could continue the upgrade process and it finished in order. After a reboot I had a fully functional Ubuntu 13.04.

Second, my home desktop was upgraded without any freeze :) I brought home the update packages and thus the upgrade process finished in an hour. However, after reboot the X started in low resolution. When I launched “nvidia-settings“, it said that my Nvidia card was not enabled and I should re-generate the xorg.conf file. It told me how to do that so I copied/pasted that line to a terminal. After that I reinstalled the nvidia packages:

sudo apt-get --purge remove nvidia-*
sudo apt-get install nvidia-current nvidia-settings

After restarting the X (“sudo service lightdm restart“) the resolution was fine.

However, the torture was not over yet. The graphical interface (Unity) got messed up: the launcher didn’t appear; the Super key (Windows button) didn’t bring up the Dash; the top panel was covered by a Gnome2-ish panel, etc. Fortunately, I found a script that could reset my Unity: https://github.com/phanimahesh/unity-revamp. It worked perfectly and my Unity became usable again. With “ubuntu-tweak” I could fine-tune my new Ubuntu and now it looks like my 12.10 :)

Links

  • I read about the unity-reset script here
  • you can install ubuntu-tweak easily with my jabbatron installer script

Update (20130428)
This morning my Ubuntu got f* up completely. I was at the point that I reinstall the whole s* from scratch. Strangely, after some restarts it started to work OK. So, here is what happened.

First, after restart I got a blank screen. No X, nothing. I couldn’t even switch to console with Ctrl+Alt+F1. After a reset I got the graphical interface. But after a restart no X again. It was alternating… I edited the file “/etc/default/grub” and changed this line:

GRUB_CMDLINE_LINUX_DEFAULT="splash"

Now at least I could follow the bootup sequence and noticed that the boot stopped after mounting the swap partition. Following this post I could fix the swap partition. I am not 100% sure that it was the problem since I also installed a newer version of the nvidia driver.

Fixing the swap partition:

# run "sudo gparted" and figure out the partition of the swap
# for me it was /dev/sda2
sudo swapoff /dev/sda2
sudo mkswap /dev/sda2
sudo swapon /dev/sda2
sudo update-initramfs -u

Update the nvidia driver:

# previous version: 304.88
sudo apt-get --purge remove nvidia-*
sudo apt-get install nvidia-313 nvidia-settings-313

Now the blank screen problem was solved. However, I couldn’t stop the machine. It displayed “* Will now restart” but nothing happened. Again, I had to poke the “/etc/default/grub” file:

GRUB_CMDLINE_LINUX="reboot=b"

More info here. Now it seems OK. Damn, if I had known that I’d have so many problems, I wouldn’t have upgraded to 13.04…

Appendix
My “/etc/default/grub” file looks like this:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda1)"
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=7
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="splash"
GRUB_CMDLINE_LINUX="reboot=b"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
GRUB_GFXMODE=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

When you edit this config file, run the following command:

sudo update-grub2

Update (20130503)
My upgraded Ubuntu 13.04 continued to behave strangely. I got fed up with that and today I reinstalled it from scratch. Now it works correctly. Something must have happened to it during the upgrade…

Upgrade Ubuntu 8.04 LTS to 10.04 LTS

July 21, 2011 Leave a comment

I just figured out that you can upgrade an Ubuntu LTS to the next Ubuntu LTS release. This means that 8.04 can be upgraded directly to 10.04 for instance. There is no need to upgrade to 8.10, etc.

We have an old machine and I put Ubuntu 8.04 on it a long time ago. Since it reached its end of life in May 2011, I was glad to see that I could upgrade to 10.04 easily.

Troubleshooting
At the very end of the upgrade process I had a little problem: the updating stopped and a warning message notified me that the update process was not completed. It has already happened to me some times. At this point I opened a terminal and executed the good_shape_safe.sh script (use the *_safe.sh version). This script could correct the setup process and put my Ubuntu in a consistent state.

Categories: ubuntu Tags: , , , ,