linux —– mysql dual machine backup method at the same time

2023-01-23   ES  

Clickhouse is Russia’s Yandex’s open source storage database (DBMS) in 2016. It is mainly used for online analysis processing query (OLAP). It can use SQL to query real -time analysis data reports.

At the end of /etc/limits.conf ,/etc/security/limits.d/90- nprc.conf, add the content:

[[email protected] software]# vim /etc/security/limits.conf

Add to the end of the file:

* soft nofile 65536 
* hard nofile 65536 
* soft nproc 131072 
* hard nproc 131072

[[email protected] software]# vim /etc/security/limits.d/90-nproc.conf

Add to the end of the file:

* soft nofile 65536 
* hard nofile 65536 
* soft nproc 131072 
* hard nproc 131072

Rest the server after the server takes effect, and use Ulimit -N or Ulimit -A to view the setting results.

Modify/eTC/SELINUux/Config Selinux = Disabled

[[email protected] ~]# vim /etc/selinux/config

SELINUX=disabled

[[email protected] ~]# yum install -y libtool
[[email protected] ~]# yum install -y *unixODBC*

Installation package download address:

official website: https://clickhouse.yandex/ 
 Download address: http://repo.red-soft.biz/repos/clickhouse/stable/el6/

[[email protected] software]# rpm -ivh *.rpm
Preparing...                ########################################### [100%]
   1:clickhouse-server-commo########################################### [ 20%]
   2:clickhouse-server      ########################################### [ 40%]
   3:clickhouse-client      ########################################### [ 60%]
   4:clickhouse-debuginfo   ########################################### [ 80%]
   5:clickhouse-compressor  ########################################### [100%]

Use commandsclickhouse-server --config-file=/etc/clickhouse-server/config.xml, start the single -machine installation service.

Use commandsclickhouse-clientStart the client.

Modify the config.xml of each machine, change the monitoring to all machines, and comment on the two lines of this machine.

[[email protected] ~]# vim /etc/clickhouse-server/config.xml

<listen_host>::</listen_host>
<!-- <listen_host>::1</listen_host> -->
<!-- <listen_host>127.0.0.1</listen_host> -->

In the/etc directory, create a new Metrika.xml file, and add configuration content. The content is as follows:

<yandex>
<clickhouse_remote_servers>
    <!-CK cluster name, can be customized, the following is customized as perftest_3shards_1replicas->
    <perftest_3shards_1replicas> 
        <shard>
             <internal_replication>true</internal_replication>
            <replica>
                <host>$ {CK machine 1}</host>
                <port>9000</port>
            </replica>
        </shard>
        <shard>
            <replica>
                <internal_replication>true</internal_replication>
                <host>$ {CK machine 2}</host>
                <port>9000</port>
            </replica>
        </shard>
        <shard>
            <internal_replication>true</internal_replication>
            <replica>
                <host>$ {CK Machine 3}</host>
                <port>9000</port>
            </replica>
        </shard>
    </perftest_3shards_1replicas>
</clickhouse_remote_servers>

<!-Configure Zookeeper->
<zookeeper-servers>
  <node index="1">
    <host>$ {zk machine 1}</host>
    <port>2181</port>
  </node>

  <node index="2">
    <host>$ {zk machine 2}</host>
    <port>2181</port>
  </node>
  <node index="3">
    <host>$ {zk machine 3}</host>
    <port>2181</port>
  </node>
</zookeeper-servers>

 <!-The current machine, depending on each machine, needs to be modified->
<macros>
    <replica>$ {This machine IP or Hostname}</replica>
</macros>


<networks>
   <ip>::/0</ip>
</networks>


<clickhouse_compression>
<case>
  <min_part_size>10000000000</min_part_size>
                                             
  <min_part_size_ratio>0.01</min_part_size_ratio>                                                                                                                                       
  <method>lz4</method>
</case>
</clickhouse_compression>

</yandex>

Use the commandclickhouse-server --config-file=/etc/clickhouse-server/config.xml, start the CK server of each machine.

source

Related Posts

MySQL Explain detailed introduction

1 1 Docker note (12): Create a user network

Java Written year and month to query the calendar class

Mathematical modeling common code summary-Python & Matlab

linux —– mysql dual machine backup method at the same time

Random Posts

vs Foundation Mission failed. MSB4018CA

[Summary of matrix theory (4)] Featured values, feature vectors, feature matrix, feature polynomial x

js Get the position and size of the DOM element

b1076 WIFI password (15 points) C language these two ideas are absolutely yuqiongqlm

HDLBITS -Verilog Learning Notes Fourier