Schlagwort-Archive: server

nodemcu and arduino

having such small device, with wifi and many analog and digital i/o ports by hand, is somehow nice. that general purpose input output connectors are known as GPIO….. the loveley mr. wang from hongkong, tower 4, building c had send me that esp8266 v3 (340) board within the second week, directly from china, by airmail.

nodemcu/esp8266
device ports with addresses

that device ( nowerdays called „iot device“ ) can be used as serial bridge, for incomming / outgoing signals. a little more sophisticated is the idea, to send all the data by http with tcp/ip or as udp paket. a lot of traffic can be estimated, beside failure correction , missing paket and other crapy errors, that are common.

pushing a json string that way, triggered, when the value changes, could be more gentle to the chip. the unknown state of the receiver is the pitfall there. using websockets on the nodemcu will work with some message client, like mqtt, is the next climbing. the client subscribes to a master ( tomcat / rabbit mq or pure servlet with extras )  and  delivers the information straight there. the server will handshake the  request with a response, directly to a open port, on the client ip.

should be all, will see, when the code is working as expected. 20 sensors with 50 samples/second could mean 1000 requests per second – commonly. if nodemcu/raspberrypi3 is able to feature all that, is the question for the comming days. the arduino is something one have to learn, how to use  that efficiently is the first step. the next is, to have some java ide, like eclipse ready with java, then tomcat and a dbms or storage engine, like mariadb installed within a virtual machine, with the same debian, that is used for raspberrypi, that is called raspian. then the code delivery or the binaries should work on both enviroments, even if the architecture will differ between amd and arm.

a related story was some years ago, the teensy to get into the mac

cubie.in.da.houze

im dezember wurde die olle dell-möhre ausgeschlachtet, nun hatte ich ein paar wochen/enden zeit, um die boards auf herz und nieren zu testen.

cubieboard mit einem kern, einem gigabyte ram und 100mbit/s würden als loadbalancer oder datanode vermutlich ausreichen, um ein paar sachen laufen lassen zu könne. die notwendigen dienste jedoch, brauchen aber in der mindest-konfiguration schon mehr als diese eine gigabyte, daher hab ich jetzt den cubietruck in das 19 zoll servergehäuse geflanscht.

cubietruck nearly installed
cubietruck inside the 19 inch standard server chasis, with 1 he

die pestflatte hat nun einen sata-anschluss, statt ultra-scsi und ist am steckverbinder mit den gehäuse verklebt. heißkleber hat sich in letzter zeit als durchaus brauchbar dargestellt, die mechanische belastung sollte aber dennoch nicht zu hoch sein. der taster zum einschalten und zwei leds zum netzteil bieten ein wenig einfluss und information von vorn.

da die spannung mit 12v aus dem netzteil kommt, das board aber 5v haben will, gibt es einen regler, der diese spannung mit  etwa 85% wirkungsgrad verkleinert. von lm 317 hab ich noch jede menge hier rumfliegen, aber in zeiten von längsreglern und schaltnetzteilen, nicht mehr ganz zeitgemäß. wie dem auch sei, der eine regler dient auch der versorgung der hdd, 2 A sollten da wohl in summe ausreichen. da im gehäuse eigentlich 4 kaskadierte lüfter ( also 8 insgesamt ) drehen und im netzteil auch solche lärmdrüsen eingebaut sind, hab ich 2 von denen ans ende versetzt, damit festplatte und board eine gewisse zwangslüftung erfahren. man weiß ja nie, wer unter einem so kocht ( welcher server direkt darunter hitze produziert ).

cubietruck on 19 inch
cubie from the rear side of the case

