2013年12月23日 星期一

iorate

使用方法:
1. vi devices.ior (檔案放在要測試的disk)
 # File system example
 Device = "/tmp/iorate.tst"  capacity 8GB;

 # UNIX raw device example
 #Device = "/dev/rdsk/c901t0d0s2"  capacity 4.1GB;

2. more patterns.ior (查看要測試的R/W參數)
Pattern 10 = "8k Random Read"     io size 8KB   random     read;
Pattern 11 = "8k Seq Write"       io size 8KB   sequential write max sequential
10000;
Pattern 12 = "8k Random Write"    io size 8KB   random     write;
10000;

3. vi tests.ior (測試讀寫8GB,block 8k,R:W=7:3,5分鐘)
Test  1 = " 8k Bus Test"  for 300 sec ignore 30 sec size 8GB 70% pat  10, 30% pat 12;
#Test  2 = " 8k Bus Test"  for 130 sec ignore 30 sec size 1MB 100% pat  9;

#Test  3 = "64k Bus Test"  for 130 sec ignore 30 sec size 1MB 100% pat 21;

4. time dd if=/dev/zero of=/tmp/iorate.tst bs=8k count=1179648 (產生測試檔,必須大於8GB)

5. ./iorate -p patterns.ior (執行I/O測試)

6. ./gen_sums (可把測試出來的檔案轉換成xls)

2013年12月2日 星期一

Owncloud 架設(CentOS)

1.首先安裝LAMP is short for Linux, Apache, MySQL, PHP.

2 Installing MySQL 5
To install MySQL, we do this:
yum install mysql mysql-server
Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
Set passwords for the MySQL root account:
mysql_secure_installation
[root@server1 ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n]
 <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 <-- ENTER
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 <-- ENTER
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 <-- ENTER
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 <-- ENTER
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


[root@server1 ~]#


3 Installing Apache2


Apache2 is available as a CentOS package, therefore we can install it like this:
yum install httpd
Now configure your system to start Apache at boot time...
chkconfig --levels 235 httpd on
... and start Apache:
/etc/init.d/httpd start
Now direct your browser to http://192.168.0.100, and you should see the Apache2 placeholder page:


Apache's default document root is /var/www/html on CentOS, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.

4 Installing PHP5

We can install PHP5 and the Apache PHP5 module as follows:
yum install php
We must restart Apache afterwards:

/etc/init.d/httpd restart

5 Testing PHP5 / Getting Details About Your PHP5 Installation

The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
vi /var/www/html/info.php
<?php
phpinfo ( ) ;
?>

Now we call that file in a browser (e.g. http://192.168.0.100/info.php):

As you see, PHP5 is working, and it's working through the Apache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don't have MySQL support in PHP5 yet.

6 Getting MySQL Support In PHP5

To get MySQL support in PHP, we can install the php-mysql package. It's a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:
yum search php
Pick the ones you need and install them like this:
yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc
APC is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cachers, such as eAccelerator and Xcache. It is strongly recommended to have one of these installed to speed up your PHP page.
APC can be installed as follows:
yum install php-pecl-apc
Now restart Apache2:
/etc/init.d/httpd restart
Now reload http://192.168.0.100/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the MySQL module:



7 phpMyAdmin

phpMyAdmin is a web interface through which you can manage your MySQL databases.
First we enable the RPMforge repository on our CentOS system as phpMyAdmin is not available in the official CentOS 6.3 repositories:
Import the RPMforge GPG key:
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
On x86_64 systems:
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
On i386 systems:
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
phpMyAdmin can now be installed as follows:
yum install phpmyadmin
Now we configure phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the <Directory "/usr/share/phpmyadmin"> stanza):
vi /etc/httpd/conf.d/phpmyadmin.conf
#
#  Web application to manage MySQL
#

#<Directory "/usr/share/phpmyadmin">
#  Order Deny,Allow
#  Deny from all
#  Allow from 127.0.0.1
#</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin

Alias /mysqladmin /usr/share/phpmyadmin

Next we change the authentication in phpMyAdmin from cookie to http:
vi /usr/share/phpmyadmin/config.inc.php
[...]
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

[...]
Restart Apache:
/etc/init.d/httpd restart
Afterwards, you can access phpMyAdmin under http://192.168.0.100/phpmyadmin/:

