Server side moxi process does not start on RHEL

Hello,

My use case is to replace Memcached servers with Couchbase without making changes to clients. Hence I would like to have moxi proxy running on server, so that there is no change to client web server.

I followed steps to install Couchbase Community Server on RHEL for non-sudo , non root user (https://developer.couchbase.com/documentation/server/4.6/install/rhel-suse-install-intro.html) . Couchbase server starts up, however I do not see “moxi” proxy being started. When I install on my Mac, it does get started. When I manually start moxi process on RHEL, process gets started but when I try to set/get keys, it does not work.

step 0: follow steps here to start couchbase server (https://developer.couchbase.com/documentation/server/4.6/install/rhel-suse-install-intro.html))

step1 manually start moxi:
/moxi -vvv -Z port_listen=11211,concurrency=1024,wait_queue_timeout=20000,connect_timeout=400,connect_max_errors=3,connect_retry_interval=30000,auth_timeout=100,downstream_conn_max=16,downstream_timeout=5000,cycle=200 -z 11211=127.0.0.1:11210

step3:
telnet localhost 11211
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
set key1 0 900 2
ab
SERVER_ERROR proxy downstream closed 127.0.0.1

Appreciate any pointers around why/how to start moxi proxy on couchbase server

Thanks,
Jaikit

The simplest thing to do is just perform a normal (RPM) install, and then create a bucket on a custom port; then point your clients at that port (or even use port 11211 if you like). That will start a Couchbase Server-managed server-side moxi process which is associated with that particular bucket.

1 Like

Hi @drigby,

Thank you for quick response.

I created a new bucket on port 11223 and able to see stats for that bucket via curl api. Since the new port is not in listening mode, I cannot connect my memcache client (using telnet to simulate ) to that new port. Is this the correct way to point to new bucket ?

step 1:
install couchbase server

step2:
./couchbase-cli bucket-create -c 127.0.0.1:8091 -u Administrator -p password
–bucket=test_bucket1
–bucket-type=couchbase
–bucket-port=11223
–bucket-ramsize=200
–bucket-replica=0
–enable-flush=1

step3:
telnet 127.0.0.1 11223
Trying 127.0.0.1…
telnet: connect to address 127.0.0.1: Connection refused

That should work fine - can you confirm there’s a moxi process running, and what ports it is listening on?

Something like:

pgrep moxi

To get a list of PID(s) of moxi process, and then:

lsof -p PID

to see what ports it’s listening on - it’s possible it’s only listening on external IPs…

Moxi process did not start as part of standard RPM install (unlike Mac where it does start). After creating test_bucket, I manually started moxi process [1] . It is listening on multiple ports [2] . When I try connecting on 11223, it connects but set/get does not work [3]. When I try with other listening port, set/get works but when I restart moxi process the items are not any more [4]. Since the TTL is high, I expect those keys to be present in memory. Tested same on my MAC, where I restarted couchbase and items set stay persisted.

[1]
./moxi -vvv -Z port_listen=11223,concurrency=1024,wait_queue_timeout=20000,connect_timeout=400,connect_max_errors=3,connect_retry_interval=30000,auth_timeout=100,downstream_conn_max=16,downstream_timeout=5000,cycle=200 -z 11223=127.0.0.1:11223

[2] lsof -p [moxi pid]
moxi.bin 114179 abcd cwd DIR 253,0 4096 28573707 /local/couchbase/opt/couchbase/bin
moxi.bin 114179 abcd rtd DIR 202,1 4096 2 /
moxi.bin 114179 abcd txt REG 253,0 345128 28573777 /local/couchbase/opt/couchbase/bin/moxi.bin
moxi.bin 114179 abcd mem REG 202,1 126288 3046 /usr/lib64/libselinux.so.1
moxi.bin 114179 abcd mem REG 202,1 110960 524958 /lib64/libresolv-2.12.so
moxi.bin 114179 abcd mem REG 202,1 10192 525045 /lib64/libkeyutils.so.1.3
moxi.bin 114179 abcd mem REG 202,1 43728 525055 /lib64/libkrb5support.so.0.1
moxi.bin 114179 abcd mem REG 202,1 174840 525051 /lib64/libk5crypto.so.3.1
moxi.bin 114179 abcd mem REG 202,1 12360 524994 /lib64/libcom_err.so.2.1
moxi.bin 114179 abcd mem REG 202,1 946048 525053 /lib64/libkrb5.so.3.3
moxi.bin 114179 abcd mem REG 202,1 277704 525047 /lib64/libgssapi_krb5.so.2.2
moxi.bin 114179 abcd mem REG 202,1 90784 524298 /lib64/libgcc_s-4.4.6-20110824.so.1
moxi.bin 114179 abcd mem REG 202,1 987096 3276 /usr/lib64/libstdc++.so.6.0.13
moxi.bin 114179 abcd mem REG 202,1 1921224 524932 /lib64/libc-2.12.so
moxi.bin 114179 abcd mem REG 202,1 596360 524940 /lib64/libm-2.12.so
moxi.bin 114179 abcd mem REG 253,0 16120 28576151 /local/couchbase/opt/couchbase/lib/libhashkit.so.1.0.0
moxi.bin 114179 abcd mem REG 253,0 21752 28576126 /local/couchbase/opt/couchbase/lib/libcJSON.so.1.1.0
moxi.bin 114179 abcd mem REG 202,1 43960 524960 /lib64/librt-2.12.so
moxi.bin 114179 abcd mem REG 202,1 142688 524956 /lib64/libpthread-2.12.so
moxi.bin 114179 abcd mem REG 202,1 19544 524938 /lib64/libdl-2.12.so
moxi.bin 114179 abcd mem REG 202,1 1975616 525351 /lib64/libcrypto.so.1.0.1k
moxi.bin 114179 abcd mem REG 202,1 445400 6159 /usr/lib64/libssl.so.1.0.1k
moxi.bin 114179 abcd mem REG 202,1 88600 524987 /lib64/libz.so.1.2.3
moxi.bin 114179 abcd mem REG 253,0 404016 28576134 /local/couchbase/opt/couchbase/lib/libcurl.so.4.4.0
moxi.bin 114179 abcd mem REG 253,0 165944 28576141 /local/couchbase/opt/couchbase/lib/libevent_core-2.0.so.5.1.10
moxi.bin 114179 abcd mem REG 253,0 77392 28576173 /local/couchbase/opt/couchbase/lib/libmcd.so.6.1.0
moxi.bin 114179 abcd mem REG 253,0 57576 28576180 /local/couchbase/opt/couchbase/lib/libplatform.so.0.1.0
moxi.bin 114179 abcd mem REG 253,0 29176 28576187 /local/couchbase/opt/couchbase/lib/libvbucket.so.1.1.1
moxi.bin 114179 abcd mem REG 253,0 17296 28576130 /local/couchbase/opt/couchbase/lib/libconflate.so.1.0.0
moxi.bin 114179 abcd mem REG 202,1 158768 525879 /lib64/ld-2.12.so
moxi.bin 114179 abcd 0u CHR 136,0 0t0 3 /dev/pts/0
moxi.bin 114179 abcd 3u 0000 0,11 0 7632 anon_inode
moxi.bin 114179 abcd 10u unix 0xffff881e7256d280 0t0 9055383 socket
moxi.bin 114179 abcd 11u unix 0xffff881e7256bfc0 0t0 9055384 socket
moxi.bin 114179 abcd 12u 0000 0,11 0 7632 anon_inode
moxi.bin 114179 abcd 38u IPv4 9055409 0t0 TCP *:35203 (LISTEN)
moxi.bin 114179 abcd 39u IPv6 9055410 0t0 TCP *:45090 (LISTEN)
moxi.bin 114179 abcd 40u IPv4 9055413 0t0 TCP *:11223 (LISTEN)
moxi.bin 114179 abcd 41u IPv6 9055414 0t0 TCP *:11223 (LISTEN)

[3]
telnet localhost 11223
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
set key1 0 100000 2
ab
SERVER_ERROR proxy downstream closed 127.0.0.1

[4]
telnet localhost 35203
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
set key1 0 100000 2
ab
STORED

after restarting moxi process, get does not return anything.
telnet localhost [different port]
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
get key1

Also noticed in release notes about server-side moxi being deprecated in 4.5. I have currently deployed 4.5. Also tested with 4.1 but same issue.
https://developer.couchbase.com/documentation/server/current/release-notes/relnotes.html#topic_gbk_tyh_t5__table_bl3_533_1v
Server-side moxi proxy is deprecated in 4.5 Use Couchbase client SDKs or client-side moxi in your applications.

Appreciate any pointers.

REST api did the trick and it is now working. Thanks for the help.

When I create the bucket via rest api, it triggers to start moxi process. Api used to create bucket

curl -u Administrator:password -v -X POST http://127.0.0.1:8091/pools/default/buckets -d ‘flushEnabled=1&threadsNumber=3&replicaIndex=0&replicaNumber=0&evictionPolicy=valueOnly&ramQuotaMB=597&bucketType=couchbase&name=default&authType=sasl&saslPassword=’

Also note that if you are creating a custom bucket, set the authType=none

e.g
curl -u Administrator:password -v -X POST http://127.0.0.1:8091/pools/default/buckets -d ‘flushEnabled=1&threadsNumber=3&replicaIndex=0&replicaNumber=0&evictionPolicy=fullEviction&ramQuotaMB=2000&bucketType=couchbase&name=bucketthree&proxyPort=11213&authType=none&saslPassword=’