文章目录
- clickhouse安装部署
- 01节点 metrika.xml 配置文件信息
- 02节点 metrika.xml 配置文件信息
- 03节点 metrika.xml 配置文件信息
- macros 实例信息编辑
- 查看结果
clickhouse安装部署
rpm安装过程以及注意事项
01节点 metrika.xml 配置文件信息
<?xml version="1.0"?>
<yandex>
<remote_servers>
<_3s2r_cluster> <!-- 集群名称-->
<shard> <!--集群的第一个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<!--该分片的第一个副本-->
<replica>
<host>foton1</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_1</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton2</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_1</default_database>
</replica>
</shard>
<shard> <!--集群的第二个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<replica> <!--该分片的第一个副本-->
<host>foton2</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_2</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton3</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_2</default_database>
</replica>
</shard>
<shard> <!--集群的第三个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<replica> <!--该分片的第一个副本-->
<host>foton3</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_3</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton1</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_3</default_database>
</replica>
</shard>
</_3s1r_cluster>
</remote_servers>
<zookeeper-servers>
<node index="1">
<host>foton1</host>
<port>2181</port>
</node>
<node index="2">
<host>foton2</host>
<port>2181</port>
</node>
<node index="3">
<host>foton3</host>
<port>2181</port>
</node>
</zookeeper-servers>
</yandex>
02节点 metrika.xml 配置文件信息
<?xml version="1.0"?>
<yandex>
<remote_servers>
<_3s2r_cluster> <!-- 集群名称-->
<shard> <!--集群的第一个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<!--该分片的第一个副本-->
<replica>
<host>foton1</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_1</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton2</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_1</default_database>
</replica>
</shard>
<shard> <!--集群的第二个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<replica> <!--该分片的第一个副本-->
<host>foton2</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_2</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton3</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_2</default_database>
</replica>
</shard>
<shard> <!--集群的第三个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<replica> <!--该分片的第一个副本-->
<host>foton3</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_3</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton1</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_3</default_database>
</replica>
</shard>
</_3s1r_cluster>
</remote_servers>
<zookeeper-servers>
<node index="1">
<host>foton1</host>
<port>2181</port>
</node>
<node index="2">
<host>foton2</host>
<port>2181</port>
</node>
<node index="3">
<host>foton3</host>
<port>2181</port>
</node>
</zookeeper-servers>
<macros>
<shard>01</shard>
<replica>cluster01-01-2</replica>
</macros>
<macros>
<shard>03</shard>
<replica>cluster01-02-1</replica>
</macros>
</yandex>
03节点 metrika.xml 配置文件信息
<?xml version="1.0"?>
<yandex>
<remote_servers>
<_3s2r_cluster> <!-- 集群名称-->
<shard> <!--集群的第一个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<!--该分片的第一个副本-->
<replica>
<host>foton1</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_1</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton2</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_1</default_database>
</replica>
</shard>
<shard> <!--集群的第二个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<replica> <!--该分片的第一个副本-->
<host>foton2</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_2</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton3</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_2</default_database>
</replica>
</shard>
<shard> <!--集群的第三个分片-->
<weight>1</weight>
<internal_replication>true</internal_replication>
<replica> <!--该分片的第一个副本-->
<host>foton3</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_3</default_database>
</replica>
<!--该分片的第二个副本-->
<replica>
<host>foton1</host>
<port>9002</port>
<user>default</user>
<password>dsg</password>
<default_database>mycluster_shard_3</default_database>
</replica>
</shard>
</_3s1r_cluster>
</remote_servers>
<zookeeper-servers>
<node index="1">
<host>foton1</host>
<port>2181</port>
</node>
<node index="2">
<host>foton2</host>
<port>2181</port>
</node>
<node index="3">
<host>foton3</host>
<port>2181</port>
</node>
</zookeeper-servers>
<macros>
<shard>01</shard>
<replica>cluster01-02-2</replica>
</macros>
<macros>
<shard>03</shard>
<replica>cluster01-03-2</replica>
</macros>
</yandex>
macros 实例信息编辑
01节点实例信息
02节点实例信息
03节点实例信息