zoukankan      html  css  js  c++  java
  • Resin学习之配置resin.properties

      Resin服务器的配置主要有两个文件:resin.properties for most common properties and resin.xml for full customization。Resin的配置最终都转化为resin.xml,其他配置文件主要为了保持配置的可管理性。一般情况下只需要修改resin.properties即可。

      resin.properties文件位于${resin.home}/conf/ 路径下面,属性可以通过cluster或者server的名称来限定具体配置应用到那个cluster或者server,并通过<resin:properties>标签引入。下面看看resin.properties文件主要配置哪些参数。

    应用服务器关键配置

      一个基本的应用服务器需要配置一些关键的参数:HTTP port(HTTP端口号), the servers in the cluster(集群里面是服务器), the operating system user(操作系统用户) 和 the JVM arguments for memory and GC(JVM的内存及垃圾回收参数)。集群里面的服务器都使用同样的resin.xml及resin.properties配置文件。启动时,Resin会自动检测本身所在的服务器并启动它。

    PROPERTYDESCRIPTION
    app_servers 集群应用服务器层的 IP地址列表,每个IP对于一个服务器
    app.http 每个应用服务器层的HTTP端口号
    setuid_user Resin实体所属的操作系统用户名
    setuid_group Resin实体所属的操作系统用户组名
    jvm_args 配置Resin实体的Java参数

     

    Web层(负载均衡器)的关键配置

      Web层的配置是用于一个网络服务器,它用于处理HTTP请求,负载均衡,代理缓存以及运行servlet应用的应用服务器。网络服务器均衡负载,代理HTTP请求到后台的应用集群。增加app_servers可以实现服务器扩展。

    内存缓存层关键配置

      配置Resin作为一个内存缓存服务器,需配置以下参数:

    memcached_servers   : 127.0.0.1:6820
    memcached_port      : 11211
    memcached.http      : 8080   #用于/resin-admin管理和REST管理员

    最大线程数(accept_thread_max)

      accept_thread_max限制端口上等待的最大连接线程。更大的值能够提供更好的灵活性,因为有更多的在等待的闲置线程。通常情况下使用默认值即可,不需要更改。

    port_thread_max : 256
    accept_thread_max : 32
    accept_thread_min : 4

    accept_thread_min

      accept_thread_min 用于维持监听连接的最小线程数量,它和accept_thread_max一起管理等待线程在一个合理的范围。通常情况下使用默认值即可。

    管理员密码(admin_password)

      admin_password 是/resin-admin administration, REST, and remote resinctl CLI administration的管理员用户密码。可以通过CLI resinctl generate-password 或者 /resin-admin的登陆界面生成。

    admin_user     : my-admin
    admin_password : {SSHA}G3UOLv0dkJHTZxAwmhrIC2CRBZ4VJgTB
    web_admin_enable   : true
    web_admin_ssl      : true
    web_admin_external : false
    remote_cli_enable  : false
    rest_admin_enable  : true
    rest_admin_ssl     : true  

    通过resinctl generate-password生成密码的例子:
    unix> resinctl generate-password my-admin my-password

    管理员(admin_user)

      admin_user用于创建管理员用户名,作为 /resin-admin 管理员, REST, and remote resinctl CLI 管理员。需要配合admin_password 和 web_admin_enable一起使用。同样,也是通过CLI resinctl generate-password 或者 /resin-admin的登陆界面生成。

    app.http

      “app”集群的HTTP端口号,其中“app”是前缀,表示参数限定的集群的名称。

    app.https

       “app”集群的HTTPS的端口号,通常和openssl_fileopenssl_key andopenssl_password 一起使用。

    cluster_system_key

      集群里面Resin服务器共享的密钥,可以是如何字符串。当集群里的服务器相连接时会进行检查。

    dependency_check_interval

      设置Resin检查更新的频率,开发时设置为较小的值,部署环境下设置为一个较大值,例如:

    dependency_check_interval : 2m

    elastic_cloud_enable

      elastic_cloud_enable 设置是否允许服务器动态加入集群。通过以下两种方式:“start”命令后跟--elastic-server参数;elastic_server配置属性被配置,Resin将会作为一个动态服务器加入集群。要加入的集群可以通过--cluster foo(foo为集群名),或者home_cluster属性配置来确定。

    Example: elastic_cloud_enable

    app_servers : 182.168.1.10:6800
    
    elastic_server       : true
    elastic_cloud_enable : true
    home_cluster         : app
    Example: elastic_cloud_enable
    # resinctl start --elastic-server --cluster app

    elastic_dns

      待续



    不闻不若闻之,闻之不若见之,见之不若知之,知之不若行之
  • 相关阅读:
    将vue文件script代码抽取到单独的js文件
    git pull 提示错误:Your local changes to the following files would be overwritten by merge
    vue和uniapp 配置项目基础路径
    XAMPP Access forbidden! Access to the requested directory is only available from the local network.
    postman与newman集成
    postman生成代码段
    Curl命令
    POST方法的Content-type类型
    Selenium Grid 并行的Web测试
    pytorch转ONNX以及TnesorRT的坑
  • 原文地址:https://www.cnblogs.com/lauyu/p/5095953.html
Copyright © 2011-2022 走看看