meatwiki メンテナンスのお知らせ

システムメンテナンスのため、7/20(土) 09:00-17:00 は、本Wikiをご利用いただけません。ご不便をおかけいたしますが、ご理解の程、よろしくお願いいたします。
子ページ
  • クラスタリング設定

比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。

...

...

...

パネル
titleconf/global.xml の修正

<!-- Use this file to define any custom beans needed globally. -->
<bean id="shibboleth.JPAStorageService"
      class="org.opensaml.storage.impl.JPAStorageService"
      p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}"
      c:factory-ref="shibboleth.JPAStorageService.entityManagerFactory" />

<bean id="shibboleth.JPAStorageService.entityManagerFactory"
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
     <property name="packagesToScan" value="org.opensaml.storage.impl" />
     <property name="dataSource" ref="shibboleth.MySQLDataSource" />
     <property name="jpaVendorAdapter" ref="shibboleth.JPAStorageService.JPAVendorAdapter" />
     <property name="jpaDialect">
          <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
     </property>
</bean>

<bean id="shibboleth.JPAStorageService.JPAVendorAdapter"
      class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
      p:database="MYSQL" />

<bean id="shibboleth.MySQLDataSource"
      class="org.apache.tomcat.dbcp.dbcp.BasicDataSource"
      p:driverClassName="com.mysql.jdbc.Driver"
      p:url="jdbc:mysql://db.example.ac.jp:3306/shibboleth"
      p:username="shibboleth"
      p:password="shibpassword"
      p:maxActive="10"
      p:maxIdle="5"
      p:maxWait="15000"
      p:testOnBorrow="true"
      p:validationQuery="select 1"
      p:validationQueryTimeout="5" />

...

  1. LVSサーバにkeepalivedとipvsadmをインストールします。

    パネル
    titlekeepalivedのインストール

    # yum install keepalived ipvsadm

  2. keepalivedの設定を行います。

    パネル
    titlekeepalived.confの設定

    global_defs {
       notification_email {
           root@localhost
       }
       notification_email_from lvs@lvs.example.ac.jp
       smtp_server 127.0.0.1
       smtp_connect_timeout 30
       router_id lvs.example.ac.jp
    }


    vrrp_instance VI_1 {

       state BACKUP
       interface eth0
       virtual_router_id 51    # 他のVRRPの値と重複しないようにすること
       priority 200
       advert_int 1
       authentication {
           auth_type PASS
           auth_pass 1111      # 任意のパスワード(最大8文字)
       }
       virtual_ipaddress {
           203.0.113.10/24 dev eth0
       }
       nopreempt
    }


    virtual_server 203.0.113.10 443 {

       delay_loop 5
       lvs_sched sh
       lvs_method DR
       protocol TCP


       real_server 203.0.113.11 443 {

           weight 1
           SSL_GET {
               url {
                   path /idp/css/main.css
                   status_code 200
               }
               connect_port 443
               connect_timeout 3
               nb_get_retry 3
               delay_before_retry 3
           }
       }
       real_server 203.0.113.12 443 {
           weight 1
           SSL_GET {
               url {
                   path /idp/css/main.css
                   status_code 200
               }
               connect_port 443
               connect_timeout 3
               nb_get_retry 3
               delay_before_retry 3
           }
       }
    }


    virtual_server 203.0.113.10 8443 {

       delay_loop 5
       lvs_sched sh
       lvs_method DR
       protocol TCP


       real_server 203.0.113.11 8443 {

           weight 1
           SSL_GET {
               url {
                   path /idp/css/main.css
                   status_code 200
               }
               connect_port 443
               connect_timeout 3
               nb_get_retry 3
               delay_before_retry 3
           }
       }
       real_server 203.0.113.12 8443 {
           weight 1
           SSL_GET {
               url {
                   path /idp/css/main.css
                   status_code 200
               }
               connect_port 443
               connect_timeout 3
               nb_get_retry 3
               delay_before_retry 3
           }
       }
    }

  3. keepalivedを起動します。

    パネル
    titlekeepalivedの起動

    # chkconfig keepalived on
    # chkconfig --list keepalived
    keepalived     0:off 1:off 2:on 3:on 4:on 5:on 6:off
    # service keepalived start

  4. keepalivedが正しく動作しているか確認します。

    パネル
    titlekeepalivedの動作確認

    # ipvsadm -L -n
    IP Virtual Server version 1.2.1 (size=4096)
    Prot LocalAddress:Port Scheduler Flags
      -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
    TCP 203.0.113.10:443 sh
      -> 203.0.113.11:443             Local   1      0          0
      -> 203.0.113.12:443             Local   1      0          0
    TCP 203.0.113.10:8443 sh
      -> 203.0.113.11:8443            Local   1      0          0
      -> 203.0.113.12:8443            Local   1      0          0

     

    # ip addr show dev eth0 scope global
    2: eth0: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
        inet 203.0.113.1/24 brd 203.0.113.255 scope global eth0
        inet 203.0.113.10/24 scope global secondary eth0