die zuleitung für die festplatte reicht knapp aus, dafür muss die netzwerkdose noch aus dem gehäuse geführt werden. die meisten rj-45 döschen haben eine anzeige, wenn elektrischer kontakt besteht und wenn traffic auf der leitung ist. diesen luxus bietet das cubieboard 3, doch die übliche cat5 oder cat6 leitung hat nur 4 doppel-päärchen, also 8 leitungen. für 2 leds brauchts aber auch nochmal 4 drähte, also muss eine zweite leitung her. als ersatzteilspender bietet sich das alte dual-sockel-mainboard an, dort sind zwei dosen aufgelötet. eine fürs netz und eine für recovery, wie dem auch sei, mit einem 160w mörder-lötkolben ist sie schnell getrennt vom board. eine heißluftpistole wäre auch schick gewesen, die hat aber vor kurzem ihren geist aufgegeben.

jedenfalls macht das netzwerk noch zicken, daher mal ich mal die nächste version schonmal auf. 2 cubietrucks + 2 x 4 tb hdd und 1 cubieboard + 1 x 4 tbb + 4/5 x switch gb …. to be continued….

crunching on arm

as far as it looks like, iam not the only one, crunching on arm. dzone got a article from thailand, where some guys connected 22 cubieboards, runinning apache spark, for in-memory-computation.

but ive seen the bottleneck of a 100 mbits network connector on cubieboard pretty much earlier. so ive decided to buy the cubietruck, which includes a 1 gbits adapter, which brings theoretically 128 mbyte/s a sata drive for saturation.

a cluster from france was presented before on cubieboard.org with the same idea, to fit as many cubieboards within a standard rack server enclosure, as possible.

i calculated 8 cubieboards in a 1 he server rack as maximum amount of boards and hard discs last year. the price is then something like 1600-2000 € for the hardware. for that price tag, the memory of 16 gb ram and 16 tb of hdd is not that much, but the theroretical bandwith between the nodes ( within the cluster ) is something like 8 gbits 🙂

8 nodes
8 boards in a 1 he standard rack server

the picture above shows the former choosed boards from hardkernel, called odroid, but the price for that board is above the budget, so i sized it down to a dual-core, from the quad-core.

eisenBahnPlatte

„was ist eigentlich eine holzeisenbahn?“

das projekt der private cloud den menschen zu vermitteln und dann noch zu erklären, dass man damit seine freizeit gestaltet, ist mir über die jahre nicht einfacher gefallen.

der begriff „eisenbahnplatte“ trifft vermutlich noch am ehesten dass, was otto normal bereits von anderen kennt, wenn es um viel arbeit, geld und liebe geht, das in ein projekt fließt, welches vermutlich nie wirtschaftlichen bedingungen unterworfen ist. man könnte es auch luxus nennen oder wie es allgemein genannt wird: hobby.

da ich mich nicht nur auf arbyte, sondern auch am wochenende oder nach feierabend mit den themen hier beschäftige, sah ich diesen begriff noch am dichtesten an dem, was eh schwer zu beschreiben ist. da dazu jede menge programmierung gehört, die erst gut läuft, wenn die konfiguration ein mindestmaß erreicht hat, ist die komplexität in zusammenhang mit der hardware und den modulen, die extern verwendet werden immens. ich hab garnicht präzise vor augen, wie viele schichten / layer nun tatsächlich involviert sind, manche sind absichtlich eingezogen, um module zu entkoppeln, andere lassen sich vielleicht auch reduzieren und einsparen.

da mir in den verschiedenen phasen schon beinahe der kopf geplatzt ist, hab ich teilweise oder an bestimmten punkten, die arbeit ruhen lassen und dinge aufgemalt, beschrieben oder sonstwie umrißen oder skizziert, damit nicht nur ich die dinge verstehe, sondern eben auch andere.

daher ist die eisenbahnplatte all das, wozu ich nach dem 3. oder 5. mal keine lust oder kraft hab, es zu schildern oder zu erklärbärn. daher auch der blog hier, um einsicht zu schaffen und ansichten zu vermitteln, die aussenstehenden oder interessierten die möglichkeit gibt, dinge zu erfahren, die sonst nur schwer oder schwierig zu erfassen oder gar zu finden sind.

