Add autorestart for Ubuntu 7.04

This commit is contained in:
ihakes 2007-08-23 01:23:07 +00:00
parent afb4e0f776
commit 65083ac18c
1 changed files with 192 additions and 89 deletions

View File

@ -25,6 +25,13 @@
<revremark>Complete revision of document to cover DB2 Express-C 9 and new
Linux distrubution levels</revremark>
</revision>
<revision>
<revnumber>2.0.1</revnumber>
<date>2007-08-22</date>
<authorinitials>idmh</authorinitials>
<revremark>Minor update to include instance restart instructions for
Ubuntu 7.04</revremark>
</revision>
</revhistory>
<abstract>
<para>This HOWTO is intended for anyone interested in installing and
@ -1641,21 +1648,34 @@ libstdc++6-4.1.1-3mdk</screen>
use the Synaptic package installer, and almost everything is done for you,
from downloading to installation and configuration. Here's how to do it:
<orderedlist>
<listitem>Under the <command>Applications</command> menu on the Ubuntu
menu bar, choose <command>Add/Remove</command>.</listitem>
<listitem>Once the Synaptic package manager application has started up,
click the <command>Show commercial applications</command> checkbox.
<listitem>
<para>Under the <command>Applications</command> menu on the Ubuntu
menu bar, choose <command>Add/Remove</command>.
</para>
</listitem>
<listitem>In the <command>Search</command> bar, type "DB2" and hit the Enter key.
<listitem>
<para>Once the Synaptic package manager application has started up,
click the <command>Show commercial applications</command> checkbox.</para>
</listitem>
<listitem>DB2 Express should show up as the only result. If you don't see
it, make sure that Synaptic is displaying <command>All
Applications</command> or <command>Third party applications</command>.
<listitem>
<para>In the <command>Search</command> bar, type "DB2" and hit the Enter
key.</para>
</listitem>
<listitem>Enable the <command>dapper-commercial</command> channel if
requested by clicking the "<command>Enable channel</command>" button.
<listitem>
<para>DB2 Express should show up as the only result. If you don't see
it, make sure that Synaptic is displaying <command>All
Applications</command> or <command>Third party applications</command>.
</para>
</listitem>
<listitem>
<para>Enable the <command>dapper-commercial</command> channel if
requested by clicking the "<command>Enable channel</command>" button.
</para>
</listitem>
<listitem>
<para>Click "<command>Apply</command>".
</para>
</listitem>
<listitem>Click "<command>Apply</command>".</listitem>
</orderedlist>
After hitting the "<command>Apply</command>" button, Synaptic will
download the DB2 Express-C package, along with a few dependent libraries,
@ -1669,23 +1689,24 @@ libstdc++6-4.1.1-3mdk</screen>
<para>After installation by Synaptic, there are a few steps required to get
DB2 up and running smoothly.
<orderedlist>
<listitem>Usable passwords for the DB2 default accounts. To actually log
in or connect to the DB2 databases and servers using the default DB2 users
(db2inst1, db2fenc1, and dasusr1), you need to modify the initial
passwords. To do this, open a terminal (as the regular user), and type
<command>sudo su -</command> to get root access. Then run these three
commands:
<listitem>
<para>Usable passwords for the DB2 default accounts.</para>
<para>To actually log in or connect to the DB2 databases and servers using
the default DB2 users (db2inst1, db2fenc1, and dasusr1), you need to
modify the initial passwords. To do this, open a terminal (as the regular
user), and type <command>sudo su -</command> to get root access. Then run
these three commands:
<screen>passwd db2inst1
passwd db2fenc1
passwd dasusr1</screen>
Each time you will be asked to set the new password for the specified user
account.</listitem>
<listitem>Change the default shell for the DB2 default accounts. The
default command shell for the DB2 accounts is set as just a plain old
<command>/bin/sh</command>. To get the handy features of the BASH shell,
you'll want to change it for these three accounts. In the same root access
command window, open the <filename>/etc/passwd</filename> file in your
favorite text editor and change:
account.</para></listitem>
<listitem><para>Change the default shell for the DB2 default accounts.</para>
<para>The default command shell for the DB2 accounts is set as just a
plain old <command>/bin/sh</command>. To get the handy features of the
BASH shell, you'll want to change it for these three accounts. In the same
root access command window, open the <filename>/etc/passwd</filename> file
in your favorite text editor and change:
<screen>
db2inst1:x:1001:1001::/home/db2inst1:/bin/sh
db2fenc1:x:1002:1002::/home/db2fenc1:/bin/sh
@ -1695,12 +1716,14 @@ dasusr1:x:1003:1003::/home/dasusr1:/bin/sh</screen>
db2inst1:x:1001:1001::/home/db2inst1:/bin/bash
db2fenc1:x:1002:1002::/home/db2fenc1:/bin/bash
dasusr1:x:1003:1003::/home/dasusr1:/bin/bash</screen>
</listitem>
<listitem>Enable DB2 service ports for remote connections. To enable
outside users to get to your DB2 databases, you'll need to set up the DB2
service port, as it is not configured by the Synaptic installation process.
As the regular user, run <command>sudo vi /etc/services</command> and add
this line to the end of the file and save the changes:
</para></listitem>
<listitem>
<para>Enable DB2 service ports for remote connections.</para>
<para>To enable outside users to get to your DB2 databases, you'll need
to set up the DB2 service port, as it is not configured by the Synaptic
installation process.</para>
<para>As the regular user, run <command>sudo vi /etc/services</command>
and add this line to the end of the file and save the changes:
<screen>db2c_db2inst1 50001/tcp # IBM DB2 instance - db2inst1</screen>
Then, as the DB2 instance owner (db2inst1 by default), run these commands:
<screen>db2 update dbm cfg using SVCENAME db2c_db2inst1
@ -1709,20 +1732,23 @@ db2stop
db2start</screen>
Now remote users will be able to connect to the DB2 databases on your
Ubuntu system.
</listitem>
<listitem>Enable remote DB2 administration connections. To allow remote
administration of your DB2 server, you'll need to set up the DB2 DAS
connection port, as it is not configured by the Synaptic installation
process.
As the regular user, run <command>sudo vi /etc/services</command> and add
this line to the end of the file:
</para></listitem>
<listitem>
<para>Enable remote DB2 administration connections.</para>
<para>To allow remote administration of your DB2 server, you'll need to
set up the DB2 DAS connection port, as it is not configured by the
Synaptic installation process.
</para>
<para>As the regular user, run <command>sudo vi /etc/services</command>
and add this line to the end of the file:
<screen>ibm-db2 523/tcp # IBM DB2 DAS
ibm-db2 523/udp # IBM DB2 DAS</screen>
Then, as the DB2 DAS owner (dasusr1 by default), run these commands:
Then, as the DB2 DAS owner (dasusr1 by default), run these commands:
<screen>db2admin stop
db2admin start</screen>
Now remote administrators can connect to the DAS server to administer
Now remote administrators can connect to the DAS server to administer
databases on your Ubuntu system.
</para>
</listitem>
</orderedlist>
</para>
@ -1757,17 +1783,28 @@ db2admin start</screen>
installer. This way, almost everything is done for you, from installation to
configuration. Here's how to do it:
<orderedlist>
<listitem>Use any FTP client software and connect to:
<listitem>
<para>Use any FTP client software and connect to:
<ulink>ftp.software.ibm.com/software/data/db2/express/latest_debs</ulink>
</para>
</listitem>
<listitem>Download <filename>db2exc_9.1.2-1_i386.deb</filename> (or the
latest equivalent .deb file)</listitem>
<listitem>Once the download is complete, run this command:
<screen>sudo gdebi-gtk db2exc_9.1.2-1_i386.deb</screen>
<listitem>
<para>Download <filename>db2exc_9.1.2-1_i386.deb</filename> (or the
latest equivalent .deb file)
</para>
</listitem>
<listitem>
<para>Once the download is complete, run this command:
<screen>sudo gdebi-gtk db2exc_9.1.2-1_i386.deb</screen>
</para>
</listitem>
<listitem>
<para>Click "<command>Install Package</command>"</para>
</listitem>
<listitem>
<para>Click "<command>Close</command>" once the package has been
installed</para>
</listitem>
<listitem>Click "<command>Install Package</command>"</listitem>
<listitem>Click "<command>Close</command>" once the package has been
installed</listitem>
</orderedlist>
After hitting the "<command>Install Package</command>" button, the Ubuntu
package installer will unpack and install the package and configure the DB2
@ -1781,67 +1818,133 @@ db2admin start</screen>
<para>After installation by Synaptic, there are a few steps required to get
DB2 up and running smoothly.
<orderedlist>
<listitem>Usable passwords for the DB2 default accounts. To actually log
in or connect to the DB2 databases and servers using the default DB2 users
(db2inst1, db2fenc1, and dasusr1), you need to modify the initial
passwords. To do this, open a terminal (as the regular user), and type
<command>sudo su -</command> to get root access. Then run these three
commands:
<listitem>
<para>Usable passwords for the DB2 default accounts.</para>
<para>To actually log in or connect to the DB2 databases and servers
using the default DB2 users (db2inst1, db2fenc1, and dasusr1), you need
to modify the initial passwords. To do this, open a terminal (as the
regular user), and type <command>sudo su -</command> to get root access.
Then run these three commands:
<screen>passwd db2inst1
passwd db2fenc1
passwd dasusr1</screen>
Each time you will be asked to set the new password for the specified user
account.</listitem>
<listitem>Change the default shell for the DB2 default accounts. The
default command shell for the DB2 accounts is set as just a plain old
<command>/bin/sh</command>. To get the handy features of the BASH shell,
you'll want to change it for these three accounts. In the same root access
command window, open the <filename>/etc/passwd</filename> file in your
favorite text editor and change:
Each time you will be asked to set the new password for the specified
user account.
</para>
</listitem>
<listitem>
<para>Change the default shell for the DB2 default accounts.</para>
<para>The default command shell for the DB2 accounts is set as just a
plain old <command>/bin/sh</command>. To get the handy features of the
BASH shell, you'll want to change it for these three accounts. In the
same root access command window, open the
<filename>/etc/passwd</filename> file in your favorite text editor and
change:
<screen>
db2inst1:x:1001:1001::/home/db2inst1:/bin/sh
db2fenc1:x:1002:1002::/home/db2fenc1:/bin/sh
dasusr1:x:1003:1003::/home/dasusr1:/bin/sh</screen>
to
to
<screen>
db2inst1:x:1001:1001::/home/db2inst1:/bin/bash
db2fenc1:x:1002:1002::/home/db2fenc1:/bin/bash
dasusr1:x:1003:1003::/home/dasusr1:/bin/bash</screen>
</para>
</listitem>
<listitem>Enable DB2 service ports for remote connections. To enable
outside users to get to your DB2 databases, you'll need to set up the DB2
service port, as it is not configured by the Synaptic installation process.
As the regular user, run <command>sudo vi /etc/services</command> and add
this line to the end of the file:
<screen>db2c_db2inst1 50001/tcp # IBM DB2 instance - db2inst1</screen>
Then, as the DB2 instance owner (db2inst1 by default), run these commands:
<screen>db2 update dbm cfg using SVCENAME db2c_db2inst1
<listitem>
<para>Enable DB2 service ports for remote connections.</para>
<para>To enable outside users to get to your DB2 databases, you'll need
to set up the DB2 service port, as it is not configured by the Synaptic
installation process.</para>
<para>As the regular user, run <command>sudo vi /etc/services</command>
and add this line to the end of the file:
<screen>db2c_db2inst1 50001/tcp # IBM DB2 instance - db2inst1</screen>
Then, as the DB2 instance owner (db2inst1 by default), run these commands:
<screen>db2 update dbm cfg using SVCENAME db2c_db2inst1
db2set DB2COMM=tcpip
db2stop
db2start</screen>
Now remote users will be able to connect to the DB2 databases on your
Ubuntu system.
Now remote users will be able to connect to the DB2 databases on your
Ubuntu system.
</para>
</listitem>
<listitem>Enable remote DB2 administration connections>. To allow remote
administration of your DB2 server, you'll need to set up the DB2 DAS
connection port, as it is not configured by the Synaptic installation
process.
As the regular user, run <command>sudo vi /etc/services</command> and add
this line to the end of the file:
<screen>ibm-db2 523/tcp # IBM DB2 DAS
<listitem>
<para>Enable remote DB2 administration connections.</para>
<para>To allow remote administration of your DB2 server, you'll need to
set up the DB2 DAS connection port, as it is not configured by the
Synaptic installation process.</para>
<para>As the regular user, run <command>sudo vi /etc/services</command>
and add this line to the end of the file:
<screen>ibm-db2 523/tcp # IBM DB2 DAS
ibm-db2 523/udp # IBM DB2 DAS</screen>
Then, as the DB2 DAS owner (dasusr1 by default), run these commands:
<screen>db2admin stop
Then, as the DB2 DAS owner (dasusr1 by default), run these commands:
<screen>db2admin stop
db2admin start</screen>
Now remote administrators can connect to the DAS server to administer
databases on your Ubuntu system.
Now remote administrators can connect to the DAS server to administer
databases on your Ubuntu system.
</para>
</listitem>
<listitem>
<para>Correct instance restart problem</para>
<para>One issue of note with the Ubuntu 7.04 installation is that the
DB2 instances do not properly restart after a system reboot, and setting
DB2AUTOSTART=YES does not resolve the issue.</para>
<para>One workaround to this problem was suggested in part by
IgorM on the DB2 Express-C forum; and that is to create and execute your
own DB2 instance start up script.
</para>
<para>To begin with, login and create a new script file using the command:
<screen>sudo vi /etc/init.d/db2</screen>
and then insert this text:
<screen>#!/bin/sh
#
# Script to start DB2 instances on bootup.
#
set -e
. /lib/lsb/init-functions
case "$1" in
start)
/opt/ibm/db2exc/V9.1/instance/db2istrt
;;
stop|restart|reload)
;;
esac
exit 0</screen>
and write the file to disk with the <command>:wq</command> vi command.
</para>
<para>
Note that the path to the executable is
<command>/opt/ibm/db2exc/V9.1/</command>, the default installation path
from the DB2 .deb file. If your installation put the DB2 files
elsewhere, be sure to adjust this script as required to find the
/instance/ directory.
</para>
<para>Once the script has been saved, give the file the proper ownership
and permissions:
<screen>chown root.root db2
chmod 755 db2</screen></para>
<para>Now, to initialize this script so that it starts at boot time,
install the Boot-Up Manager with this command:
<screen>sudo apt-get bum</screen>
</para>
<para>After Synaptic downloads and installs the application file, you
can run the program by clicking <command>System -> Administration ->
BootUp-Manager</command>. Then click on the "Activate" checkbox beside
the <command>db2</command> entry. Click <command>Apply</command> and
say "No" to the dialog that asks if you want to start the service now.
Click <command>Quit</command>. The script will now run at your next boot and
start up all DB2 instances.
</para>
<para>The only other way to resolve the problem is to manually
start the instances after a reboot with <command>db2start</command> (as
the instance owner) and <command>db2admin start</command> (as the DAS
owner). Once DB2 Express-C has passed the validation process for Ubuntu
7.04, this instance start issue will disappear.
</para>
</listitem>
<listitem>One issue to note is that the DB2 instance does not properly
restart after a system reboot, and setting DB2AUTOSTART=YES does not
resolve the issue. The only way to resolve the
problem for now is to manually start the instances after a reboot with
<command>db2start</command> (as the instance owner) and <command>db2admin
start</command> (as the DAS owner).</listitem>
</orderedlist>
</para>
</sect2>