轉貼網址:www.howtoforge.com

8.安裝owncloud

在root執行
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo
yum install owncloud
如果安裝owncloud出現缺少套件
Error: Package: owncloud-2012.4-43.1.noarch (isv_ownCloud_ownCloud2012)
           Requires: php-pear-MDB2-Driver-mysqli
Error: Package: owncloud-2012.4-43.1.noarch (isv_ownCloud_ownCloud2012)
           Requires: php-pear-Net-Curl
請安裝:
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
等待安裝完畢



安裝完畢後,打開瀏覽器輸入 localhost/owncloud,即可出現建立管理者帳號畫面


修改owncloud上傳檔案最大限制 
vi /var/www/html/owncloud/.htaccess
php_value upload_max_filesize 5000M
php_value post_max_size 5000M

php_value memory_limit 5000M

2013年7月16日 星期二

dsmcad

1. Starting the TSM Scheduler

Running the TSM Scheduler requires that the TSM password has been stored encrypted on the local machine and so the TSM client must have authenticated to the TSM server before the scheduler is run. Additionally, it is strongly recommended that clients perform a full manual incremental backup of their local filestore before running the scheduler.
The scheduled backup method recommended by OUCS is to run the Client Acceptor Daemon (CAD) to manage the TSM client scheduler. Managing the TSM client scheduler this way has the following benefits:
  • The CAD launches the scheduler only when necessary.
  • As a consequence of the above, client options and file excludes may be added without having to stop/restart the scheduler.
  • The CAD is memory-light and therefore resolves the problem of running the memory-hungry TSM client scheduler permanently in the background.
To run the CAD, check that the file /opt/tivoli/tsm/client/ba/bin/dsm.sys contains the line
  ManagedServices    Schedule
adding it to the end of the file if necessary.

1.1. inittab method

If your flavour of Unix employs the /etc/inittab file to launch processes at system startup then you can add a line similar to one below:
  dc:2:once:/usr/bin/dsmcad > /dev/null 2>&1   # run dsmcad wrapper for TSM scheduler
Then run the following command as the root user.
  /usr/bin/dsmcad > /dev/null 2>&1 # for Bourne-like shells
  /usr/bin/dsmcad >& /dev/null   # for C-like shells

1.2. SysV init scripts (/etc/init.d or /etc/rc.d) method

For systems that start programs from init level command files, it is simplest to add a command file that starts and stops the TSM Scheduler at the appropriate run levels (2, 3, 4, 5). To this end, OUCS includes a file in the directory /opt/tivoli/tsm/client/ba/bin/ called dsmcad-init This script includes the appropriate headers for addition via specific tools on some systems.

1.2.1. SuSE 10, Fedora Core and Redhat-Based systems

To install the TSM scheduler on SuSE 10, Fedora Core and Redhat-Based systems:
  1. Copy dsmcad-init to /etc/init.d
  2. Ensure script is executable with: chmod 755 /etc/init.d/dsmcad-init
  3. Add script to system start up with: /sbin/chkconfig --add dsmcad-init
  4. Check script with: /sbin/chkconfig --list dsmcad-init
  5. Reboot box to check execution or start with /etc/init.d/dsmcad-init start
To remove the TSM scheduler:
  1. /sbin/chkconfig --del dsmcad-init
  2. Remove dsmcad-init from /etc/init.d/

1.2.2. Debian-based systems

To install the TSM scheduler on Debian systems (on Ubuntu remember to preface the commands with sudo) :
  1. Copy dsmcad-init to /etc/init.d
  2. Ensure script is executable with: chmod 755 /etc/init.d/dsmcad-init
  3. Add script to system start up with: update-rc.d dsmcad-init defaults 95 05
  4. Start the service with: invoke-rc.d dsmcad-init start
To remove the TSM scheduler:
  1. Remove dsmcad-init from /etc/init.d/
  2. update-rc.d dsmcad-init remove

1.2.3. Solaris 8/9, other Linux distributions, and other UNIX systems using SysV init scripts

