Skip to content

Commit 69f5f58

Browse files
committed
Updated manual imnstall instructions
1 parent f9e6f9f commit 69f5f58

3 files changed

Lines changed: 48 additions & 8 deletions

File tree

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,25 @@ After a successful installation you may use `systemctl` to manage `redis` and th
102102
You can also install and configure SMA-X manually, for non-SystemD and/or non-Linux systems (e.g. MacOS X, BSD,
103103
Linux SysV, Windows), following the steps below:
104104

105-
1. Configure your Redis server, for your network and other preferences.
105+
1. Configure your Redis or Valkey server, for your network and other preferences.
106106

107-
2. Copy the LUA scripts from the `lua/` folder to an appropriate location for your boot service manager (e.g.
108-
`/usr/share/smax/lua` or equivalent). Optionally, edit the LUA scripts to remove any SMA-specific content, which
109-
is clearly marked.
107+
2. Copy the LUA scripts from the `lua/` folder to an appropriate location (e.g. `/usr/share/smax/lua`). Optionally,
108+
edit the LUA scripts to remove any SMA-specific content, which is clearly marked.
110109

111110
3. If your system has bash, copy `smax-init.sh` to an appropriate location (e.g. `/usr/bin` or equivalent) from where
112-
your service manager may run it. Edit the script to reflect the location where you installed the LUA scripts.
113-
Alternatively, you may create a similar initializer for your system using the script language of your choice.
114-
(`smax-init.sh` simply uses a set of `redis-cli` commands to initialize a Redis database for SMA-X.)
111+
you or your service manager may run it. Edit the script to reflect the location where you installed the LUA
112+
scripts. Alternatively, you may create a similar initializer for your system using the script language of your
113+
choice.
114+
115+
4. If using Valkey (not Redis) as your server, you should also replace `redis-cli` in your installed `smax-init.sh`
116+
with `valkey-cli` (`smax-init.sh` simply uses a set of `redis-cli` commands to initialize a Redis database for
117+
SMA-X.)
115118

116119
4. To start SMA-X on boot, first make sure that the Redis server is started on boot. Conditional on Redis being
117120
available, you should then configure your system to run the loader script (`smax-init.sh` or equivalent) also on
118121
boot, after Redis.
119122

120-
5. Reboot or else start Redis and run the LUA script loader manually.
123+
5. Reboot or else start Redis and run the `smax-init.sh` manually.
121124

122125

123126

lua/HGetMeta.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!lua flags=no-writes
2+
3+
-- The SMA-X library for Redis
4+
-- Author: Attila Kovacs
5+
-- Version: 21 December 2024
6+
--
7+
-- GitHub: Smithsonian/smax-server
8+
9+
-- keys: none
10+
-- arguments: id
11+
12+
-- returns an array of { type, dim, timestamp, origin, serial }
13+
local id = ARGV[1]
14+
15+
local vtype = redis.call('hget', '<types>', id)
16+
local dim = redis.call('hget', '<dims>', id)
17+
local timestamp = redis.call('hget', '<timestamps>', id)
18+
local origin = redis.call('hget', '<origins>', id)
19+
local serial = redis.call('hget', '<writes>', id)
20+
21+
return { vtype, dim, timestamp, origin, serial }

lua/smax.lib

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,22 @@ local function smax_set(KEYS, ARGS)
7171
end
7272

7373

74+
local smax_get_meta(ARGS)
75+
-- keys: none
76+
-- arguments: id
77+
-- returns an array of { type, dim, timestamp, origin, serial }
78+
79+
local id = ARGV[1]
80+
81+
local vtype = redis.call('hget', '<types>', id)
82+
local dim = redis.call('hget', '<dims>', id)
83+
local timestamp = redis.call('hget', '<timestamps>', id)
84+
local origin = redis.call('hget', '<origins>', id)
85+
local serial = redis.call('hget', '<writes>', id)
86+
87+
return { vtype, dim, timestamp, origin, serial }
88+
end
89+
7490

7591
local function smax_get(KEYS, ARGS)
7692
-- keys: [1] Hash table to get value from

0 commit comments

Comments
 (0)