1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>

Thin Client Server

Thin Client Server

Linux Authentication

Linux Authentication

Linux Internet Gateway

UPS Server

Written by Mr. Sontaya Photibut Saturday, 02 May 2009 16:24

ารติดตั้ง UPS Server กับ Client หลายตัวแบบ NIS Server (APC UPS)

ต้อง ต่อกันเป็นแบบ NIS แยกเป็น NIS server และ NIS client ตัว NIS server คือ Server (192.168.1.13) ที่มี UPS ต่อผ่านในที่นี่เป็น USB Port ซึ่งจะมีการรับส่งสัญญาณกับ UPS โดยตรง ส่วน NIS client (192.168.1.21) คือ server ที่ไม่มีการต่อผ่าน UPS โดยตรง แต่อาศัยการรับสัญญาณจาก NIS server เท่านั้น ในระบบหนึ่งๆจะมี NIS server เพียงตัวเดียว แต่มี NIS client ที่เป็นสมาชิกได้หลายๆตัว

Download : http://software.susethailand.com/

1. UPS Server ( NIS Server)

# wget http://www.susethailand.com/public/sles/x86_64/apcupsd/apcupsd-3.12.1-18.2.x86_64.rpm

# vim /etc/apcupsd/apcupsd.conf

UPSCABLE usb

UPSTYPE usb

DEVICE 

UPSCLASS standalone

UPSMODE disable

NETSERVER on

NISIP 192.168.1.13

NISPORT 3551

# yast runlevel (apcupsd)


2. UPS NIS Client (ต้องติดตั้ง gd package ก่อนนะครับ ติดตั้งจาก YaST)

# wget http://www.susethailand.com/public/sles/x86_64/apcupsd/apcupsd-3.12.1-18.2.x86_64.rpm

# vim /etc/apcupsd/apcupsd.conf

UPSCABLE ether

UPSTYPE net

DEVICE 192.168.1.13:3551

NISPORT 3551

NETSERVER on

UPSMODE disable

# yast runlevel (apcupsd)


3. ทดสอบ NIS Server (192.168.1.13)

# apcaccess status

หากมีข้อความฟ้องว่า

#FATAL ERROR in apcaccess.c at line 243

tcp_open: cannot connect to server localhost on port 3551.

ERR=Connection refused

รอสัก 1 นาที แล้วสั่งคำสั่งเดิมอีกครั้ง

APC : 001,026,0616

DATE : Fri Jul 04 17:20:56 ICT 2008

HOSTNAME : bcscrouter1

RELEASE : 3.12.1

VERSION : 3.12.1 (06 January 2006) suse

UPSNAME : bcscrouter1

CABLE : USB Cable

MODEL : USB UPS Driver

UPSMODE : Stand Alone

STARTTIME: Fri Jul 04 16:57:32 ICT 2008

STATUS : ONLINE

BCHARGE : 070.0 Percent

TIMELEFT : 13.0 Minutes

MBATTCHG : 5 Percent

MINTIMEL : 3 Minutes

MAXTIME : 0 Seconds

NUMXFERS : 0

TONBATT : 0 seconds

CUMONBATT: 0 seconds

XOFFBATT : N/A

STATFLAG : 0x07000008 Status Flag

MANDATE : 2003-01-24

SERIALNO :

BATTDATE : 2003-01-24

NOMBATTV : 12.0

APCMODEL :

END APC : Fri Jul 04 17:21:57 ICT 2008


ตรวจสอบ Logfile 

# tail -f /var/log/apcupsd.events

Fri Jul 04 16:59:52 ICT 2008 apcupsd 3.12.1 (06 January 2006) suse startup succeeded

 

4. ทดสอบที่ NIS Client (192.168.1.21)

# apcaccess status

APC : 001,026,0616

DATE : Fri Jul 04 17:24:57 ICT 2008

HOSTNAME : bcscrouter1

RELEASE : 3.12.1

VERSION : 3.12.1 (06 January 2006) suse

UPSNAME : bcscrouter1

CABLE : USB Cable

MODEL : USB UPS Driver

UPSMODE : Stand Alone

STARTTIME: Fri Jul 04 16:57:32 ICT 2008

STATUS : ONLINE