To install the TSM scheduler on Solaris 8/9, and other UNIX systems/Linux distributions using SysV init scripts (/etc/init.d or /etc/rc.d):
  1. Copy dsmcad-init to /etc/init.d
  2. Ensure script is executable with: chmod 755 /etc/init.d/dsmcad-init
  3. Add the following symlinks:
    • /etc/rc0.d/K05dsmcad-init -> ../init.d/dsmcad-init
    • /etc/rc1.d/K05dsmcad-init -> ../init.d/dsmcad-init
    • /etc/rc6.d/K05dsmcad-init -> ../init.d/dsmcad-init
    • /etc/rc2.d/S95dsmcad-init -> ../init.d/dsmcad-init
    • /etc/rc3.d/S95dsmcad-init -> ../init.d/dsmcad-init
    • /etc/rc4.d/S95dsmcad-init -> ../init.d/dsmcad-init
    • /etc/rc5.d/S95dsmcad-init -> ../init.d/dsmcad-init
    • /etc/rcS.d/K05dsmcad-init -> ../init.d/dsmcad-init
(NB: Some of the above links will not apply on some systems)
To remove the TSM scheduler:
  1. Remove dsmcad-init from /etc/init.d/
  2. Remove dsmcad-init symlinks from /etc/rc{0,1,2,3,4,5,6,S}.d/

1.3. Log files

The CAD and TSM scheduler write to the following log files in /var/log (unless the variable DSM_LOG is set at run time to specify an alternative location):
  • dsmwebcl.log - the logfile of the CAD output.
  • dsmsched.log - the log of the all scheduled backups. This file lists the details of each file processed in the most recent scheduled backups, the summary results of the most recent scheduled backups and the time of the next scheduled backup.
  • dsmerror.log - lists any errors encountered in any manual or scheduled backup.
Once started, the TSM Scheduler will contact the TSM server for the next schedule window and count down to that. If the next schedule window is more than 24 hours away the process will count down for 24 hours and then re-contact the TSM server. This window can be checked manually by running the command:
   dsmc query schedule
You can check that the CAD is managing the scheduler by examining the latest entry in the dsmwebcl.log file. It should look similar to below.
Note that there is a Schedule Name - usually starting WEEKLY_ or WEEKDAILY_ followed by a shortened department or college name. The latest entries will look similar to below.
Note that the last line 'Scheduler has been stopped' is normal and refers to the TSM scheduler being managed (stopped and started) by the CAD.

2013年7月11日 星期四

IBM Tivoli Storage Manager for Linux: Administrator's Reference

QUERY ACTLOG (Query the Activity Log)


Use this command to display messages generated by the server. This command offers you various filtering options that can be used to limit the amount of messages displayed and the time it takes to process this query. If you do not specify any parameters with this command, all messages generated in the last hour are displayed. The activity log contains all messages that are sent to the server console under normal operation. The results of commands entered at the server console are not recorded in the activity log, unless the command affects or starts a background process or client session. Error messages are displayed in the activity log.
Note:
You cannot schedule the QUERY ACTLOG command using the DEFINE SCHEDULE command.
Privilege Class Any administrator can issue this command. Syntax
                 .-BEGINDate--=--current_date-.
>>-Query ACtlog--+----------------------------+----------------->
                 '-BEGINDate--=--date---------'
 
   .-BEGINTime--=--currenttime_minus_1_hour-.
>--+----------------------------------------+------------------->
   '-BEGINTime--=--time---------------------'
 
   .-ENDDate--=--current_date-.  .-ENDTime--=--current_time-.
>--+--------------------------+--+--------------------------+--->
   '-ENDDate--=--date---------'  '-ENDTime--=--time---------'
 
>--+--------------------------+--+-------------------+---------->
   '-MSGno--=--message_number-'  '-Search--=--string-'
 
   .-ORiginator--=--ALL---------------.
>--+----------------------------------+------------------------><
   '-ORiginator--=--+-ALL-----------+-'
                    +-SErver--------+
                    '-CLient--| A |-'
 
A:
 
|--+------------------------+--+--------------------------+----->
   '-NODEname--=--node_name-'  '-OWNERname--=--owner_name-'
 
>--+-----------------------------+------------------------------>
   '-SCHedname--=--schedule_name-'
 
>--+----------------------------+------------------------------->
   '-DOmainname--=--domain_name-'
 
>--+----------------------------+-------------------------------|
   '-SESsnum--=--session_number-'
 
 
