【国产数据库】GBase学习② - 配置调整

1.配置主机名映射

配置三个节点的 IP 主机名映射
编辑三个节点的 hosts 文件

# vi /etc/hosts
将以下三行信息追加到 hosts 文件中
192.168.56.199  gbase8c_private
192.168.56.200	gbase8c_1
192.168.56.201	gbase8c_2
192.168.56.202	gbase8c_3

2.创建 DBA 用户

每个节点都要创建 DBA 用户

# useradd gbase
# passwd gbase

3.为DBA用户配置权限

添加gbase 用户至sudoer 列表,三个节点都要执行如下操作:

# visudo
#打开 sudoer 配置文件,找到 “root ALL=(ALL) ALL” 行,在下方增加
“gbase ALL=(ALL) NOPASSWD:ALL”
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
gbase ALL=(ALL) NOPASSWD:ALL

4.配置gbase用户ssh互信

每个节点都要执行以下命令:

(1) 切换到 gbase 用户下
# su - gbase
(2) 创建秘钥目录和必要的授权
$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
(3) 生成秘钥文件(连续回车即可)
$ ssh-keygen -t rsa
(4) 将公钥文件上传至其他节点即可实现免密登录:
此操作需输入 gbase 的密码,所有节点都要执行——
$ ssh-copy-id gbase@192.168.56.199
$ ssh-copy-id gbase@192.168.56.200
$ ssh-copy-id gbase@192.168.56.201
$ ssh-copy-id gbase@192.168.56.202
$ echo 'StrictHostKeyChecking no' >> ~/.ssh/config; echo 'UserKnownHostsFile ~/.ssh/known_hosts' >> ~/.ssh/config; chmod 644 ~/.ssh/config

5.配置系统时间同步

(1) 主安装节点(192.168.56.200)作为 server
执行
$ vi /etc/ntp.conf
打开 NTP 服务配置文件,修改如下:
# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 192.168.56.200 nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
Fudge 127.127.1.0 stratum 10

ntp.conf 文件存盘退出后,执行
$ sudo service ntpd start # 启动NTP服务
$ sudo chkconfig ntpd on # 设置 NTP 服务开机自启



(2) 修改数据节点一(192.168.56.201)NTP 配置
执行
$ vi /etc/ntp.conf
打开 NTP 服务配置文件,修改如下:
# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 192.168.56.201 nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.56.200
Fudge 192.168.56.200 stratum 10

ntp.conf 文件存盘退出后,执行
$ sudo service ntpd start # 启动NTP服务
$ sudo chkconfig ntpd on # 设置 NTP 服务开机自启
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值