canal admin

Introduction to the

Canal-admin is designed to provide canal with o&M functions such as overall configuration management and node operation and maintenance, as well as a relatively friendly WebUI operation interface to facilitate more users to operate quickly and safely

concept

  • Instance, corresponding to instance in canal-server, which is the smallest subscribed mysql queue
  • Server corresponds to canal-server. A server can contain multiple instances
  • Cluster, corresponding to a set of canal-servers
  • Instance is the original business subscription request, and it will be associated with the two resource-oriented service attributes of server/ cluster. For example, Instance A is bound to Server A or cluster A.
  • With the binding relationship between the task and the resource, the corresponding resource service will receive the task configuration, dynamically load instance on the corresponding resource, and provide the dynamic loading process of the service, which is similar to the previous autoScan mechanism, but can be changed into a remote Web operation based on canal-admin. There is no need to operate and maintain configuration files on the machine
  • Server abstraction into resources, the original canal – server running need canal. The properties/instance properties configuration file will need to be unified operations on the web UI, Each server only needs to start the configuration with the most basic configuration (such as knowing the canal-admin manager address and the account and password to access the configuration).

The deployment of

  • Download canal-admin, visit the Release page, and select the package you want to download, for example, version 1.1.4

Wget HTTP: / / https://github.com/alibaba/canal/releases/download/canal-1.1.4/canal.admin-1.1.4.tar.gz

  • unzip
mkdir /tmp/canal-admin
tar zxvf canal.admin-$version.tar.gz -C /tmp/canal-admin
Copy the code
  • Configuration instructions

    • Application. Yml, the default configuration that SpringBoot relies on, such as the password for linking to the database and the password for linking to the canal-server admin
    • Logback.xml, log configuration
    • Canal-template. properties, the default template for canal configuration, which is selected when automatic registration is enabled for canal-server
    • Instance-template. properties, the default template for instance configuration
  • Configuration changes

vi conf/application.yml

server:
  port:8089
spring:
  jackson:
    date-format: yyyy-MM-dd HH:mm:ss
    time-zone: GMT+8
spring.datasource:
  Address: 127.0.0.1:3306
  database: canal_manager
  username: canal
  password: canal
  driver-class-name: com.mysql.jdbc.Driver
  url: jdbc:mysql://${spring.datasource.address}/${spring.datasource.database}? useUnicode=true&characterEncoding=UTF-8&useSSL=false
  hikari:
    maximum-pool-size:30
    minimum-idle:1
canal:
  adminUser: admin
  adminPasswd: admin
Copy the code
  • Initializing the data source

Canal_manager. SQL is stored in the conf directory by default

Enter the MySQL command line as user root.Mysql - h127.1 - uroot - pRun the initialization SQL file
SQL> source conf/canal_manager.sql
Copy the code
  • Start the

sh bin/startup.sh

  • Viewing startup Logs
Vi logs/admin. Log 15:43:38 2019-08-31. [the main] 162 INFO O.S.B oot. Web. Embedded. Tomcat. TomcatWebServer - tomcat initialized with Port (s) : 8089 (HTTP) 15:43:38. 2019-08-31, 180 [main] INFO org.apache.coyote.http11.Http11NioProtocol-InitializingProtocolHandler["http-nio-8089"] the 2019-08-31 15:43:38. 191. [the main] INFO org. Apache. Catalina. Core. StandardService - Starting service [Tomcat] The 2019-08-31 15:43:38. 194. [the main] INFO org. Apache. Catalina. Core. StandardEngine - StartingServletEngine: ApacheTomcat / 8.5.29...  The 2019-08-31 15:43:39. 789. [the main] INFO O.S.W.S.M.M.A nnotation. ExceptionHandlerExceptionResolver - Detected @ ExceptionHandler methodsinCustomExceptionHandler 15:43:39 2019-08-31. 825. [the main] INFO O.S.B.A.W eb. Servlet. WelcomePageHandlerMapping - Adding welcome page:class path resource [public/index.html]Copy the code
  • To access the page

If you see the above log, the startup is successful. You can log in to http://127.0.0.1:8089/ with the password admin/123456

practice

  • Create the cluster

  • Create a server

  • Create the Instance

Configuration items:

  • Modification is mainly maintenanceinstance.propertiesAfter the modification, instance on the corresponding single server or cluster server is triggered to perform dynamic reload
  • If you delete it, you can directly execute itinstance stopTo delete the configuration
  • Start/stop, rightinstanceThe status of a single machine or cluster is changedserverOn theinstanceDo start/stop operations
  • Log, mainly forinstanceWhen running, get the correspondinginstanceThe last 100 lines of the log, for exampleexample/example.log