Parameters
BEGINDate
Specifies the beginning date of the range for messages to be displayed. All messages meeting the time range criteria that occurred after this date are displayed. The default is the current date. This parameter is optional. You can specify the data using one of the values below:
Value Description Example
MM/DD/YYYY A specific date 09/15/1998
TODAY The current date TODAY
TODAY-days or -days The current date minus days specified. The maximum number of days you can specify is 9999. TODAY -7 or -7. To display information beginning with messages created a week ago, you can specify BEGINDATE=TODAY-7 or BEGINDATE= -7.

BEGINTime
Specifies the beginning time of the range for messages to be displayed. All messages meeting the time range criteria that occurred after this time are displayed. If you do not specify time, all messages that occurred in the last hour are displayed. You can specify the data using one of the values below:
Value Description Example
HH:MM:SS A specific time on the specified begin date 10:30:08
NOW The current time on the specified begin date NOW
NOW+HH:MM or +HH:MM The current time plus hours and minutes on the specified begin date NOW+03:00 or +03:00. If you issue this command at 9:00 with BEGINTIME=NOW+3 or BEGINTIME=+3, Tivoli Storage Manager displays messages with a time of 12:00 or later on the begin date.
NOW-HH:MM or -HH:MM The current time minus hours and minutes on the specified begin date NOW-04:00 or -04:00. If you issue the QUERY ACTLOG command at 9:00 with BEGINTime=NOW-3:30 or BEGINTime= -3:30, Tivoli Storage Manager displays messages with a time of 5:30 or later on the begin date.

ENDDate
Specifies the ending date of the range for messages to be displayed. All messages meeting the time range criteria that occurred before this date are displayed. If you do not specify a value, the current date is used. This parameter is optional. You can specify the data using one of the values below:
Value Description Example
MM/DD/YYYY A specific date 09/15/1998
TODAY The current date TODAY
TODAY-days or -days The current date minus days specified. The maximum number of days you can specify is 9999. TODAY-1 or -1. To display information created up to yesterday, you can specify ENDDATE=TODAY-1 or simply ENDDATE= -1.

ENDTime
Specifies the ending time of the range for messages to be displayed. All messages meeting this time range criteria that occurred before this time are displayed. If you do not specify a value, all messages are displayed up to the time when you issued this command. This parameter is optional. You can specify the data using one of the values below:
Value Description Example
HH:MM:SS A specific time on the specified end date 10:30:08
NOW The current time on the specified end date NOW
NOW+HH:MM or +HH:MM The current time plus hours and minutes on the specified end date NOW+03:00 or +03:00. If you issue this command at 9:00 with ENDTIME=NOW+3:00 or ENDTIME= +3:00, Tivoli Storage Manager displays messages with a time of 12:00 or later on the end date you specify.
NOW-HH:MM or -HH:MM The current time minus hours and minutes on the specified end date NOW-03:30 or -03:30. If you issue this command at 9:00 with ENDTIME=NOW-3:30 or ENDTIME= -3:30, IBM Tivoli Storage Manager displays messages with a time of 5:30 or later on the end date you specify.

MSGno
Specifies an integer that defines the number of the message to be displayed from the activity log. This is the numeric part of the message without the ANR prefix or the message severity type. The message severity types are:
I
Informational message type
W
Warning message type
E
Error message type
S
Severe message type
D
Diagnostic message type
This parameter is optional.
Search
Specifies a text string that you want to search for in the activity log. Enclose the string expression in quotation marks if it contains blanks. You can use text and a wildcard character to specify this string. This parameter is optional.
Note:
Do not enter as a text string either the IBM Tivoli Storage Manager server name or text and a wildcard character that would find the server name. If you do so the output will include messages that do not include the search string.
ORiginator
Specifies that the query displays messages logged by the server, client, or both. The default is ALL. Possible values are:
ALL
Specifies that the query displays messages that originated from the client and the server.
SErver
Specifies that the query displays messages that originated from the server.
CLient
Specifies that the query displays messages that originated from the client. You can specify one of the following values to minimize processing time when querying the activity log for messages logged by the client:
NODEname
Specifies that the query displays messages logged for this node. If you do not specify a value for this parameter, messages for all nodes are displayed.
OWNERname
Specifies that the query displays messages logged for a particular owner. If you do not specify a value for this parameter, messages for all owners are displayed.
SCHedname
Specifies that the query displays messages logged by a particular scheduled client activity. If you do not specify a value for this parameter, messages for all schedules are displayed.
DOmainname
Specifies that the query displays messages logged for a particular policy domain to which a named schedule belongs. This parameter is optional, unless you are specifying a schedule name.
SESsnum
Specifies that the query displays messages logged from a particular client session number. If you do not specify a value for this parameter, messages for all client sessions are displayed.
Examples Task 1 Search the activity log for any message that contains the string "delete". The output includes only messages produced during the past hour.
Command
query actlog search=delete
Output
 
