Arc Forumnew | comments | leaders | submitlogin
After i changed something
2 points by tvvocold 3468 days ago | 15 comments
the server allways goes down i followed http://arclanguage.org/item?id=18840 and edit something, now the server allways goes down,here is log http://p.fdzh.org/paste/9jBPxB14

why and how to fix?



3 points by zck 3460 days ago | link

I haven't been running the server in a while, but I have a few thoughts.

First, what version of anarki did you start with?

What were the edits you made? Does it work if you start the server without your changes?

What happens in the log before the errors?

What do you have to do to get the errors to occur? Is it upon server startup, or is it when you load a page in your browser, or try to register a user?

-----

2 points by tvvocold 3459 days ago | link

1,https://github.com/shader/arc-openshift is what i use in openshift

2,http://arclanguage.org/item?id=18840 i followed this and server works.

3,i only got openshift's log http://p.fdzh.org/paste/9jBPxB14

4,i donnot really know,after some days (maybe 5 or less) the server broken and could loaded,i think maybe the ab test from somebody?

ps:when server goes down i need to kill -9 the 80 port's pid and then restart app,but few days later it will happen again.

thx btw.

-----

1 point by akkartik 3458 days ago | link

Back when I ran an arc service I noticed it ran out of memory every few days. So I'd run the server in a loop on my shell, immediately restarting it if it died.

-----

1 point by tvvocold 3458 days ago | link

nice! but how to add a loop bash in openshift?

-----

1 point by akkartik 3458 days ago | link

Can you login to the server?

-----

1 point by tvvocold 3458 days ago | link

the reason maybe too much people came in , when i post a arc link to other website then i cannnot open arc site.

-----

1 point by tvvocold 3458 days ago | link

sure,then?

-----

1 point by akkartik 3457 days ago | link

First create a way to have arc automatically run (nsv) on startup. Then you can say this (assuming your shell is bash):

  $ while true; do arc server.arc; done
Now anytime your server dies it'll just come back up.

-----

3 points by akkartik 3456 days ago | link

I've updated the repository to make this easier. There's now a script called run-news to bring up the HN server.

  $ git pull
Now you should be able to run your server in a loop like this:

  $ while true; do ./run-news; sleep 5; done
Let me know if you run into trouble with this. I'll be around and more responsive for the next few days.

More notes, just for future reference:

1. run-news provides an interactive prompt, so you can make changes to the server without needing to restart it. Just remember to also modify news.arc otherwise your changes will be lost when the server dies next.

2. The sleep above is to help exit the server. If you quit the server as usual it'll just come up again. To bring it down, hit ctrl-c twice in succession.

3. I also fixed up the readme, which was abysmally out of date. Sorry about that.

-----

1 point by tvvocold 3454 days ago | link

thx,cool!

btw,i use https://github.com/shader/arc-openshift for openshift env,(not the https://github.com/arclanguage/anarki) how could i update it?

-----

1 point by akkartik 3453 days ago | link

arc-openshift installs anarki: https://github.com/shader/arc-openshift/blob/fa9def061/.open...

Just cd into the arc directory ($OPENSHIFT_DATA_DIR/arc, but I'm not sure how to deduce OPENSHIFT_DATA_DIR) and run:

  $ git pull

-----

1 point by tvvocold 3453 days ago | link

when i git pull i got

  error: Your local changes to the following files would be overwritten by merge:
    lib/news.arc
  Please, commit your changes or stash them before you can merge.
  Aborting

-----

1 point by akkartik 3453 days ago | link

Have you made any changes to news.arc? Mail me the output of this command, and I'll help you with the merge.

  $ git diff lib/news.arc

-----

2 points by shader 3457 days ago | link

I have noticed that the server seems to go down after extended amounts of time, but I haven't figured out the source of the problem.

If anyone comes up with a permanent solution, I would be happy to include it though.

-----

2 points by tvvocold 3454 days ago | link

Openshift gear will goes idle after 24 hours of inactivity,so i use uptimerobot.com to ping the server every 5 min,it will make other apps (i created) goes well ,but the arc.news always goes down every 2 or 3 days.

btw, here is akkartik's way: http://arclanguage.org/item?id=18910

-----