4store
======
.. |br| raw:: html
Installation
------------
Installed (suspiciously?) easily via homebrew
.. code:: bash
sudo -i -u hugh /opt/homebrew/bin/brew install fourstore
Storage & Configs
-----------------
Data storage is in ``/opt/homebrew/var/fourstore``
Config in ``/etc/4store.conf``
Operation
---------
Note that in order to use ``4s-admin`` utility, there must be a running instance of ``4s-boss`` daemon.
If ``pgrep 4s-boss`` doesn't return any output, run ``sudo /opt/homebrew/bin/4s-boss`` to start it.
Remember also that you can only use one of ``4s-httpd`` and ``4s-import`` concurrently on the same store.
It's less than ideal, but things seem to work best if ``4s-boss`` and
``4s-httpd`` are run as ``root``.
You can run ``4s-admin`` commands as any user, as they are actioned by
``4s-boss`` which should be running as ``root``.
List store status
~~~~~~~~~~~~~~~~~
``4s-admin --verbose list-stores``
Creating stores
~~~~~~~~~~~~~~~
The number of segments must be a power of 2. General rule-of-thumb is 2x
number of cores, so suggest on this 12-core machine use 8 or 16 segments for any new
stores (copying across from bytemark will be two segment stores).
``4s-admin create-store foo --segments=8``
Start/Stop/Delete store(s)
~~~~~~~~~~~~~~~~~~~~~~~~~~
You can end the following commands with multiple store names or ``--all``
``4s-admin start-stores foo`` |br| ``4s-admin stop-stores foo`` |br| ``4s-admin delete-stores foo``
Start/stop httpd
~~~~~~~~~~~~~~~~
Each ``4s-httpd`` daemon is started on a specific port. See config in ``/etc/4store.conf``
``sudo 4s-httpd foo``
To specify a different port, or if not in ``/etc/4store.conf`` use ``4s-http -p 9876 foo``
As far as I recall, there isn't a good way to stop 4s-httpd processes... use |br| ``sudo pkill -f '4s-httpd libmus_A'``
.. Copying from old machines
.. ~~~~~~~~~~~~~~~~~~~~~~~~~
..
.. I've successfully copied *finance* store over from old machine (vm2)
..
.. Must ensure that on the source machine, everything is readable...
..
.. ``chmod a+r -R /var/lib/4store/foo``
..
.. Then copy over with rsync
..
.. ``rsync -avh hg@vm5.seme4.com:/var/lib/4store/foo /opt/homebrew/var/fourstore/``