die eisenbahnplatte fuhr schonmal“ mit drei nodes, doch sind mittlerweile alle server vom netz und derzeit wird neue hardware getestet und konfiguriert, damit der wirtschaftliche aspekt nicht zu kurz kommt.

tomcatServer

as i have the rootServer, i can try and play niceley with my own coded stuff in java, running on tomcat. as the default-webserver just having the php stuff on it, i was looking for my own machine ( or at least for the chance to deploy my stuff ) since a long time.

with no big experience in the hosting field, iam not sure to put the tomcat naked onto the web, so i decide to hide the service behind a proxy/router. after i looked into the given examples, apache could be used therefore. thats to easy, i thought and i remembered some lighthttpd from my school, that one professor took for his page.

configuring the ports and the reverse-proxy was done quite quick, but having more then one subdomain means more then a single config-file. another thing is, that i want to play with load-balancing, so the config was done in three parts.  as example, the workflow of a domain like reporteer.ioioioio.eu

part 1:

reporteer.ioioioio.eu to localhost:80. the gateway with round-robbin load-balancing on a virtual host (server-0) in berlin and redirect to the server-1 in jena.

part 2:

redirect from port 80 on server-0 to server-1 port 80, where another lighty was running.

part 3:

redirect from port 80 to port 8080, where tomcat was running and targeting the servlet-path like http://server1:8080/reporteer/

caching on each layer for different filesizes and different file-types was done that way. as the commong filesize on the http level is mostly below 64 kilobyte ( to measure ) i passed files from the servlet between 64kb and 1mb as java-cache, smaller files on the lighty-instances, separated for images and js/css.  so, some css and some javascript ( lets say up to 8 ) per request was reasonable. a unbounded amount of images where handled by the servlet, beside tiny pictures, like thumbnails and icons.

so i felt a bit save for my tomcat, that exploits or my shity code wont run into a desaster for external incomming requests on port 80.  „the evil hacker“, who wanted to get inside the machine would have to overcome the multiple redirect-layers on the plain/vanilla web-server, to catch the tomcat. beside the fact, that i didnt used any php/cgi nor sql-engine, the chance to fail to quick was not my point anymore.

but the main aspect is, that i can run active code now on the machine. before that, i just made passive / xml based stuff with gwt to run on the vhost i had. now remote-procedure-calls ( rpc ) are possible, beside general httpRequest.

shoutcastStreamServer

as i run the webradio ( hardcore-central.net this time ) with craig and the amount of listeners are raising, iam looking for an own root-server, to stream the channels by our own. we send with shoutcast-server, which is listed on the portal for a bigger audience and a lot of customers to catch.

therefore i look for the cheapest machine, with unlimited traffic and i pick up one in southern-germany, in jena at euserv. i take the „misurf-m“ with singlecore athlon, 160 gb hdd and 1 gb ram. the price for that machine is ~28€/month, the slots on citrus, we used before costs around 16 british pounds per 25 users. that means, the machine is a lot of money worth, if fully usable.

configuring and customizing the server takes two days or so, then two streams are ready to play that funky music loud boy.  the machine is connected with 100mbit/s and with 160 kbit/s per stream, ~600 listeners / slots are estimated. that is the initial idea as use-case for streaming.

but during the tests i see, that 20-30 mbit/s is the average bandwith before drop-outs take place and interrupting the stream is not so niceley. anyhow, digging the stats from the logfile, observing the customers wants and needs came into the focus, but a good shout-stats-analyzer is not in sight, the same with a nice player for the browser, with streaming-abilities.

ill take some free widgets from the net, to drop them into  the html page and the radiostation is online then. using winamp or vlc player as stream-client is quite easy, so we stream both the gabba and hardcore channels and later on, i switched electro and acid on as well.

therefore, i register the domain ioioioio.eu to handle the url and links and to present the material somehow neutral, with a to close binding to hc. but to be true, my drive and motivation came out of the music    ( mukke ) at i see that as essential influence in life.