Chinaunix首页 | 论坛 | 博客
  • 博客访问: 360860
  • 博文数量: 135
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1106
  • 用 户 组: 普通用户
  • 注册时间: 2013-03-20 09:56
文章分类

全部博文(135)

文章存档

2017年(3)

2016年(18)

2015年(69)

2014年(39)

2013年(6)

我的朋友

分类: Sybase

2014-12-05 12:14:00

1.安装sybase软件

分别在ha01和ha02装sybase软件

2.网络规划

sybase-iq multiplex各个节点事务处理时有数据交互问题,需要规划提供sybase服务的网络

1)ha01节点:

# for sybase-iq multiplex
192.168.100.15 sybase-coordinator
192.168.100.16 sybase-w1
127.0.0.1      sybase-coordinator

2)ha02节点:

# for sybase-iq multiplex
192.168.100.15 sybase-coordinator
192.168.100.16 sybase-w1
127.0.0.1      sybase-w1

3.启动提供sybase服务的浮动ip

1) ha01节点:

# ifconfig eth1:0 192.168.100.15 netmask 255.255.255.0

2) ha02节点:

#ifconfig eth1:0 192.168.100.16 netmask 255.255.255.0

4.在ha01节点安装实例

只需要在协调节点安装,写节点后续从协调节点备份。

参考:

(info)约定数据库名为sybase.db

说明:一般实例会装在共享存储上,因此sybase用户需要有对共享存储挂载点的读写权限。

5.编辑数据库启动的配置文件

# vim sybase.cfg
-n sybase_coordinator
 -c 48
-gc 20
-gd all
-gl all
-gm 10
-gp 4096
-p 8192
-iqtc 12288
-iqmsgsz 512
-iqmsgnum 4

说明:这里以构建两节点的multiplex为例讲解。(ha01和ha02),将ha01作为sybase-coordinator(协调节点),ha02作为sybase-w1(写节点)

1.安装sybase软件

分别在ha01和ha02装sybase软件

参考:

2.网络规划

sybase-iq multiplex各个节点事务处理时有数据交互问题,需要规划提供sybase服务的网络

1)ha01节点:


# for sybase-iq multiplex
192.168.100.15 sybase-coordinator
192.168.100.16 sybase-w1
127.0.0.1      sybase-coordinator


2)ha02节点:


# for sybase-iq multiplex
192.168.100.15 sybase-coordinator
192.168.100.16 sybase-w1
127.0.0.1      sybase-w1


3.启动提供sybase服务的浮动ip

1) ha01节点:

# ifconfig eth1:0 192.168.100.15 netmask 255.255.255.0

2) ha02节点:

 #ifconfig eth1:0 192.168.100.16 netmask 255.255.255.0

4.在ha01节点安装实例

只需要在协调节点安装,写节点后续从协调节点备份。

参考:

(info)约定数据库名为sybase.db

说明:一般实例会装在共享存储上,因此sybase用户需要有对共享存储挂载点的读写权限。

5.编辑数据库启动的配置文件

# vim sybase.cfg
-n sybase_coordinator
 -c 48
-gc 20
-gd all
-gl all
-gm 10
-gp 4096
-p 8192
-iqtc 12288
-iqmsgsz 512
-iqmsgnum 4
(info)-n指数据库服务器名称

6.在ha01节点启动并登陆数据库服务器

#stop_iq -stop all
#start_iq -STARTDIR /sybase/instance/ @sybase.cfg  -x "tcpip{host=sybase-coordinator;port=4888}" sybase.db

(info)在启动数据库之前需要先停止utility_db,约定协调节点的主机名为sybase-coordinator,数据库服务器名为sybase_coordinator。

(info)/sybase/instance为实例的挂在点,即实例的安装目录

7.在协调节点ha01添加辅助节点(写节点)

#dbisql  -c "uid=DBA;pwd=sql;eng=sybase_coordinator;links=tcpip"  -nogui
#CREATE MULTIPLEX SERVER sybase_w1 DATABASE '/sybase/instance/sybase.db' HOST 'sybase-w1' PORT 4888 ROLE WRITER STATUS INCLUDED
#start_iq --STARTDIR /sybase/instance/ @sybase.cfg  -x "tcpip{host=sybase-coordinator;port=4888}" sybase.db
(info)在添加完第一个写节点后,协调节点的数据库服务器会停掉。

8.在辅助节点安装数据库实例

#su - sybaseiq
#cd /sybase/instance
#dbbackup -y -d -c "uid=DBA;pwd=sql;eng=sybase_coordinator;links=tcpip{host=sybase-coordinator;port=4888}" /sybase/instance/
(info)sybaseiq用户需要有对/sybase/instance/的读写权限

9.启动写节点的数据库服务器

# scp sybase.cfg ha02:/sybase/instance/
# start_iq -STARTDIR /sybase/instance/ @sybase.cfg -x "tcpip{host=sybase-w1;port=4888}" sybase.db
(info)需要协调节点的sybase.cfg拷贝写节点的实例目录中,并更改数据库服务器名。

10.在协调节点查看multiplex状态

(DBA)> sp_iqmpxinfo
server_id  server_name                                                                                                                      connection_info                                                                                                                                                                                                                                                  db_path                                                                                                                                                                                                                                                          role             status   mpx_mode         inc_state                                        coordinator_failover                                                                                                             current_version      active_versions                                                                                                                                                                                                                                                  private_connection_info                                                                                                                                                                                                                                          mipc_priv_state  mipc_public_state
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1          sybase_coordinator                                                                                                               host=sybase-coordinator:4888                                                                                                                                                                                                                                     /sybase/instance/sybase.db                                                                                                                                                                                                                                       coordinator      included coordinator      N/A                                              sybase_w1                                                                                                                        0                    (NULL)                                                                                                                                                                                                                                                           (NULL)                                                                                                                                                                                                                                                           active           active           
2          sybase_w1                                                                                                                        host=sybase-w1:4888                                                                                                                                                                                                                                              /sybase/instance/sybase.db                                                                                                                                                                                                                                       writer           included writer           active                                           sybase_w1                                                                                                                        0                    (NULL)                                                                                                                                                                                                                                                           (NULL)                                                                                                                                                                                                                                                           not responding   active           
 
(2 rows)
 
Execution time: 0.077 seconds
 

(info)sybase_coordinator的host可能不正确,需要我们手动修改:alter multiplex server sybase_coordinator host 'sybase-coordinator' port 4888;

(info)需要关注: role status ,mpx_mode这两个字段的正确性是否是我们预想的状态。


阅读(1141) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~