Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lealone-mysql-plugin插件,在每次重启lealone服务以后,就需要再次手动启动mysql插件,能否做成lealone服务重启,自动启动插件 #228

Open
tangzhongshan opened this issue Jul 1, 2024 · 3 comments

Comments

@tangzhongshan
Copy link

还有lealone-mysql-plugin插件,在每次重启lealone服务以后,就需要再次手动启动mysql插件,这个可以做成在lealone服务启动以后,自动启动mysql插件

@codefollower
Copy link
Member

还有lealone-mysql-plugin插件,在每次重启lealone服务以后,就需要再次手动启动mysql插件,这个可以做成在lealone服务启动以后,自动启动mysql插件

create、start plugin 命令是用于动态管理插件,
想要自动启动 mysql 插件,有个更简单的办法,不需要执行 create、start plugin 命令的。
先把 lealone-mysql-plugin-6.0.0.jar 扔到 lealone 安装目录的 lib 子目录中,
然后像下面这样配置一下 conf/lealone.yaml

sql_engines:
  - name: Lealone
    enabled: true
    parameters: {
        # key1: v1,
        # key2: v2,
    }
  - name: MySQL
    enabled: true
    parameters: {
        # key1: v1,
        # key2: v2,
    }

protocol_server_engines:
  - name: TCP
    enabled: true
    parameters: {
        port: 9210,
        allow_others: true,
        ssl: false
    }
  - name: MySQL
    enabled: true
    parameters: {
        port: 3306,
        allow_others: true,
        ssl: false
    }

@codefollower
Copy link
Member

一开始 lealone 6 是内置 MySQL、PostgreSQL、MongoDB 这三个插件的,启动 lealone 就能用它们了,就是在 conf/lealone.yaml 中默认配置好了,但是并不是所有人都需要这些插件,都集成在一起占用内存和硬盘空间。

@codefollower
Copy link
Member

lealone 6 最新代码已经新增 auto_start 参数用于自动启动插件

用法:

create plugin if not exists mysql
  implement by 'com.lealone.plugins.mysql.MySQLPlugin' 
  class path 'E:\lealone\lealone-plugins\mysql\target\lealone-mysql-plugin-6.0.0.jar'
  parameters (port=9410, host='127.0.0.1', auto_start=true);

auto_start 为 true 时,不再需要执行 start plugin,启动数据库时也会自动启动这个插件。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants