Quantcast
Channel: StackExchange Replication Questions
Viewing all 17268 articles
Browse latest View live

mysql_upgrade affect replication mariadb from mysql

$
0
0

I have one master (MySQL 5.7.29 ) and slave (MariaDB 10.4.12) I have a problem with events after inserting a dump to MariaDB from MySQL.

MariaDB [mysql]> show events;
ERROR 1545 (HY000): Failed to open mysql.event

select is working ok.

I follow this solution https://dba.stackexchange.com/a/206335/150896 but I didn't execute the drop table for event.

  1. Can I run mysql_upgrade on MariaDB? (The replication will have any problems?)
  2. If I drop the table and recreate the have a different structure from MySQL and the engine is Aria. They will affect the replication also?

What is the safest way to fix this? mysql_upgrade or drop and recreate the table?

Clean MariaDB

CREATE TABLE `event` (
  `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `name` char(64) NOT NULL DEFAULT '',
  `body` longblob NOT NULL,
  `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `execute_at` datetime DEFAULT NULL,
  `interval_value` int(11) DEFAULT NULL,
  `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_executed` datetime DEFAULT NULL,
  `starts` datetime DEFAULT NULL,
  `ends` datetime DEFAULT NULL,
  `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
  `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '',
  `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `originator` int(10) unsigned NOT NULL,
  `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
  `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `body_utf8` longblob DEFAULT NULL,
  PRIMARY KEY (`db`,`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Events'

Broken MariaDB

CREATE TABLE `event` (
  `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `name` char(64) NOT NULL DEFAULT '',
  `body` longblob NOT NULL,
  `definer` char(93) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `execute_at` datetime DEFAULT NULL,
  `interval_value` int(11) DEFAULT NULL,
  `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_executed` datetime DEFAULT NULL,
  `starts` datetime DEFAULT NULL,
  `ends` datetime DEFAULT NULL,
  `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
  `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
  `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `originator` int(10) unsigned NOT NULL,
  `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
  `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `body_utf8` longblob DEFAULT NULL,
  PRIMARY KEY (`db`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'

Best practice on re-initializing replication snapshot? [closed]

$
0
0

I have a transactional replication setup between 2 sql 2017 servers in order to provide a read-only replica to be used for reporting only. Pretty basic setup.

Are there any best practices of how often, if at all, a re-initialization of the subscription should be performed?

Thanks in advance

Transactional Replication breaks when schema is changed in Publisher

$
0
0

We have set up Transactional replication where in two Publishers feed into one Subscriber , now if try to change the schema of any one Publishers or both publishers, replication breaks. We have tried to pause the replication and change the schema in publisher as well as subscriber , but as soon as we re-start the replication it breaks.

Only option that we found is, we have to drop the replication, sync the schema and the start the snapshot replication.

Is there a better way of doing this?

MySql Replication on Windows

$
0
0

guys any one please give detailed document on Mysql Replication on Windows System.I replicated master to slave, but it is showing 'connecting to master' errorno showing as 1045 and 2003 its varying. please help me on this. thank you venugopal

Postgresql - archive_cleanup_command with multiple standby servers

$
0
0

Regarding the archive_cleanup_command command, the Postgresql 9.6 documentation states the following:

Note however that if multiple standby servers are restoring from the same archive directory, you will need to ensure that you do not delete WAL files until they are no longer needed by any of the servers.

Is there a built-in way that the master can know when all of the slaves do not need particular WAL files? Or does that functionality need to be added via scripting or other mechanism? If so, what would that look like?

Also, would it be typical to have an archive_cleanup_command on both the master and the slaves, or would the slaves even be archiving?

CDC and Transactional Replication

$
0
0

Has anyone seen this before with CDC and Transactional Replication, SQL 2016.

We restored a database onto a new system, restored the database using KEEP_CDC. The CDC data and history were there, capture and cleanup jobs were created and running fine as well. We then configured replication, and our historical CDC data was then removed. Replication and CDC were healthy from that point on, but we lost all of the prior CDC data. The workaround we found was to delete the capture job after the restore, then setup replication, and then recreate the capture job. This was the only method that would retain the prior CDC data while writing out the new. This seemed buggy to me, but I couldn't find much out in google. If anyone has any articles or anything that state the proper steps for migrating CDC and Replication, that would be helpful too. Thanks.

MySQL data changes are not logged in binary log files [closed]

$
0
0

I’m trying to setup a master-slave replication in MySQL 8.0. I have configured the servers as below:

I have started the slave by changing the master to appropriate binlog files and position. Slave started without any errors and started replicating for manually executed statements like CREATE TABLE,INSERT INTO. But when restoring a dumpfile, no binary logs are generated and repliacted to the slave.

Server1:my.cnf

gtid-mode=ON

enforce-gtid-consistency

binlog_format = row

log-slave-updates

Server2:my.cnf

gtid-mode=ON

enforce-gtid-consistency

relay-log = relay-log

read-only = ON

log-slave-updates

I have tried by changing the binlog_format to MIXED and binlog_db_db as well but of no use. Help would be much appreciated.

Replication error masked by sp_MSdetect_nonlogged_shutdown returning 'String or binary data would be truncated'

$
0
0

One of our replication jobs is failing on step 3, which runs sp_MSdetect_nonlogged_shutdown, returns a 'String or binary data would be truncated'. Which of course led us down the path of trying to find a problem in the databases. However we compared the two databases and they are identical. From what I can tell the error is actually a bug in sp_MSdetect_nonlogged_shutdown.

Eventually I checked the job again and step 2 was also failing and throwing a mini dump. When we looked at the dump it says:

the thread tried to read from or write to a virtual address for which it does not have the appropriate access

The id running the job is a SQL Id that is sysadmin, the step (2) is running under the agent service account. The service account has access to the snapshot directory. We have multiple other replication jobs using the same security setup that are working fine.

SQL Version:

Microsoft SQL Server 2016 (SP2-GDR) (KB4532097) - 13.0.5102.14 (X64) Dec 31 2019 22:39:35 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: ) (Hypervisor)

Anyone have any idea where I can find the permissions error? Or steps I can use to start narrowing it down?


recovery with binlogs?

$
0
0

I would like to know if there is a way that I can restore my databases, I don't have a replication and I would like to migrate my databases without downtime or losing data. So with binlogs could I do that? I have in my new server already a database but is kinda old, could this be possible. Thanks in advance

Rows deleted in the subscriber - what to do? - SQL Server Transactional Replication

$
0
0

Someone has delete by mistake a row of a table in the subscribed server/database.

I am getting the following error message:

The row was not found at the Subscriber when applying the replicated (null) command for Table '(null)' with Primary Key(s): (null) (Source: MSSQLServer, Error number: 20598)

Now I have restored the deleted row in the replicated server, but the distributor to the subscriber agent is taking so long to apply the changes (currently nearly 1.5 hours).

How can I make it do this update immediately?

enter image description here

Replicate_Do_DB and Replicate_Wild_Do_Table - Replication does not work

$
0
0

I have been tasked to set replication up on a slave host. The master database is a "data store" where tables are dropped, recreated, and reloaded on a daily basis.

My initial setup of the slave host worked fine by replication was always days behind the master. After talking to the users of the "data store", I realized that not all of the databases and not all of the tables need to be replicated over. So this is what I did

CI-DB002-PRD [root@localhost] ON (none)>  STOP SLAVE\G

CI-DB002-PRD [root@localhost] ON (none)> CHANGE REPLICATION FILTER REPLICATE_DO_DB = (bidw,cf2_fact,ct_fact,ez_fact,gt_fact,sfdc,soa_fact,tesla_fact,tmc_fact);

CI-DB002-PRD [root@localhost] ON (none)> CHANGE REPLICATION FILTER REPLICATE_WILD_DO_TABLE = ('bidw.domo%', 'bidw.consolidated%', 'bidw.cf2%', 'bidw.tesla%');

CI-DB002-PRD [root@localhost] ON (none)>  START SLAVE\G

Very quickly, replication caught up and now, the slave is 3-7 seconds behind the master.

But replication is not touching the databases I want to be replicated. Even though data changes on master every 10 minutes for the schemas I list above. I did several validation queries and results now differ. When I check the status of my slave, nothing stands out

CI-DB002-PRD [root@localhost] ON (none)> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Queueing master event to the relay log
                  Master_Host: 10.239.0.34
                  Master_User: ci02replicadb
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: binary-log.009871
          Read_Master_Log_Pos: 14678596
               Relay_Log_File: ci-db002-prd-relay-bin.007914
                Relay_Log_Pos: 814824
        Relay_Master_Log_File: binary-log.009871
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: bidw,cf2_fact,ct_fact,ez_fact,gt_fact,sfdc,soa_fact,tesla_fact,tmc_fact,staging,phoenix,data_science
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table: bidw.domo%,bidw.consolidated%,bidw.cf2%,bidw.tesla%,bidw.ez%,bidw.ct%,bidw.gt%,bidw.tmc%,bidw.did%,bidw.Shortened%,bidw.other_revenue%,bidw.revenue%,bidw.advanced_cohort%
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 814626
              Relay_Log_Space: 14679056
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 22
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: a485ab14-aa57-11ea-bef5-42010aef0022
             Master_Info_File: /data/mysql/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Reading event from the relay log
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.01 sec)

For "Replicate_Wild_Do_Table", I replicate only the tables listed there because the entire "bidw" database is lousy with junk tables.

What am I missing here? Am I not allowed to use both filters at the same time? I am on version 5.7.31.

MySQL group-replication error

$
0
0

We have MySQL 5.7 cluster with 4 nodes. We get a problem with one node in this cluster often.

Our applications write data to node1 and node1 replicates data to other 3 nodes. In node1, I keep getting this in /etc/log/mysqld.log

2020-08-17T04:03:07.709440Z 21269681 [Note] Aborted connection 21269681 to db: 'pro_sample' user: 'user_pro' host: 'node2.example.com' (Got an error reading communication packets)
2020-08-17T04:06:19.152707Z 21271865 [Note] Aborted connection 21271865 to db: 'pro_sample' user: 'user_pro' host: 'node2.example.com' (Got an error reading communication packets)

in my node1MySQL database, I get many sleep connections.

select * from INFORMATION_SCHEMA.PROCESSLIST where db ='pro_sample';

| 21270100 | user_pro | node2.example.com:45134 | pro_sample | Sleep   |  651 |              | NULL                                                                                           |
| 21270089 | user_pro | node2.example.com:45102 | pro_sample | Sleep   |  668 |              | NULL

and node2 is the server often goes offline and causing replica issue.

What do we missing here?

Replication in R is not resampling

$
0
0

I am basically trying to create a 2 stage bootstrap where clusters are sampled first and then households within the clusters are sampled and calculations are one on the newly sampled dataset. I want to repeat this process 1000 times. My code does the sampling, but the "replicate" is not resampling - meaning I am just getting the same results 1000 times rather than a slightly different results each time. Am I missing something with the replicate command? or is there a more appropriate command I could use?

require(sampling)
###pull dataset into R
population<- read.csv("DATA/TZA_population.csv") 
df <- read.csv ("DATA/TZA_Monduli_tt_true.csv")  

###create a function
library(data.table)
simulate <- function(tt_prev) {


###create cluster list
cluster <-1:60

###create cluster subset
selected_clusters <- c(sample(cluster,size = 30, replace = FALSE))

###using selected clusters create subset of households
cluster_subset <- subset(df,df$cluster_cluster %in% selected_clusters)
cluster_subset <- cluster_subset[order(cluster_subset$cluster_cluster,cluster_subset$household_id),]

#create list of unique household_ids from the selected clusters
list<- subset(cluster_subset,select = c(cluster_cluster,household_id))
list<- unique(list) 
order(list$cluster_cluster,list$household_id)

#randomly select the households within the selected clusters
library(plyr)
household_subset <-ddply(list,.(cluster_cluster),function(x) x[sample(nrow(x),20),])

#subset from the original dataset using the selected households and clusters
clean <- subset(df,df$household_id %in% household_subset$household_id)

#calculate prevalence
source("TT_Age_Sex_Simulation_40pls.R") 
}

r<- replicate(1000,simulate(),simplify = FALSE)
data.frame(r)

How can I stop master from starting itself as a slave (in addition to master) on reboot?

$
0
0

In a simple MySQL replication Master-Slave configuration I have a problem where Master tries to connect to itself as a slave on reboot.

So when I restart MySQL on Master, I see errors related to the same server trying to replicate to itself and I have to manually run mysql -e "STOP SLAVE;" every time I restart MySQL.

How can I disable slave on master for good?

Here's the relevant portion of my.cnf:

## Logging
binlog_format                   = mixed
log_bin                         = /var/log/mysql/mysql-bin.log
sync_binlog                     = 1
pid_file                        = /var/run/mysqld/mysqld.pid
log_error                       = /var/log/mysql/error.log
#general_log                     = 0
#general_log_file                = /var/log/mysql/general.log
slow_query_log                  = 1
slow_query_log_file             = /var/log/mysql/slow.log
long_query_time                 = 3
expire_logs_days                = 14

sql_mode                        = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# sql_mode                        = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

## Replication
server_id                       = 200

## Master Configuration
binlog-do-db                    = my_db_1
binlog-do-db                    = my_db_2
binlog-do-db                    = my_db_3
binlog-do-db                    = my_db_4
binlog-do-db                    = my_db_5
binlog-do-db                    = my_db_6

Also, when I run SELECT * FROM mysql.user; I don't see the repl user that's allegedly a "slave" on Master.

BUT, I do see that localhost has replication grants:

mysql> select Host, User, grant_priv, Repl_slave_priv, Repl_client_priv from mysql.user;
+-----------------+---------------+------------+-----------------+------------------+
| Host            | User          | grant_priv | Repl_slave_priv | Repl_client_priv |
+-----------------+---------------+------------+-----------------+------------------+
| localhost       | root          | Y          | Y               | Y                |
| localhost       | mysql.sys     | N          | N               | N                |

Here's an example of the errors I see on Reboot (before I run STOP SLAVE; on Master):

2016-09-01T15:22:23.845505Z 384 [Note] Access denied for user 'repl'@'192.168.100.200' (using password: YES)
2016-09-01T15:22:23.845761Z 1 [ERROR] Slave I/O for channel '': error connecting to master 'repl@192.168.100.200:3306' - retry-time: 30  retries: 8, Error_code: 1045
2016-09-01T15:22:50.191636Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 6843ms. The settings might not be optimal. (flushed=15210 and evicted=0, during the time.)

Apart from this, replication is running fine. Writes to Master show up flawlessly on the real, read-only, Slave.


Full my.cnf:

[mysql]
default_character_set           = utf8

[mysqld]
datadir                         = /var/lib/mysql
socket                          = /var/lib/mysql/mysql.sock

symbolic-links                  = 0

## Custom Configuration
skip_external_locking           = 1
skip_name_resolve
open_files_limit                = 20000

## Cache
thread_cache_size               = 16
query_cache_type                = 1
query_cache_size                = 256M
query_cache_limit               = 4M

## Per-thread Buffers
sort_buffer_size                = 32M
read_buffer_size                = 4M
read_rnd_buffer_size            = 8M
join_buffer_size                = 2M

## Temp Tables
tmp_table_size                  = 1024M
max_heap_table_size             = 1024M

## Networking
back_log                        = 250
max_connections                 = 512
max_connect_errors              = 100000
max_allowed_packet              = 128M
interactive_timeout             = 1800
wait_timeout                    = 1800
character_set_client_handshake  = FALSE
character_set_server            = utf8mb4
collation_server                = utf8mb4_unicode_ci

### Storage Engines
default_storage_engine          = InnoDB
innodb                          = FORCE

## MyISAM
key_buffer_size                 = 128M
myisam_sort_buffer_size         = 16M

## InnoDB
innodb_buffer_pool_size         = 46G
innodb_buffer_pool_instances    = 64
innodb_log_files_in_group       = 2
innodb_log_buffer_size          = 32M
innodb_log_file_size            = 64M
innodb_file_per_table           = 1
innodb_thread_concurrency       = 0
innodb_flush_log_at_trx_commit  = 1

## Logging
binlog_format                   = mixed
log_bin                         = /var/log/mysql/mysql-bin.log
sync_binlog                     = 1
pid_file                        = /var/run/mysqld/mysqld.pid
log_error                       = /var/log/mysql/error.log
#general_log                     = 0
#general_log_file                = /var/log/mysql/general.log
slow_query_log                  = 1
slow_query_log_file             = /var/log/mysql/slow.log
long_query_time                 = 3
expire_logs_days                = 14

sql_mode                        = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# sql_mode                        = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

## Replication
# Master Server ID:
server_id                       = 200
# Slave Server ID:
# server_id                       = 300

## Master Configuration
# Comment out on Slave
binlog-do-db                    = db_1
binlog-do-db                    = db_2
binlog-do-db                    = db_3
binlog-do-db                    = db_4
binlog-do-db                    = db_5
binlog-do-db                    = db_6

## Slave Configuration
# Uncomment the following on Slave
# relay-log                       = /var/log/mysql/mysql-relay-bin.log
# binlog-do-db                    = db_1
# binlog-do-db                    = db_2
# binlog-do-db                    = db_3
# binlog-do-db                    = db_4
# binlog-do-db                    = db_5
# binlog-do-db                    = db_6
# log_slave_updates               = 1
# read_only                       = 1
# slave_skip_errors               = 1062

[mysqld_safe]
datadir                         = /var/lib/mysql
socket                          = /var/lib/mysql/mysql.sock
symbolic-links                  = 0
pid_file                        = /var/run/mysqld/mysqld.pid
log_error                       = /var/log/mysql/error.log

MsMerge_genhistory has alot of rows with pubid = null

$
0
0

I have a merge replication and I am worried that the cleanup of metadata might not be enough. I have a retention period of 60 days and I can see thet the metadatacleanup-job do remove rows i msmege_genhistory that are older but only for rows that has the right guid in pubid. most of the rows, about 1,6 million, has the value NULL in pubid and I cannot figure out why. does anybody know why there is so many null-values?


UE4 change character visibility in listen server

$
0
0

I'm trying to make trap that spawns objects if character comes in area.

Spawning lots of object in runtime can occur so much overhead, so I attach spawned objects to the trap as a child actor.

If character comes in to area, child actor's visibility and collision are activated.

And I wish it works in multiplay using listen server.

Now I makes two sample spawn traps. One spawns some projectiles, the other does one character.

Everything works fine except spawned character is not visible, able to collision in host.

This is such a code that I wrote.

Update Projectile State

Update Character State

Each Update function is called when activate/inactivate each actor. Object is static mesh of projectile, Mesh is mesh of character. All of child actor component is replicated, and projectile has initialize process in initiallizer. I mean, set visibility and collision disable as a default value. Character is not, but I every tried and failed.

Now I think there are something special thing to character and I miss it.

In listen server, how to set visibility and collision of character? And what is different with Character and Actor about set visibility?

postgresql streaming replication - Master Server keeps all the archives and this is filling up my HD

$
0
0

Is there a way to run cleanups on Master Server for these archive WAL files that are older and are not needed for the slave server for streaming replication?

Calculating per second peak values after summing up individual values in clickhouse

$
0
0

I am currently using Clickhouse cluster (2 shards, 2 replicas) to read transaction logs from my server. The log contains fields like timestamp, bytes delivered, ttms, etc. The structure of my table is as below:

CREATE TABLE db.log_data_local ON CLUSTER '{cluster}' (
  timestamp DateTime,
  bytes UInt64,
  /*lots of other fields */
  ) ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/db/tables/logs/{shard}','{replica}')
PARTITION BY toYYYYMMDD(timestamp)
ORDER BY timestamp
TTL timestamp + INTERVAL 1 MONTH;

CREATE TABLE db.log_data ON CLUSTER '{cluster}'
AS cdn_data.http_access_data_local
ENGINE = Distributed('{cluster}','db','log_data_local',rand());

I am ingesting data from Kafka and using materialized view to populate this table. Now I need to calculate the peak throughput per second from this table. So basically I need to sum up the bytes field per second and then find the max value for a 5 minute period.

I tried using ReplicatedAggregatingMergeTree with aggregate functions for the throughput, but the peak value I get is much less compared to the value I get when I directly query the raw table.

The problem is, while creating the material view to populate the peak values, querying the distributed table directly is not giving any results but if I query the local table then only partial data set is considered. I tried using an intermediary table to compute the per-second total and then to create the materialized but I faced the same issue.

This is the schema for my peaks table and the materialized view I am trying to create:

CREATE TABLE db.peak_metrics_5m_local ON CLUSTER '{cluster}'
(
  timestamp DateTime,
  peak_throughput AggregateFunction(max,UInt64),
)
ENGINE=ReplicatedAggregatingMergeTree('/clickhouse/{cluster}/db/tables/peak_metrics_5m_local/{shard}','{replica}')
PARTITION BY toYYYYMMDD(timestamp)
ORDER BY (timestamp)
TTL timestamp + toIntervalDay(90);


CREATE TABLE db.peak_metrics_5m ON CLUSTER '{cluster}'
AS cdn_data.peak_metrics_5m_local
ENGINE = Distributed('{cluster}','db','peak_metrics_5m_local',rand());

CREATE MATERIALIZED VIEW db.peak_metrics_5m_mv ON CLUSTER '{cluster}'
TO db.peak_metrics_5m_local
AS SELECT
        toStartOfFiveMinute(timestamp) as timestamp,
        maxState(bytes)*8 as peak_throughput,
    FROM (
        SELECT 
            timestamp,
            sum(bytes) as bytes,
        FROM db.log_data_local
        GROUP BY timestamp
    )
    GROUP BY timestamp;

Please help me out with a solution to this.

MongoDB can't add new replica set member [rsSync] SEVERE: Got signal: 6

$
0
0

I have a replica set and I added a new member to the set. The initialSync begins for the new member and rs.status (on primary) shows STARTUP2 as status. However, after a long enough time, there's a cryptic fassert error coming on the new instance.

Log dump is as following:

2014-11-02T22:53:23.995+0000 [clientcursormon] mem (MB) res:330 virt:45842
2014-11-02T22:53:23.995+0000 [clientcursormon]  mapped (incl journal view):45038
2014-11-02T22:53:23.995+0000 [clientcursormon]  connections:27
2014-11-02T22:53:23.995+0000 [clientcursormon]  replication threads:32
2014-11-02T22:53:25.427+0000 [conn2012] end connection xx.xx.xx.xx:1201 (26 connections now open)
2014-11-02T22:53:25.433+0000 [initandlisten] connection accepted from xx.xx.xx.xx:1200 #2014 (27 connections now open)
2014-11-02T22:53:25.436+0000 [conn2014]  authenticate db: local { authenticate: 1, nonce: "xxx", user: "__system", key: "xxx" }
2014-11-02T22:53:26.775+0000 [initandlisten] connection accepted from xx.xx.xx.xx:1058 #2015 (28 connections now open)
2014-11-02T22:53:26.864+0000 [conn1993] end connection xx.xx.xx.xx:1059 (27 connections now open)
2014-11-02T22:53:29.090+0000 [rsSync] Socket recv() errno:110 Connection timed out xx.xx.xx.xx:27017
2014-11-02T22:53:29.096+0000 [rsSync] SocketException: remote: xx.xx.xx.xx:27017 error: 9001 socket exception [RECV_ERROR] server [168.63.252.61:27017] 
2014-11-02T22:53:29.099+0000 [rsSync] DBClientCursor::init call() failed
2014-11-02T22:53:29.307+0000 [rsSync] replSet initial sync exception: 13386 socket error for mapping query 0 attempts remaining
2014-11-02T22:53:36.113+0000 [conn2013] end connection xx.xx.xx.xx:1056 (26 connections now open)
2014-11-02T22:53:36.153+0000 [initandlisten] connection accepted from xx.xx.xx.xx:1137 #2016 (27 connections now open)
2014-11-02T22:53:36.154+0000 [conn2016]  authenticate db: local { authenticate: 1, nonce: "xxx", user: "__system", key: "xxx" }
2014-11-02T22:53:55.541+0000 [conn2014] end connection xx.xx.xx.xx:1200 (26 connections now open)
2014-11-02T22:53:55.578+0000 [initandlisten] connection accepted from xx.xx.xx.xx:1201 #2017 (27 connections now open)
2014-11-02T22:53:55.580+0000 [conn2017]  authenticate db: local { authenticate: 1, nonce: "xxx", user: "__system", key: "xxx" }
2014-11-02T22:53:56.861+0000 [conn2015]  authenticate db: admin { authenticate: 1, user: "root", nonce: "xxx", key: "xxx" }
2014-11-02T22:53:59.310+0000 [rsSync] Fatal Assertion 16233
2014-11-02T22:53:59.723+0000 [rsSync] 0x11c0e91 0x1163109 0x114576d 0xe84c1f 0xea770e 0xea7800 0xea7af8 0x1205829 0x7ff728cf8e9a 0x7ff72800b3fd 
 /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x11c0e91]
 /usr/bin/mongod(_ZN5mongo10logContextEPKc+0x159) [0x1163109]
 /usr/bin/mongod(_ZN5mongo13fassertFailedEi+0xcd) [0x114576d]
 /usr/bin/mongod(_ZN5mongo11ReplSetImpl17syncDoInitialSyncEv+0x6f) [0xe84c1f]
 /usr/bin/mongod(_ZN5mongo11ReplSetImpl11_syncThreadEv+0x18e) [0xea770e]
 /usr/bin/mongod(_ZN5mongo11ReplSetImpl10syncThreadEv+0x30) [0xea7800]
 /usr/bin/mongod(_ZN5mongo15startSyncThreadEv+0xa8) [0xea7af8]
 /usr/bin/mongod() [0x1205829]
 /lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a) [0x7ff728cf8e9a]
 /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7ff72800b3fd]
2014-11-02T22:53:59.723+0000 [rsSync] 

***aborting after fassert() failure


2014-11-02T22:53:59.728+0000 [rsSync] SEVERE: Got signal: 6 (Aborted)

.

The worst part is that when I try to re-start the mongod service, the replication begins afresh trying to reSync all the files which are already there. This seems bizarre and useless.

Can someone please help me understand what is going on?

how to define simulation replications by MOCBA algorithm? [closed]

$
0
0

everyone! have you ever done the MOCBA or even OCBA algorithm to allocate optimal replication numbers to the solutions in a multi-objective problem? I have some difficulties with this algorithm implementation.

Viewing all 17268 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>