nginx-clojure / nginx-clojure

Nginx module for embedding Clojure or Java or Groovy programs, typically those Ring based handlers.
http://nginx-clojure.github.io
Other
1.08k stars 114 forks source link

Coroutine based ,Get a User Defined Class Waving Configuration File ,An error occurred #251

Open hgtysew opened 3 years ago

hgtysew commented 3 years ago

Enable Coroutine based Client Socket

Get a User Defined Class Waving Configuration File for Your Web App

My system is windows 10。

nginx.conf The file contains the following settings。

jvm_options "-javaagent:jars/nginx-clojure-0.5.2.jar=tmb"; jvm_options ​"-Xbootclasspath/a:jars/nginx-clojure-0.5.2.jar"; jvm_options "-Dnginx.clojure.wave.CfgToolOutFile=/tmp/my-wave-cfg.txt";

After start nginx-win64, the following error is displayed

2021/03/21 10:01:55 [error] 12560#6640: jvm may be mad for wrong options! See hs_err_pid.log for detail! restarted 2 2021/03/21 10:01:55 [error] 12560#6640: we try quit master now! 2021/03/21 10:01:55 [crit] 12560#6640: ngx_http_clojure_quit_master, file ("D:\1\nginx-clojure-0.5.2\nginx-win64.exe"), arg ("nginx-win64 -s stop") 2021/03/21 10:01:56 [error] 11224#9896: jvm may be mad for wrong options! See hs_err_pid.log for detail! restarted 3 2021/03/21 10:01:56 [error] 11224#9896: we try quit master now! 2021/03/21 10:01:56 [crit] 11224#9896: ngx_http_clojure_quit_master, file ("D:\1\nginx-clojure-0.5.2\nginx-win64.exe"), arg ("nginx-win64 -s stop") 2021/03/21 10:01:56 [error] 8436#7560: CreateFile() "D:\1\nginx-clojure-0.5.2/logs/nginx.pid" failed (2: The system cannot find the file specified)


My system is windows, coroutine, saving configuration file. How can I write it correctly?

xfeep commented 3 years ago

It seems with wrong jvm configuration nginx worker process can not start successfully.

hgtysew commented 3 years ago

我使用nginx-clojure,已经有一年了,也很好用,但我一直都是用Thread Pool模式的,现在我想用Coroutine模式 ,看了写的教程,不是很明白,要怎样操作才能切换到Coroutine模式。我用的是windows系统,用你网上的例子生成Coroutine配置文件,结果连软件都启动不了

xfeep commented 3 years ago

@hgtysew 请先临时把nginx.conf中设置成非daemon模式并且单进程模式看看启动的时候控制台有没有什么错误提示:

daemon  off;
master_process  off;

另外coroutine模式的使用确实不太容易,因为要生成wave配置文件,除非JVM提供原生的支持并且issue #250 实现 。