gemelen: (Default)
Once I mentioned strange behaviour of zfs send/receive and now I read about nice tool to wrap such atctivity (from smartos-discuss ml): http://www.znapzend.org/#startnow
gemelen: (Default)
It's strange, but for this particular case

from-host > zfs send zvolume@snapshot-version|ssh to-host zfs receive zvolume

is faster than

to-host > nc -l -p port|zfs receive zvolume
from-host > zfs send zvolume@snapshot-version | nc -l to-host -p port

approximately by 16%.
Both hosts have a lot of free memory (~30 and ~60 GBs respectively), CPU load is about 0.3% at one core, both are located in same DC and share 500 MBps bandwidth.
Also, both are same OS version - joyent_20150709T171818Z
gemelen: (Default)
With job change comes project change and some bizarre technologies like old-n-hairy OSGI.
There are some steps to get comprehensive environment.

All done with a lot of virtualization magic under SmartOS, thanks to Joyent and other guys whom deliver this amazing stuff.

0. Create project with Maven and its maven-bundle-plugin to produce bundle jar.
1. Make necessary changes to sources to start with.
For example, simple Activator class only with start() and stop() methods like

import org.osgi.framework._

class Activator extends BundleActivator {
def start(bc: BundleContext):Unit = { Console.println("started") }
def stop(bc: BundleContext):Unit = { Console.println("stopped") }
}

At this point you should be able to successfully package it locally.
2. Add sources under VCS control (or do it from start). I use git and bitbucket service for this time.
3. Here comes SmartOS:

[root@saule ~]# vmadm list
UUID TYPE RAM STATE ALIAS
...
e810ea3c-ac05-48e5-9a80-0c42bca99a6e OS 512 running postgres
3eb5876f-4577-4791-99d0-4b16b4cbe3d1 OS 800 running nexus
bea2edbb-443c-4291-8007-5d67cd038acf OS 2048 running teamcity
e8bec698-0cdd-45f1-a039-dfbd591864e9 OS 4096 running hq

I have rented dedicated server to do dirty work at, and there are already all vm-instances for software production cycle.
Everybody else can do the same with idea "one vm for one service" in mind.
"hq" hosts working shell+vim, is ready to edit code and run Felix container.
All used software is free and OSS (majority of them).
I use Nexus OSS version and Teamcity free version (up to 10 users, 20 build configurations and 3 build agents).
4. In Teamcity: create project, add vcs-root from bitbucket (with access via "deployment" key from "teamcity" vm), use auto-created or create by hand build configuration (which simply runs maven deploy).
5. In Nexus:
since OSS version shipped without some features, we should download and install plugin to be able create proxy repository from maven to OBR which will be used later in Felix.
Read and repeat instructions from Nexus OBR Plugin install
Then login into Nexus and create proxy-repo. Again, instruction is already done by some good guys Transforming a Maven Repository into an OSGi Bundle Repository
6. Download and unpack Felix dustribution in your working place ("hq" in my case).
7. Run Felix and add proxy repo from previous step via command

obr:repo add <repo-url/.meta/obr.xml>

8. Push sources to remote repo, which will trigger build in Teamcity and deploy to some repo in Nexus (snapshots for example).
9. In Felix

obr:list // to list all artifacts from proxy-repo added in step 7
obr:deploy <artifact>
felix:start <its id>


With some other things under the hood (maven deployment configuration and settings) and a bit of luck, you will get continuous delivery infrastructure.
gemelen: (Default)
Message "Cannot run program "sh": error=12, Not enough space" on application start is about memory, no shit =)
To fix problem you can increment zone max_swap by 1.5 times (I started with this multiplicator rather then x2 and it worked).
gemelen: (Default)
Main doc + leased /56 from ovh:
# ipadm create-addr -t -T addrconf <nic>/v6a
# ipadm create-addr -t -T static -a <ipv6-address>/56 <nic>/v6s
# route add -inet6 default <your-ipv6-zone + FF octets> // in my case 2001:41d0:a:2dff:ff:ff:ff:ff
gemelen: (Default)
As usually, solution was simplier than I thought :)
1. Create zone with config like this:
{
  "brand": "joyent",
  ...
  "image_uuid": "87b9f4ac-5385-11e3-a304-fb868b82fe10",
  ...
  "nics": [
          {
            "physical": "net0",
            "nic_tag": "admin",
            "mac": "<virtual mac-addr>",
            "ip": "<failover-ip>",
            "netmask": "255.255.255.255",
            "gateway": "<failover-ip>",
            "primary": true
          }
  ],
  ...
}

2. zlogin and enter
   route add <server-ip three octets>.0/24 <failover-ip> -interface
   route add default <server-ip three octets>.254

3. After that our new zone is discoverable from internet.
gemelen: (Default)
Via
ovh docs,
smartos wiki
and search results.
1. Create "Virtual Mac" in web-manager (type doesnt matter) and assign obtained failover ip to it
2. Login and execute in global zone:
a. create vnic
  dladm create-vnic -m <virtual mac-addr> -l <real nic name> <new vnic name>

b. assign failover-ip
  ifconfig <new vnic name> plumb
  ifconfig <new vnic name> inet <failover-ip> netmask 255.255.255.255 broadcast <failover-ip> up

c. Add routes (in assume that default route already exists)
  route add <server-ip three octets>.0/24 <failover-ip> -interface -ifp <new vnic name>
  routeadm -e ipv4-forwarding
  routeadm -e ipv4-routing
  routeadm -u

4.[Optional] Persist configuration with some custom smf sciprts

Profile

gemelen: (Default)
gemelen

June 2017

M T W T F S S
   1 234
56789 1011
12131415161718
19202122232425
2627282930  

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 23rd, 2017 17:16
Powered by Dreamwidth Studios