+--------------------------------------------------------------------------------+
|Date/Time            Message                                                    |
|-------------------- -------------------------------------------------          |
|08/27/1998 15:19:43  ANR0812I Inventory client file expiration                  |
|                      complete: 0 files deleted.                                |
+--------------------------------------------------------------------------------+
Task 2 Display messages that occurred yesterday between 9:30 and 12:30.
Command
query actlog begindate=today-1 
begintime=09:30:00 endtime=12:30:00
Output
 
+--------------------------------------------------------------------------------+
|Date/Time           Message                                                     |
|------------------- -------------------------------------------------           |
|10/21/1998 10:52:36 ANR0407I Session 3921 started for administrator ADMIN       |
|                    (WebBrowser) (HTTP 9.115.20.100(2315)).                     |
|10/21/1998 11:06:08 ANR0405I Session 3922 ended for administrator ADMIN         |
|                    (WebBrowser).                                               |
|10/21/1998 12:16:50 ANR0405I Session 3934 ended for administrator ADMIN         |
|                    (WebBrowser).                                               |
|10/21/1998 12:36:18 ANR2501I Schedule AGADM_TEST deleted from policy            |
|                    domain STANDARD.                                            |
+--------------------------------------------------------------------------------+
Task 3 Search the activity log for Tivoli Storage Manager messages from the client for node JEE.
Command
query actlog originator=client node=jee
Output
 
+--------------------------------------------------------------------------------+
|Date/Time           Message                                                     |
|------------------- ----------------------------------------------------        |
|06/10/1998 15:46:22 ANE4007E (Session No: 3 Node: JEE) Error processing         |
|                      '/jee/report.out': access to the object is                |
|                      denied                                                    |
|06/11/1998 15:56:56 ANE4009E (Session No: 4 Node: JEE) Error processing         |
|                     '/jee/work.lst': disk full condition                       |
+--------------------------------------------------------------------------------+

2013年6月6日 星期四

san router config

======switchshow檢查那些Port沒有用============
FCIP port區分為 16-23port為GE0,24-31port為GE1
SW75_11:admin> switchshow
switchName: SW75
switchType: 46.2
switchState: Online  
switchMode: Native
switchRole: Subordinate
switchDomain: 1
switchId: fffc01
switchWwn: 10:00:00:05:1b:55:0c:ab
zoning:  ON (SW7)
switchBeacon: OFF
FC Router: ON
FC Router BB Fabric ID: 1
Address Mode: 0
Index Port Address Media Speed State     Proto
==============================================
  0   0   010000   id    N4   Online      FC  E-Port  10:00:00:05:1e:03:6c:54 "TC7" (upstream)
  1   1   010100   id    N4   No_Light    FC 
  2   2   010200   id    N4   Online      FC  E-Port  10:00:00:05:1e:35:a5:51 "TC144" (downstream)
  3   3   010300   id    N4   No_Light    FC 
  4   4   010400   id    N4   No_Light    FC 
  5   5   010500   id    N4   No_Light    FC 
  6   6   010600   id    N4   No_Light    FC 
  7   7   010700   id    N4   No_Light    FC 
  8   8   010800   id    N4   No_Light    FC 
  9   9   010900   id    N4   No_Light    FC 
 10  10   010a00   id    N4   No_Light    FC 
 11  11   010b00   id    N4   No_Light    FC 
 12  12   010c00   id    N4   No_Light    FC 
 13  13   010d00   id    N4   No_Light    FC 
 14  14   010e00   id    N4   No_Light    FC 
 15  15   010f00   id    N4   No_Light    FC 
 16  16   011000   --    --   Online      VE  VE-Port  50:00:51:ec:1b:37:4a:09 "fcr_fd_160" (downstream)
 17  17   011100   --    --   Online      VE  VEX-Port 10:00:00:05:1e:7b:31:01 "dcx4s_42" (fabric id = 5 )
 18  18   011200   --    --   Offline     VE  Disabled (Persistent)
 19  19   011300   --    --   Offline     VE  Disabled (Persistent)
 20  20   011400   --    --   Offline     VE  Disabled (Persistent)
 21  21   011500   --    --   Offline     VE  Disabled (Persistent)
 22  22   011600   --    --   Offline     VE  Disabled (Persistent)
 23  23   011700   --    --   Offline     VE  Disabled (Persistent)
 24  24   011800   --    --   Offline     VE 
 25  25   011900   --    --   Offline     VE  Disabled (Persistent)
 26  26   011a00   --    --   Offline     VE  Disabled (Persistent)
 27  27   011b00   --    --   Offline     VE  Disabled (Persistent)
 28  28   011c00   --    --   Offline     VE  Disabled (Persistent)
 29  29   011d00   --    --   Offline     VE  Disabled (Persistent)
 30  30   011e00   --    --   Offline     VE  Disabled (Persistent)
 31  31   011f00   --    --   Offline     VE  Disabled (Persistent)
     ge0  id    1G   Online    FCIP
     ge1  id    1G   Online    FCIP

