This extention of storage enables tbschedule
supporting JDBC as backend through Druid.
Item | Description |
---|---|
address | jdbc connection string |
rootPath | prefix when persisting |
username | user when connecting |
password | credential when connecting |
Guarantee different rootPath
between different scheduling but use same database
would be fine.
Here is an example of connection string:
jdbc:mysql://ip:3306/dbname?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&tinyInt1isBit=false
The table used to persist data takes schedule_info
as defult. If you want to change
you can add a new parameter sched_tbl
in it:
jdbc:mysql://ip:3306/dbname?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&tinyInt1isBit=false&sched_tbl=new_table
A table used to persistent data required in tbschedule should be pre-created.
Table name can be customized and specified in JDBC connection string. Default name is
schedule_info
.
create table `schedule_info` (
`id` bigint NOT NULL AUTO_INCREMENT,
`key` varchar(255) not null default '',
`value` text null,
`expire` bigint not null default '0' comment 'Expiration (TTL), UTC timestamp, in second',
primary key (`id`),
unique key `key` (`key`),
key `expire` (`key`, `expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data for tbschedule';