BCHARGE : 070.0 Percent

TIMELEFT : 13.0 Minutes

MBATTCHG : 5 Percent

MINTIMEL : 3 Minutes

MAXTIME : 0 Seconds

NUMXFERS : 0

TONBATT : 0 seconds

CUMONBATT: 0 seconds

XOFFBATT : N/A

STATFLAG : 0x07000008 Status Flag

MANDATE : 2003-01-24

SERIALNO :

BATTDATE : 2003-01-24

NOMBATTV : 12.0

APCMODEL :

END APC : Fri Jul 04 17:25:58 ICT 2008


ตรวจสอบ Logfile 

# tail -f /var/log/apcupsd.events

Communications with UPS restored.

command :
#apctest
#ps fax | grep apcupsd
#apcaccess status
--------------------------------------------------------------------------------------------
Log Slave: tail -f /var/log/apcupsd.events
--------------------------------------------------------------------------------------------
Setting up and Testing the CGI Programs

https://192.168.1.13/cgi-bin/multimon.cgi

Not available: upsfetch: tcp_open failed for 127.0.0.1 port 3551

--------------------------------------------------------------------------------------------
Solution :
1. Firewall
find : function set_basic_rules()

# vim /sbin/SuSEfirewall
   # APCUPS
   $IPTABLES -A INPUT -i eth1 -p tcp -m tcp --dport 3551 --syn -j ACCEPT


2. hosts
# vim /etc/apcupsd/hosts.conf
Comment
# MONITOR 127.0.0.1 "Local Host"
Additional
  MONITOR 192.168.1.13:3551 "Server"

Test again : https://192.168.1.13/cgi-bin/multimon.cgi

Image

Image

 

เป็นอันเสร็จครับ.

อ้างอิจจาก :http://www.apcupsd.org/manual/manual.html#SECTION000131000000000000000






Comments (0)Add Comment

Write comment

security code
Write the displayed characters


busy
 

