我有一个带有 corosync nfs 集群(Ubuntu 18)的起搏器,我正在尝试缩短宽限期。
有没有办法让这些设置在/etc/default/nfs-kernel-server
起搏器或起搏器中持久存在?
echo '10' > /proc/fs/nfsd/nfsv4leasetime
echo '10' > /proc/fs/nfsd/nfsv4gracetime
echo '10' > /proc/sys/fs/nfs/nlm_grace_period
我有一个带有 corosync nfs 集群(Ubuntu 18)的起搏器,我正在尝试缩短宽限期。
有没有办法让这些设置在/etc/default/nfs-kernel-server
起搏器或起搏器中持久存在?
echo '10' > /proc/fs/nfsd/nfsv4leasetime
echo '10' > /proc/fs/nfsd/nfsv4gracetime
echo '10' > /proc/sys/fs/nfs/nlm_grace_period
我最近用 helm 安装了 Kubernetes,并尝试在我的 Ubuntu 16.04 unity 上设置一个集群,我设置了 1 个主节点和 1 个从节点。
我删除了与 Kubernetes 相关的所有内容,但每次在终端中运行命令时,我都会收到此错误消息
unable to resolve host slave-node
如何解决?
我们有多个网站连接到正在运行的单个服务器,MariaDB - 10.3.11
并且由于负载过重,我们决定实施Galera Cluster replication
,已经实施,当数据库中的记录更新时我们得到了预期的结果。
我们需要在这些 Galera Cluster 节点之间分配流量(代替单个服务器连接),因此我们需要部署Galera Cluster Load Balancer
. 我们将它安装在一个新的服务器上,配置/etc/default/glbd
如下所示:(所有服务器运行在Ubuntu 16.04
.)
# This is a configuration file for glbd service script
#
# On Red Hat and derivatives it should be placed in /etc/sysconfig/glbd
#
# On Debian and derivatives it should be placed in /etc/default/glbd
#
# All settings besides LISTEN_ADDR are optional.
#
# Address to listen for client connections at. Mandatory parameter.
# To bind to all interfaces only port should be specified.
LISTEN_ADDR="3306"
# Address for controlling connection. Mandatory part is port.
# If not specified control socket will not be opened
CONTROL_ADDR="4444"
# Control FIFO name. It is opened always. glbd will refuse to start if
# this file already exists.
CONTROL_FIFO="/var/run/glbd.fifo"
# Number of threads (connection pools) to use. It is always a good idea
# to have a few per CPU core.
THREADS="3"
# Maximum connections. System open files limit will be modified to accommodate
# at least that many client connections provided sufficient privileges.
# Normally you should set it if you plan to go above 500.
#MAX_CONN=
# Target servers for client connections, space separated.
# Target specification: IP[:PORT[:WEIGHT]] (WEIGHT and PORT optional)
# WEIGHT defaults to 1, PORT defaults to LISTEN_ADDR port.
DEFAULT_TARGETS="node1_ip:3306:1 node2_ip:3306:1 node3_ip:3306:1"
# Other glbd options if any as they would appear on the command line.
OTHER_OPTIONS="--round"
我们假设LISTEN_ADDR
为 3306,因为我们需要将数据库连接与安装了 Galera Cluster Load Balancer 的新服务器切换并在 3306 上侦听以代替单个服务器(运行 MariaDB)。如果我们对端口的猜测是错误的,请纠正我们。
Section A
Section B
在下图中定义了当前架构并定义了提议的架构更改:
这是服务启动时 Galera Cluster Load Balancer 的日志。
Jan 24 12:49:54 galera-lb-server systemd[1]: Starting LSB: run glbd daemon...
Jan 24 12:49:54 galera-lb-server glb[12112]: [Thu Jan 24 12:49:54 UTC 2019] glbd: starting...
Jan 24 12:49:54 galera-lb-server glb[12112]: INFO: glb_daemon.c:44: Changing effective user to 'daemon'
Jan 24 12:49:54 galera-lb-server glb[12112]: glb v1.0.1 (epoll)
Jan 24 12:49:54 galera-lb-server glb[12112]: Incoming address: 0.0.0.0:3306, control FIFO: /var/run/glbd.fifo
Jan 24 12:49:54 galera-lb-server glb[12112]: Control address: 127.0.0.1:4444
Jan 24 12:49:54 galera-lb-server glb[12112]: Number of threads: 3, max conn: 493, nodelay: ON, keepalive: ON, defer accept: OFF, linger: OFF, daemon: YES, lat.count: 0, policy: 'round-robin', top: NO, verbose: NO
Jan 24 12:49:54 galera-lb-server glb[12112]: Destinations: 3
Jan 24 12:49:54 galera-lb-server glb[12112]: 0: node1_ip:3306 , w: 1.000
Jan 24 12:49:54 galera-lb-server glb[12112]: 1: node2_ip:3306 , w: 1.000
Jan 24 12:49:54 galera-lb-server glb[12112]: 2: node3_ip:3306 , w: 1.000
Jan 24 12:49:54 galera-lb-server glb[12112]: glb v1.0.1 (epoll)
Jan 24 12:49:54 galera-lb-server glb[12112]: Incoming address: 0.0.0.0:3306, control FIFO: /var/run/glbd.fifo
Jan 24 12:49:54 galera-lb-server glb[12112]: Control address: 127.0.0.1:4444
Jan 24 12:49:54 galera-lb-server glb[12112]: Number of threads: 3, max conn: 493, nodelay: ON, keepalive: ON, defer accept: OFF, linger: OFF, daemon: YES, lat.count: 0, policy: 'round-robin', top: NO, verbose: NO
Jan 24 12:49:54 galera-lb-server glb[12112]: Destinations: 3
Jan 24 12:49:54 galera-lb-server glb[12112]: 0: node1_ip:3306 , w: 1.000
Jan 24 12:49:54 galera-lb-server glb[12112]: 1: node2_ip:3306 , w: 1.000
Jan 24 12:49:54 galera-lb-server glb[12112]: 2: node2_ip:3306 , w: 1.000
Jan 24 12:49:54 galera-lb-server glbd[12133]: glb_main.c:194: Started.
Jan 24 12:49:54 galera-lb-server glb[12112]: [Thu Jan 24 12:49:54 UTC 2019] glbd: started, pid=12133
Jan 24 12:49:54 galera-lb-server systemd[1]: Started LSB: run glbd daemon.
但是我们注意到日志中的错误如下:
Jan 24 13:36:58 galera-lb-server glbd[12133]: glb_pool.c:687: Async connection to node1_ip:3306 failed: 111 (Connection refused)
Jan 24 13:36:58 galera-lb-server glbd[12133]: glb_pool.c:699: Reconnecting to node1_ip:3306
这是输出service glb getinfo
root@galera-lb-server:/# service glb getinfo
Router:
------------------------------------------------------
Address : weight usage map conns
node1_ip:3306 : 1.000 0.000 N/A 0
node2_ip:3306 : 1.000 0.000 N/A 0
node3_ip:3306 : 1.000 0.000 N/A 0
------------------------------------------------------
Destinations: 3, total connections: 0 of 493 max
我们可以直接将不同的网站组连接到复制中的任何一个节点,但这不是正确的方法。请告诉我们如何部署,如果我们在这里遗漏任何东西,请告诉我们。
我正在尝试在服务器上添加一个 mysql 服务器作为 drbd 资源,我已经按照本教程
进行了更多操作,我在主服务器上完成了以下 sql,
grant all on mysql.user TO ‘crm’@’%’ IDENTIFIED BY ‘password’;
grant all on mysql.user TO ‘crm’@’localhost’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'password';
其中密码是实际密码,ip 是我也禁用的另一个节点的 ip mysql服务器的apparmor,我已经覆盖了mysql服务器自动启动的任何方式,我还尝试通过在第二个节点echo "manual" >> /etc/init/mysql.override
上将mysql文件夹的权限放在drbd挂载权上。chmod 777 /service/mysql
我还移动了套接字并将 mysql 资源更改为 ocf 资源,并在 crm 配置中定义了新的套接字目录。
现在我可以登录到第一个节点上的数据库,但是当发生故障转移时,我无法登录到第二个节点上的数据库,而是收到#2002 - No such file or directory<br />The server is not responding (or the local server's socket is not correctly configured).
错误消息,当尝试通过 cli 登录时,我在第一个服务器上也收到此错误
我觉得有趣和奇怪的是,在节点上我可以登录数据库 systemctl status mysql
返回
未运行,而在节点上我无法登录数据库相同的命令返回运行