=====建立FCIP兩台switch port需disable然後各自建立為ve、vex這樣2台switch才能溝通=====
SW75_11:admin>portCfgPersistentDisable 16
SW75_11:admin>portcfgvexport 16 -a(admin) 1(啟用) -f 7(fabric id)
SW75_11:admin>portcfg ipif ge0 create 192.168.14.12 255.255.255.0 1500(mtu)設定IP
SW75_11:admin>portcfg iproute ge0 create 0.0.0.0 0.0.0.0 192.168.14.254 1 設定route 這樣才ping的通
SW75_11:admin> portshow iproute ge0
Port: ge0
IP Address      Mask            Gateway        Metric   Flags
-------------------------------------------------------------
0.0.0.0         0.0.0.0         192.168.14.254  1
192.168.14.0   255.255.255.0   192.168.14.12   0      Interface
SW75_11:admin>portcmd --ping ge0 -s 192.168.14.12 -d 192.168.8.22 (檢察介面是否可以互ping通)
Pinging 192.168.8.22 from ip interface 192.168.14.12 on 0/ge0 with 64 bytes of data
Reply from 192.168.8.22: bytes=64 rtt=5ms ttl=91
Reply from 192.168.8.22: bytes=64 rtt=5ms ttl=91
Reply from 192.168.8.22: bytes=64 rtt=5ms ttl=91
Reply from 192.168.8.22: bytes=64 rtt=5ms ttl=91
Ping Statistics for 192.168.8.22:
        Packets: Sent = 4, Received = 4, Loss = 0 ( 0 percent loss)
        Min  RTT = 5ms, Max RTT = 5ms Average = 5ms