SUSE Linux Enterprise Cool Solutions

  • SLES 11 and High Availability Extension (HAE) with DLM, O2CB and SSH stonith

    In this scenario I will be setting up Novell High Availability Extension (HAE) on SLES 11. I will also demonstrate how to setup dlm, o2cb and SSH stonith.

    Some items that I have pre-configured are as follows.

    1. 1 SMT server
    2. 3 server installed with SLES 11 and HAE as a add-on product.

      Please see the following link:
      http://www.novell.com/documentation/sle_ha/book_sleha/data/part_install.html

    3. Each SLES 11 HAE server is fully patched with the latest code from my SMT server(2/24/10)
    4. Networking is setup as demonstrated in the following picture.

    Assumptions:

    In this document I assume the reader has some basic knowledge of quorm, fencing, and resource attributes. That said I will show each step with a screen shot during resource configuration. Although this document could be adopted into a production environment; I assume that this document will only be used in a test environment and for learning purposes only.

    Warning:

    During resource configuration I setup a ssh-stonith resource. As noted in the documentation this resource should not be used in production. Please also note that Novell will not support the resource except in a test situation where a real stonith resource, such as ilo, DRAC card, external power supply or other such stonith resource is not available.

    DRAC card:

    ilo card:

    Setup of the previous environment:

    Edit the /etc/hosts and put entries into the hosts file for each node.

    Create a ssh-key for every node.

    For example:

    #:~> ssh-keygen 
    Generating public/private rsa key pair. 
    Enter file in which to save the key (/root/.ssh/id_rsa): 
    /root/.ssh/id_rsa already exists. 
    Overwrite (y/n)? y 
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /root/.ssh/id_rsa. 
    Your public key has been saved in /root/.ssh/id_rsa.pub. 
    The key fingerprint is: 
    9e:92:9c:01:9e:fd:fb:12:73:7d:a7:cc:e1:11:ad:7f root@hae1 
    The key's randomart image is: 
    +--[ RSA 2048]----+ 
    |                 | 
    |                 | 
    |    .          . | 
    |   . +        . .| 
    |    o o S  .   o | 
    |     . *o.. . = .| 
    |      = ++   = * | 
    |       ...    = E| 
    |        .o.     .| 
    +-----------------+ 
    
    

    Now copy that key to every node. You will need to repeat this process on each node so that all nodes trust each other.

    Example:

    #:~$ cd .ssh/
    #:~/.ssh$ ls
    authorized_keys  id_rsa  id_rsa.keystore  id_rsa.pub  id_work  known_hosts
    #:~/.ssh$
    
    #: scp id_rsa.pub root@hae2:/root/.ssh/id.rsa.hae1.pub
    
    

    Now go to HAE2 and type the following:

    HAE2 /root/home/.ssh/: cat id.rsa.hae1.pub >> authorized_keys
    
    

    Repeat this for each node. When you are finished you should be able to ssh to any node from any node without entering a password or pass-phrase.

    I will be following these instructions from the HAE documentation:
    http://www.novell.com/documentation/sle_ha/book_sleha/data/cha_ha_installation_yast.html

    1. Open yast > cluster and configure it as the following:

      Communication Channels

      Note: Each node will have its own Node ID: For HAE1 – 1, HAE2 - it will be 2 and HAE3 - 3

      Security

      Note: When you enable security you add protection to the cluster. When you generate the Authentication file you will need to copy it over to each node in the cluster.

      Service

    2. Copy the /etc/ais/authkey and /etc/ais/openais.conf to the other nodes in the server.

      For example:

      #: scp /etc/ais/openais.conf  root@HAE2:/etc/ais/openais.conf
      #: scp /etc/ais/openais.conf  root@HAE2:/etc/ais/openais.conf
      
      

      Note: Do this for each node.

      !Remember: Make sure to edit the openais.conf and match up the node id for the node you are on. For example. HAE1 will be 1 and HAE2 will be 2 and HAE3 will be 3. You can also do this via yast > cluster.

      Your cluster can now be started.

      #: rcopenais start
      
      

      Before you login to the cluster you will need to set hacluster's password on each node.

      #: passwd hacluster
      enter new password:
      
      

      Now you are set to login.

      #: crm_gui

    Creating a dlm resource:

    Under Resources click Add and choose Clone and then Ok.

    Once you have passed through to this point you will want to click "ok, ok, apply or ok". You will now have a dlm resource. We will now configure o2cb and then a stonith resource before starting dlm.

    configuring O2CB:

    Configuring ssh:

    Configuring resource order:

    Once you are all done you can apply the changes. You will now want to start you resources starting with your ssh-stonith then dlm and finally O2CB.

    Final results:

  • REMUS: XEN high availability easy!

    Have you heard about the REMUS project? It's a fantastic piece of code maintaining an exact copy of your XEN virtual machines on a backup host.

    Better yet: it's now incorporated into the XEN hypervisor and expected in the next major release!

    "The Remus project has just been incorporated into the Xen hypervisor. Developed at the University of British Columbia, Remus provides a thin layer that continuously replicates a running virtual machine onto a second physical host. Remus requires no modifications to the OS or applications within the protected VM: on failure, Remus activates the replica on the second host, and the VM simply picks up where the original system died. Open TCP connections remain intact, and applications continue to run unaware of the failure. It's pretty fun to yank the plug out on your web server and see everything continue to tick along. This sort of HA has traditionally required either really expensive hardware, or very complex and invasive modifications to applications and OSes."

    http://dsg.cs.ubc.ca/remus

  • Take a Trip Down Memory Lane - 10 Year Anniversary Timeline for SUSE Linux Enterprise Server for System z

    From the moment we introduced SUSE Linux Enterprise Server for the mainframe more than ten years ago, our commitment to helping you optimize on IBM System z has never wavered. Together, with our valued partner IBM, we’ve developed more Linux-for-mainframe innovations than any other provider, delivering the simplest, most cost-effective alternative server consolidation platform to x86 platforms available today. So, as the only distributor that’s been delivering an enterprise-class and fully supported Linux operating system since the very start of Linux on the mainframe, we can safely say that if history often repeats itself, the future looks even brighter.

    View the timeline today at: http://bit.ly/a8dW44

  • Ten Years On the Mainframe!

    Mainframes are about 40 years old. And as you probably know, several years ago mainframes were written off as expensive, dated computers that were capable of running only large business applications. Mainframe go south, many said. Not anymore - thanks to Linux!

    Linux on mainframes has evolved rapidly during the past 10 years - yes - 2010 is the 10th anniversary of Linux on the mainframe. The more, there has been shifting of dynamics with the System z10. IBM has done an excellent job with the price/performance ratio, and many companies that have gone through a cost per transaction analysis have determined that the z10 can process their transactions at half the cost of a distributed environment. And the new IBM System z Solution Edition for Enterprise Linux and the Enterprise Linux Server is an additional catalyst for bringing new workloads to Linux on the mainframe.

    Today, in general we see many companies taking a critical look at their existing and new workloads, and asking hard business questions to determine the best platform. These companies are recognizing they need outstanding RAS to manage their mission-critical workloads, and the mainframe uniquely fulfills this business requirement. And these companies are realizing that investing in a first move turns back in consequence - even more if they run Linux on their mainframes.

    SUSE Linux Enterprise Server for System z has been available since the very start of Linux on the mainframe - yes - 2010 it has its 10th anniversary, too. If you want to hear from happy customers running SUSE Linux Enterprise Server for System z on their mainframes why and how they do so, and learn more from our experts, you should consider to drop over at one of the upcoming conferences for System z.

    SHARE in Seattle
    March 14-18 2010, Washington State Convention and Trade Center, Washington

    Recommended sessions:

    • Linux System Management for the Mainframe System Programmer - Part 1&2 (Mark Post, Novell), Mar 15 1:30-4:00 PM Room 608
    • Using Logical Volume Manager (LVM) to Reduce the Hassle Managing Disk Space on Linux (Mark Post, Novell), Tue Mar 16 9:30-10:30 AM Room 609
    • Linux Installation Planning (Mark Post, Novell), Mar 16 3:00-4:00 PM, Room 609
    • What's New with SLES 11 on System z (Mark Post, Novell), Mar 18 9:30-10:30AM, Room 609
    • Linux on System z at Wells Fargo: Penguins Board the Stagecoach (Marcy Cortes, Wells Fargo Bank), Mar 17 1:30-2:30 PM, Room 611
    • Success with Linux on System z at Nationwide - Lessons Learned (Jim Vincent, Nationwide Insurance), Mar 17 3:00-4:00PM, Room 611
    • Linux Servers on System z: Benefits and Features of Virtualization in the Enterprise Data Center (Rick Barlow, Nationwide Insurance), Mar 17 4:30-5:30PM, Room 611

    For more information, see
    http://www.share.org/Events/UpcomingConference/tabid/349/Default.aspx

    Novell BrainShare Salt Lake City
    March 22-25 2010, Salt Palace Convention Center in Salt Lake City, Utah

    • ELS208 German Pension Fund Goes Linux: Legacy Application Migration to z/Linux with Minimal Risk (Falk-Oliver Bischoff, German Pension Fund/Florian Delonge, Clerity/Olaf Senger, IBM), Mar 22 11:30AM, Room 150 D/E
    • ELS206 Hands-on Workshop: Install SUSE Linux Enterprise Server on IBM System z (Richard Lewis, IBM), Mar 23 9AM-1PM and Mar 25 9AM-1PM, Room 255B
    • ELS310 What's New with Linux on System z (Richard Lewis, IBM/Ihno Krumreich, Novell), Mar 24, Room 251 F

    For more information, see: http://www.novell.com/brainshare/

    WAVV - World Alliance of VSE VM Linux
    April 9-13, 2010 Covington, Kentucky, Embassy Suites Cincinnati - River Center

    • Linux Installation Planning (Mark Post, Novell), Apr 10 3:00PM
    • Using Logical Volume Manager (Mark Post, Novell), Apr 12 11:45AM
    • What’s new with SLES 11 on System z (Mark Post, Novell), Apr 12 4:15PM

    For more information, see: http://www.wavv.org/

  • Almost there.... Drupal 6 Migration

    OK -- we're in Drupal 6 now, if you don't count the bugs ;-) The IS&T Team is working like mad to address all the issues, so patience remains a virtue.

    If by tomorrow you still see vestiges of strangeness, pop us an email at coolguys@novell.com<.

    Thank you for being so understanding all day long. You can't believe how many customizations we have in here...

    -- Susan

Sponsors List