- 论坛徽章:
- 0
|
OCFS2 FAQ
OCFS2 - FREQUENTLY ASKED QUESTIONS
CONTENTS
* General
* Download and Install
* Configure
* O2CB Cluster Service
* Format
* Mount
* Oracle RAC
* Migrate Data from OCFS (Release 1) to OCFS2
* Coreutils
* Troubleshooting
* Limits
* System Files
* Heartbeat
* Quorum and Fencing
* Novell SLES9
* Release 1.2
* Upgrade to the Latest Release
* Processes
GENERAL
1. How do I get started?
* Download and install the module and tools rpms.
* Create cluster.conf and propagate to all nodes.
* Configure and start the O2CB cluster service.
* Format the volume.
* Mount the volume.
2. How do I know the version number running?
# cat /proc/fs/ocfs2/version
OCFS2 1.2.1 Fri Apr 21 13:51:24 PDT 2006 (build bd2f25ba0af9677db3572e3ccd92f739)
3. How do I configure my system to auto-reboot after a panic?
To auto-reboot system 60 secs after a panic, do:
# echo 60 > /proc/sys/kernel/panic
To enable the above on every reboot, add the following to /etc/sysctl.conf:
kernel.panic = 60
DOWNLOAD AND INSTALL
4. Where do I get the packages from?
For Novell's SLES9, upgrade to the latest SP3 kernel to get the required modules installed. Also, install ocfs2-tools and ocfs2console packages. For Red Hat's RHEL4, download and install the appropriate module package and the two tools packages, ocfs2-tools and ocfs2console. Appropriate module refers to one matching the kernel version, flavor and architecture. Flavor refers to smp, hugemem, etc.
5. What are the latest versions of the OCFS2 packages?
The latest module package version is 1.2.2. The latest tools/console packages versions are 1.2.1.
6. How do I interpret the package name ocfs2-2.6.9-22.0.1.ELsmp-1.2.1-1.i686.rpm?
The package name is comprised of multiple parts separated by '-'.
* ocfs2 - Package name
* 2.6.9-22.0.1.ELsmp - Kernel version and flavor
* 1.2.1 - Package version
* 1 - Package subversion
* i686 - Architecture
7. How do I know which package to install on my box?
After one identifies the package name and version to install, one still needs to determine the kernel version, flavor and architecture.
To know the kernel version and flavor, do:
# uname -r
2.6.9-22.0.1.ELsmp
To know the architecture, do:
# rpm -qf /boot/vmlinuz-`uname -r` --queryformat "%{ARCH}\n"
i686
8. Why can't I use uname -p to determine the kernel architecture?
uname -p does not always provide the exact kernel architecture. Case in point the RHEL3 kernels on x86_64. Even though Red Hat has two different kernel architectures available for this port, ia32e and x86_64, uname -p identifies both as the generic x86_64.
9. How do I install the rpms?
First install the tools and console packages:
# rpm -Uvh ocfs2-tools-1.2.1-1.i386.rpm ocfs2console-1.2.1-1.i386.rpm
Then install the appropriate kernel module package:
# rpm -Uvh ocfs2-2.6.9-22.0.1.ELsmp-1.2.1-1.i686.rpm
10. Do I need to install the console?
No, the console is not required but recommended for ease-of-use.
11. What are the dependencies for installing ocfs2console?
ocfs2console requires e2fsprogs, glib2 2.2.3 or later, vte 0.11.10 or later, pygtk2 (EL4) or python-gtk (SLES9) 1.99.16 or later, python 2.3 or later and ocfs2-tools.
12. What modules are installed with the OCFS2 1.2 package?
* configfs.ko
* ocfs2.ko
* ocfs2_dlm.ko
* ocfs2_dlmfs.ko
* ocfs2_nodemanager.ko
* debugfs
13. What tools are installed with the ocfs2-tools 1.2 package?
* mkfs.ocfs2
* fsck.ocfs2
* tunefs.ocfs2
* debugfs.ocfs2
* mount.ocfs2
* mounted.ocfs2
* ocfs2cdsl
* ocfs2_hb_ctl
* o2cb_ctl
* o2cb - init service to start/stop the cluster
* ocfs2 - init service to mount/umount ocfs2 volumes
* ocfs2console - installed with the console package
14. What is debugfs and is it related to debugfs.ocfs2?
debugfs is an in-memory filesystem developed by Greg Kroah-Hartman. It is useful for debugging as it allows kernel space to easily export data to userspace. It is currently being used by OCFS2 to dump the list of filesystem locks and could be used for more in the future. It is bundled with OCFS2 as the various distributions are currently not bundling it. While debugfs and debugfs.ocfs2 are unrelated in general, the latter is used as the front-end for the debugging info provided by the former. For example, refer to the troubleshooting section.
CONFIGURE
15. How do I populate /etc/ocfs2/cluster.conf?
If you have installed the console, use it to create this configuration file. For details, refer to the user's guide. If you do not have the console installed, check the Appendix in the User's guide for a sample cluster.conf and the details of all the components. Do not forget to copy this file to all the nodes in the cluster. If you ever edit this file on any node, ensure the other nodes are updated as well.
16. Should the IP interconnect be public or private?
Using a private interconnect is recommended. While OCFS2 does not take much bandwidth, it does require the nodes to be alive on the network and sends regular keepalive packets to ensure that they are. To avoid a network delay being interpreted as a node disappearing on the net which could lead to a node-self-fencing, a private interconnect is recommended. One could use the same interconnect for Oracle RAC and OCFS2.
17. What should the node name be and should it be related to the IP address?
The node name needs to match the hostname. The IP address need not be the one associated with that hostname. As in, any valid IP address on that node can be used. OCFS2 will not attempt to match the node name (hostname) with the specified IP address.
18. How do I modify the IP address, port or any other information specified in cluster.conf?
While one can use ocfs2console to add nodes dynamically to a running cluster, any other modifications require the cluster to be offlined. Stop the cluster on all nodes, edit /etc/ocfs2/cluster.conf on one and copy to the rest, and restart the cluster on all nodes. Always ensure that cluster.conf is the same on all the nodes in the cluster.
19. How do I add a new node to an online cluster?
You can use the console to add a new node. However, you will need to explicitly add the new node on all the online nodes. That is, adding on one node and propagating to the other nodes is not sufficient. If the operation fails, it will most likely be due to bug#741. In that case, you can use the o2cb_ctl utility on all online nodes as follows:
# o2cb_ctl -C -i -n NODENAME -t node -a number=NODENUM -a ip_address=IPADDR -a ip_port=IPPORT -a cluster=CLUSTERNAME
20. Ensure the node is added both in /etc/ocfs2/cluster.conf and in /config/cluster/CLUSTERNAME/node on all online nodes. You can then simply copy the cluster.conf to the new (still offline) node as well as other offline nodes. At the end, ensure that cluster.conf is consistent on all the nodes. How do I add a new node to an offline cluster?
You can either use the console or use o2cb_ctl or simply hand edit cluster.conf. Then either use the console to propagate it to all nodes or hand copy using scp or any other tool. The o2cb_ctl command to do the same is:
# o2cb_ctl -C -n NODENAME -t node -a number=NODENUM -a ip_address=IPADDR -a ip_port=IPPORT -a cluster=CLUSTERNAME
Notice the "-i" argument is not required as the cluster is not online.
O2CB CLUSTER SERVICE
21. How do I configure the cluster service?
# /etc/init.d/o2cb configure
Enter 'y' if you want the service to load on boot and the name of the cluster (as listed in /etc/ocfs2/cluster.conf).
22. How do I start the cluster service?
* To load the modules, do:
# /etc/init.d/o2cb load
* To Online it, do:
# /etc/init.d/o2cb online [cluster_name]
If you have configured the cluster to load on boot, you could combine the two as follows:
# /etc/init.d/o2cb start [cluster_name]
The cluster name is not required if you have specified the name during configuration.
23. How do I stop the cluster service?
* To offline it, do:
# /etc/init.d/o2cb offline [cluster_name]
* To unload the modules, do:
# /etc/init.d/o2cb unload
If you have configured the cluster to load on boot, you could combine the two as follows:
# /etc/init.d/o2cb stop [cluster_name]
The cluster name is not required if you have specified the name during configuration.
24. How can I learn the status of the cluster?
To learn the status of the cluster, do:
# /etc/init.d/o2cb status
25. I am unable to get the cluster online. What could be wrong?
Check whether the node name in the cluster.conf exactly matches the hostname. One of the nodes in the cluster.conf need to be in the cluster for the cluster to be online.
FORMAT
26. How do I format a volume?
You could either use the console or use mkfs.ocfs2 directly to format the volume. For console, refer to the user's guide.
# mkfs.ocfs2 -L "oracle_home" /dev/sdX
The above formats the volume with default block and cluster sizes, which are computed based upon the size of the volume.
# mkfs.ocfs2 -b 4k -C 32K -L "oracle_home" -N 4 /dev/sdX
The above formats the volume for 4 nodes with a 4K block size and a 32K cluster size.
27. What does the number of node slots during format refer to?
The number of node slots specifies the number of nodes that can concurrently mount the volume. This number is specified during format and can be increased using tunefs.ocfs2. This number cannot be decreased.
28. What should I consider when determining the number of node slots?
OCFS2 allocates system files, like Journal, for each node slot. So as to not to waste space, one should specify a number within the ballpark of the actual number of nodes. Also, as this number can be increased, there is no need to specify a much larger number than one plans for mounting the volume.
29. Does the number of node slots have to be the same for all volumes?
No. This number can be different for each volume.
30. What block size should I use?
A block size is the smallest unit of space addressable by the file system. OCFS2 supports block sizes of 512 bytes, 1K, 2K and 4K. The block size cannot be changed after the format. For most volume sizes, a 4K size is recommended. On the other hand, the 512 bytes block is never recommended.
31. What cluster size should I use?
A cluster size is the smallest unit of space allocated to a file to hold the data. OCFS2 supports cluster sizes of 4K, 8K, 16K, 32K, 64K, 128K, 256K, 512K and 1M. For database volumes, a cluster size of 128K or larger is recommended. For Oracle home, 32K to 64K.
32. Any advantage of labelling the volumes?
As in a shared disk environment, the disk name (/dev/sdX) for a particular device be different on different nodes, labelling becomes a must for easy identification. You could also use labels to identify volumes during mount.
# mount -L "label" /dir
The volume label is changeable using the tunefs.ocfs2 utility.
MOUNT
33. How do I mount the volume?
You could either use the console or use mount directly. For console, refer to the user's guide.
# mount -t ocfs2 /dev/sdX /dir
The above command will mount device /dev/sdX on directory /dir.
34. How do I mount by label?
To mount by label do:
# mount -L "label" /dir
35. What entry to I add to /etc/fstab to mount an ocfs2 volume?
Add the following:
/dev/sdX /dir ocfs2 noauto,_netdev 0 0
The _netdev option indicates that the devices needs to be mounted after the network is up.
36. What do I need to do to mount OCFS2 volumes on boot?
* Enable o2cb service using:
# chkconfig --add o2cb
* Enable ocfs2 service using:
# chkconfig --add ocfs2
* Configure o2cb to load on boot using:
# /etc/init.d/o2cb configure
* Add entries into /etc/fstab as follows:
/dev/sdX /dir ocfs2 _netdev 0 0
37. How do I know my volume is mounted?
* Enter mount without arguments, or,
# mount
* List /etc/mtab, or,
# cat /etc/mtab
* List /proc/mounts, or,
# cat /proc/mounts
* Run ocfs2 service.
# /etc/init.d/ocfs2 status
mount command reads the /etc/mtab to show the information.
38. What are the /config and /dlm mountpoints for?
OCFS2 comes bundled with two in-memory filesystems configfs and ocfs2_dlmfs. configfs is used by the ocfs2 tools to communicate to the in-kernel node manager the list of nodes in the cluster and to the in-kernel heartbeat thread the resource to heartbeat on. ocfs2_dlmfs is used by ocfs2 tools to communicate with the in-kernel dlm to take and release clusterwide locks on resources.
39. Why does it take so much time to mount the volume?
It takes around 5 secs for a volume to mount. It does so so as to let the heartbeat thread stabilize. In a later release, we plan to add support for a global heartbeat, which will make most mounts instant.
ORACLE RAC
40. Any special flags to run Oracle RAC?
OCFS2 volumes containing the Voting diskfile (CRS), Cluster registry (OCR), Data files, Redo logs, Archive logs and Control files must be mounted with the datavolume and nointr mount options. The datavolume option ensures that the Oracle processes opens these files with the o_direct flag. The nointr option ensures that the ios are not interrupted by signals.
# mount -o datavolume,nointr -t ocfs2 /dev/sda1 /u01/db
41. What about the volume containing Oracle home?
Oracle home volume should be mounted normally, that is, without the datavolume and nointr mount options. These mount options are only relevant for Oracle files listed above.
# mount -t ocfs2 /dev/sdb1 /software/orahome
42. Also as OCFS2 does not currently support shared writeable mmap, the health check (GIMH) file $ORACLE_HOME/dbs/hc_ORACLESID.dat and the ASM file $ASM_HOME/dbs/ab_ORACLESID.dat should be symlinked to local filesystem. We expect to support shared writeable mmap in the RHEL5 timeframe. Does that mean I cannot have my data file and Oracle home on the same volume?
Yes. The volume containing the Oracle data files, redo-logs, etc. should never be on the same volume as the distribution (including the trace logs like, alert.log).
43. Any other information I should be aware off?
The 1.2.3 release of OCFS2 does not update the modification time on the inode across the cluster for non-extending writes. However, the time will be locally updated in the cached inodes. This leads to one observing different times (ls -l) for the same file on different nodes on the cluster.
While this does not affect most uses of the filesystem, as one variably changes the file size during write, the one usage where this is most commonly experienced is with Oracle datafiles and redologs. This is because Oracle rarely resizes these files and thus almost all writes are non-extending.
In the short term (1.2.x), we intend to provide a mount option (nocmtime) to allow users to explicitly ask the filesystem to not change the modification time during non-extending writes. While this is not the complete solution, this will ensure that the times are consistent across the cluster.
In the long term (1.4.x), we intend to fix this by updating modification times for all writes while providing an opt-out option (nocmtime) for users who would prefer to avoid the performance overhead associated with this feature.
MIGRATE DATA FROM OCFS (RELEASE 1) TO OCFS2
44. Can I mount OCFS volumes as OCFS2?
No. OCFS and OCFS2 are not on-disk compatible. We had to break the compatibility in order to add many of the new features. At the same time, we have added enough flexibility in the new disk layout so as to maintain backward compatibility in the future.
45. Can OCFS volumes and OCFS2 volumes be mounted on the same machine simultaneously?
No. OCFS only works on 2.4 linux kernels (Red Hat's AS2.1/EL3 and SuSE's SLES . OCFS2, on the other hand, only works on the 2.6 kernels (Red Hat's EL4 and SuSE's SLES9).
46. Can I access my OCFS volume on 2.6 kernels (SLES9/RHEL4)?
Yes, you can access the OCFS volume on 2.6 kernels using FSCat tools, fsls and fscp. These tools can access the OCFS volumes at the device layer, to list and copy the files to another filesystem. FSCat tools are available on oss.oracle.com.
47. Can I in-place convert my OCFS volume to OCFS2?
No. The on-disk layout of OCFS and OCFS2 are sufficiently different that it would require a third disk (as a temporary buffer) inorder to in-place upgrade the volume. With that in mind, it was decided not to develop such a tool but instead provide tools to copy data from OCFS without one having to mount it.
48. What is the quickest way to move data from OCFS to OCFS2?
Quickest would mean having to perform the minimal number of copies. If you have the current backup on a non-OCFS volume accessible from the 2.6 kernel install, then all you would need to do is to retore the backup on the OCFS2 volume(s). If you do not have a backup but have a setup in which the system containing the OCFS2 volumes can access the disks containing the OCFS volume, you can use the FSCat tools to extract data from the OCFS volume and copy onto OCFS2.
COREUTILS
49. Like with OCFS (Release 1), do I need to use o_direct enabled tools to perform cp, mv, tar, etc.?
No. OCFS2 does not need the o_direct enabled tools. The file system allows processes to open files in both o_direct and bufferred mode concurrently.
TROUBLESHOOTING |
|