在eclipse上面启动tomcat没有问题的,但放在ecs上就不行

解决方案 »

  1.   

    不是应该访问 域名/isExistent/register吗  或者加log
      

  2.   


    这个是没问题的,所有代码都是我弄得。.../register只是跳转到注册页面,然后ajax跳到.../isExisttent判断id是否存在
      

  3.   

    这种线上问题很难定位的,推荐你个工具
    arthas
    当然如果有足够的权限是没必要用arthas的
    而且卡住了你们没有日志么?
    第一次上线,那就相当于没有运营呗,直接远程调试也是可以的啊...
      

  4.   

    我晕,这日志一直在加东西啊,也看不出有啥有用的啊本地可以,生产不可以,那就先检查两地环境不一致的地方,看了下你们网站,这几个接口网络一直阻塞着,说明nginx是好的,先检查代理的配置,然后再检查请求是否进入应用服务器,应用服务器能否ping通数据库
      

  5.   

    我晕,这日志一直在加东西啊,也看不出有啥有用的啊本地可以,生产不可以,那就先检查两地环境不一致的地方,看了下你们网站,这几个接口网络一直阻塞着,说明nginx是好的,先检查代理的配置,然后再检查请求是否进入应用服务器,应用服务器能否ping通数据库
    [root@wjl-host conf]# cat nginx.conf
    user www www;
    worker_processes auto;error_log /data/wwwlogs/error_nginx.log crit;
    pid /var/run/nginx.pid;
    worker_rlimit_nofile 51200;events {
      use epoll;
      worker_connections 51200;
      multi_accept on;
    }http {
      include mime.types;
      default_type application/octet-stream;
      server_names_hash_bucket_size 128;
      client_header_buffer_size 32k;
      large_client_header_buffers 4 32k;
      client_max_body_size 1024m;
      client_body_buffer_size 10m;
      sendfile on;
      tcp_nopush on;
      keepalive_timeout 120;
      server_tokens off;
      tcp_nodelay on;  fastcgi_connect_timeout 300;
      fastcgi_send_timeout 300;
      fastcgi_read_timeout 300;
      fastcgi_buffer_size 64k;
      fastcgi_buffers 4 64k;
      fastcgi_busy_buffers_size 128k;
      fastcgi_temp_file_write_size 128k;
      fastcgi_intercept_errors on;  #Gzip Compression
      gzip on;
      gzip_buffers 16 8k;
      gzip_comp_level 6;
      gzip_http_version 1.1;
      gzip_min_length 256;
      gzip_proxied any;
      gzip_vary on;
      gzip_types
        text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+   xml
        text/javascript application/javascript application/x-javascript
        text/x-json application/json application/x-web-app-manifest+json
        text/css text/plain text/x-component
        font/opentype application/x-font-ttf application/vnd.ms-fontobject
        image/x-icon;
      gzip_disable "MSIE [1-6]\.(?!.*SV1)";  #If you have a lot of static files to serve through Nginx then caching of the files' metadata (not t   he actual files' contents) can save some latency.
      open_file_cache max=1000 inactive=20s;
      open_file_cache_valid 30s;
      open_file_cache_min_uses 2;
      open_file_cache_errors on;######################## default ############################
      server {
        listen 80;
        server_name _;
        access_log /data/wwwlogs/access_nginx.log combined;
        root /data/wwwroot/default;
        index index.html index.htm index.jsp;
        #error_page 404 /404.html;
        #error_page 502 /502.html;
        location /nginx_status {
          stub_status on;
          access_log off;
          allow 127.0.0.1;
          deny all;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
          expires 30d;
          access_log off;
        }
        location ~ .*\.(js|css)?$ {
          expires 7d;
          access_log off;
        }
        location ~ {
          proxy_pass http://127.0.0.1:8080;
          include proxy.conf;
        }
        location ~ /\.ht {
          deny all;
        }
      }
    ########################## vhost #############################
      include vhost/*.conf;
    }
    [root@wjl-host conf]#“检查请求是否进入应用服务器,应用服务器能否ping通数据库”,大佬,这波操作要怎么弄啊?
      

  6.   


    这个你是哪不明白?进入应用服务器,那自然会流下日志啊,没有就加上日志,在应用服务器ping下数据库这个操作都不会也太不应该吧...
      

  7.   

    这样吗?
    [root@wjl-host conf]# ping 47.97.180.223
    PING 47.97.180.223 (47.97.180.223) 56(84) bytes of data.
    64 bytes from 47.97.180.223: icmp_seq=1 ttl=64 time=0.198 ms
    64 bytes from 47.97.180.223: icmp_seq=2 ttl=64 time=0.195 ms
    64 bytes from 47.97.180.223: icmp_seq=3 ttl=64 time=0.192 ms
    64 bytes from 47.97.180.223: icmp_seq=4 ttl=64 time=0.190 ms
    64 bytes from 47.97.180.223: icmp_seq=5 ttl=64 time=0.271 ms
    64 bytes from 47.97.180.223: icmp_seq=6 ttl=64 time=0.259 ms
    64 bytes from 47.97.180.223: icmp_seq=7 ttl=64 time=0.205 ms
    64 bytes from 47.97.180.223: icmp_seq=8 ttl=64 time=0.214 ms
    64 bytes from 47.97.180.223: icmp_seq=9 ttl=64 time=0.216 ms
    64 bytes from 47.97.180.223: icmp_seq=10 ttl=64 time=0.214 ms
    ^C
    --- 47.97.180.223 ping statistics ---
    10 packets transmitted, 10 received, 0% packet loss, time 8999ms
    rtt min/avg/max/mdev = 0.190/0.215/0.271/0.029 ms
    [root@wjl-host conf]# ping 47.97.180.223 3306
    PING 3306 (0.0.12.234) 56(124) bytes of data.
    ^C
    --- 3306 ping statistics ---
    117 packets transmitted, 0 received, 100% packet loss, time 115999ms我设置的数据库连接
    ,照理说因该能连上啊。
    我看网上说一个网站对应一个数据库,是不是数据库名要跟域名一致或者有其他的绑定操作啊?
      

  8.   

    瞎搞  跟域名有什么关系  你直接在dao层连接数据库测试一下就行了  用那么复杂吗  一层一层测看看哪层出问题了
      

  9.   

    这样吗?
    [root@wjl-host conf]# ping 47.97.180.223
    PING 47.97.180.223 (47.97.180.223) 56(84) bytes of data.
    64 bytes from 47.97.180.223: icmp_seq=1 ttl=64 time=0.198 ms
    64 bytes from 47.97.180.223: icmp_seq=2 ttl=64 time=0.195 ms
    64 bytes from 47.97.180.223: icmp_seq=3 ttl=64 time=0.192 ms
    64 bytes from 47.97.180.223: icmp_seq=4 ttl=64 time=0.190 ms
    64 bytes from 47.97.180.223: icmp_seq=5 ttl=64 time=0.271 ms
    64 bytes from 47.97.180.223: icmp_seq=6 ttl=64 time=0.259 ms
    64 bytes from 47.97.180.223: icmp_seq=7 ttl=64 time=0.205 ms
    64 bytes from 47.97.180.223: icmp_seq=8 ttl=64 time=0.214 ms
    64 bytes from 47.97.180.223: icmp_seq=9 ttl=64 time=0.216 ms
    64 bytes from 47.97.180.223: icmp_seq=10 ttl=64 time=0.214 ms
    ^C
    --- 47.97.180.223 ping statistics ---
    10 packets transmitted, 10 received, 0% packet loss, time 8999ms
    rtt min/avg/max/mdev = 0.190/0.215/0.271/0.029 ms
    [root@wjl-host conf]# ping 47.97.180.223 3306
    PING 3306 (0.0.12.234) 56(124) bytes of data.
    ^C
    --- 3306 ping statistics ---
    117 packets transmitted, 0 received, 100% packet loss, time 115999ms我设置的数据库连接
    ,照理说因该能连上啊。
    我看网上说一个网站对应一个数据库,是不是数据库名要跟域名一致或者有其他的绑定操作啊?
    人家做数据库的还能管得了你域名....这世界上优秀的程序员都把解耦当作一个非常重要的工作来做的,你觉得这风马牛不相及的两个东西会耦合在一起?
    实在不行外包个人帮你们解决问题吧,你们这种问题有经验的半小时就搞定了
      

  10.   

    现在公司项目都是外包给别人做的,这个项目是我以前完成的,现在大学刚毕业找了个公司想把它上线下,纯属个人项目的,就是第一次弄这个,什么都得自己去学去查,公司也没什么人跟没什么大佬我看了下日志,这个.../isExistent http状态码,有404/499/502/200...
    下面是正常的页面
      

  11.   

    登陆不了。。

    nginx 502大概是被代理服务器访问不通,自己检查配置