...

  1. keepalivedの設定を行います。

    パネル
    titlekeepalived.confの設定

    global_defs {
       notification_email {
           root@localhost
       }
       notification_email_from vrrp@idp1.example.ac.jp
       smtp_server 127.0.0.1
       smtp_connect_timeout 30
       router_id idp1.example.ac.jp
    }

    vrrp_instance VI_1 {
       state BACKUP
       interface eth0
       virtual_router_id 51    # 他のVRRPの値と重複しないようにすること
       priority 200
       advert_int 1
       authentication {
           auth_type PASS
           auth_pass 1111      # 任意のパスワード(最大8文字)
       }
       virtual_ipaddress {
           203.0.113.10/24 dev eth0
       }
       nopreempt
       smtp_alert
    }


    virtual_server 203.0.113.10 443 {
       delay_loop 5
       lvs_sched sh
       lvs_method NAT
       protocol TCP


       real_server 127.0.0.1 443 {
           weight 1
           notify_down "/sbin/service keepalived stop"
           SSL_GET {
               url {
                   path /idp/css/main.css
                   status_code 200
               }
               connect_port 443
               connect_timeout 3
               nb_get_retry 3
               delay_before_retry 3
           }
       }
    }

  2. keepalivedを起動します。

    パネル
    titlekeepalivedの起動

    # chkconfig keepalived on
    # chkconfig --list keepalived
    keepalived     0:off 1:off 2:on 3:on 4:on 5:on 6:off
    # service keepalived start

  3. keepalivedが正しく動作しているか確認します。

    パネル
    titlekeepalivedの動作確認

    # ipvsadm -L -n
    IP Virtual Server version 1.2.1 (size=4096)
    Prot LocalAddress:Port Scheduler Flags
      -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
    TCP 203.0.113.10:443 sh
      -> 127.0.0.1:443                Local   1      0          0

    # ip addr show dev eth0 scope global
    2: eth0: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
        inet 203.0.113.11/24 brd 203.0.113.255 scope global eth0
        inet 203.0.113.10/24 scope global secondary eth0

...

  1. keepalivedの設定を行います。

    パネル
    titlekeepalived.confの設定

    global_defs {
       notification_email {
           root@localhost
       }
       notification_email_from vrrp@idp2.example.ac.jp
       smtp_server 127.0.0.1
       smtp_connect_timeout 30
       router_id idp2.example.ac.jp
    }

    vrrp_instance VI_1 {
       state BACKUP
       interface eth0
       virtual_router_id 51    # idp1と同じ値とすること
       priority 100
       advert_int 1
       authentication {
           auth_type PASS
           auth_pass 1111      # idp1と同じ値とすること
       }
       virtual_ipaddress {
           203.0.113.10/24 dev eth0
       }
       nopreempt
       smtp_alert
    }


    virtual_server 203.0.113.10 443 {
       delay_loop 5
       lvs_sched sh
       lvs_method NAT
       protocol TCP


       real_server 127.0.0.1 443 {
           weight 1
           notify_down "/sbin/service keepalived stop"
           SSL_GET {
               url {
                   path /idp/css/main.css
                   status_code 200
               }
               connect_port 443
               connect_timeout 3
               nb_get_retry 3
               delay_before_retry 3
           }
       }
    }


  2. keepalivedを起動します。

    パネル
    titlekeepalivedの起動

    # chkconfig keepalived on
    # chkconfig --list keepalived
    keepalived     0:off 1:off 2:on 3:on 4:on 5:on 6:off
    # service keepalived start


  3. keepalivedが正しく動作しているか確認します。

    パネル
    titlekeepalivedの動作確認

    # ipvsadm -L -n
    IP Virtual Server version 1.2.1 (size=4096)
    Prot LocalAddress:Port Scheduler Flags
      -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
    TCP 203.0.113.10:443 sh
      -> 127.0.0.1:443                Local   1      0          0

    # ip addr show dev eth0 scope global
    2: eth0: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
        inet 203.0.113.12/24 brd 203.0.113.255 scope global eth0