SW75_11:admin>fosconfig --enable fcr (開啟fc routing service)
SW75_11:admin>portcfg fciptunnel ge0 create 0 192.168.8.22 192.168.14.12 1000000(速率) -c(壓縮 -n(遠端wwn) 10:00:00:05:1b:a1:c3:74 -f(fastwrite) -t(tape pipelining)
SW75_11:admin> portshow fciptunnel all
Port: ge0
-------------------------------------------
        Tunnel ID 0
        Tunnel Description Not Configured
        Remote IP Addr 192.168.8.22
        Local IP Addr 192.168.14.12
        Remote WWN 10:00:00:05:1b:a1:c3:74
        Local WWN 10:00:00:05:1b:55:0c:ab
        Compression on
        Fastwrite on
        Tape Pipelining on
        Committed Rate 900000 Kbps (0.900000 Gbps)
        SACK on
        Min Retransmit Time 100
        Keepalive Timeout 80
        Max Retransmissions 9
        VC QoS Mapping off
        DSCP Marking (Control): 0, DSCP Marking (Data): 0
        VLAN Tagging Not Configured
        TCP Byte Streaming off
        Status : Active
        Connected Count: 3
        Uptime 1 hour, 21 minutes, 14 seconds
SW75_11:admin> portCfgPersistentEnable 16

2013年5月20日 星期一

linux無法開機:contains a file system with errors, check forced解決方式


Checking root filesystem
/contains a file system with errors,check forced.
/:
Unattached inode 34190
/:Unexpected inconsistency;run fsck manually
  (i.e,without -a or -p options)

***An error occurred during the file system check
***Dropping you to a shell;the system will reboot
***when you leave shell
Give root password for maintenance
(or type Control-D for normal startup):

輸入root密碼後,執行fcsk

#fcsk.ext3 -y /dev/sda1

-y(指所有問題都用yes)

修復完畢之後 
#reboot 

80~90%都可以正常開機。


使用方式 : fsck --help
fsck 1.35 (28-Feb-2004)
fsck.ext3: invalid option -- h
Usage: fsck.ext3 [-panyrcdfvstDFSV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j ext-journal]
[-E extended-options] device
Emergency help:
-p Automatic repair (no questions) ;自動修復
-n Make no changes to the filesystem ;模擬修復
-y Assume "yes" to all questions ;所有的問題都回答yes
-c Check for bad blocks and add them to the badblock list
;檢查損壞的區塊,並記錄
-f Force checking even if filesystem is marked clean
;對標記乾淨的區塊作詳細檢查v Be verbose ;詳細Log
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external-journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list



2013年4月16日 星期二

logrotate

建立編輯 /etc/logrotate.d/ 下的檔案,例如:

vim /etc/logrotate.d/asterisk

※執行 logrotate 會自動匯入/etc/logrotate.d/ 下的檔案執行

內容格式為:

/var/log/asterisk/messages {

weekly

size=100M

rotate 5

nocompress

}

※/var/log/asterisk/messages 為要進行處理的記錄檔

※weekly 為每週更換一次紀錄檔,另有 daily 每日、monthly 每月

※size=100M 為紀錄檔的上限,超過即會更換記錄檔,另有單位 k

※rotate 5 為保留紀錄檔的數量,檔名會以 messages.1~messages.5 方式命名,數字越大的越舊

※nocompress 為紀錄檔不壓縮,壓縮為 compress 

儲存後,可執行 logrotate -v -f /etc/logrotate.conf 來立即處理記錄檔的輪替



 一個典型的 logrotate.conf 如下:

errors root
compress

/var/log/httpd-access.log {
copytruncate
create 644 root wheel
weekly
rotate 7
uncompress
size=1000k
}

說明:

1. errors => 有錯誤時會 mail 一封信給 root
2. compress => 代表要使用 gzip 來壓縮
3. /var/log/http-access.log { .... } 代表一組設定
4. 在 {...} 外的表示內定值,如 compress 代表要透過 gzip 壓縮,但在 /var/log/httpd-access.log {....} 中,我們使用了 uncomress 則表示不壓縮 httpd-access.log 的備份檔
5. copytruncate => 先將日誌檔 copy 到另一個檔案儲存再清空
6. create ... => 產生一個新的 httpd-access.log 檔,644 root wheel 是這個檔案的權限設定
7. weekly 表示每個星期執行一次,另外尚有 daily 及 monthly 可用
8. rotate => 表示備份檔的數目,如 7 則最多會產生 1-7 個備份檔
9. uncompress => 不壓縮備份檔
10. size=1000k => 代表檔案大於 1000k 時就備份,另外也可使用 m 

2013年3月19日 星期二

TSM 基本使用指令

TSM 建立 node

tsm>reg node nodename password do=group con=email,user,2

------------------------------------------------------------------------------------------------------------
建立排程

DEFINE SCHEDULE group 排程名稱 TYPE=CLIENT ACTION=INCREMENTAL opt=-subdir=y OBJECTS='備份目錄路徑' SCHEDSTYLE=CLASSIC STARTDATE=03/15/2013  STARTTIME=01:15:00 PERIOD=1 PERUNITS=days PRIORITY=5 DURATION=1 DURUNITS=HOURS

------------------------------------------------------------------------------------------------------------
將node跟排程綁在一起

def assoc (group) (排程)  (nodename)

------------------------------------------------------------------------------------------------------------
查詢 group 下面有多少個節點

q node do=group

刪除節點

rem node nodename

-----------------------------------------------------------------------------------------------------------
查詢排程

q assoc

刪除排程

del sched group 排程名稱

----------------------------------------------------------------------------------------------------------
從IP查詢node

SELECT NODE_NAME, TCP_ADDRESS FROM NODES WHERE TCP_ADDRESS="192.168.0.0"