Setting rocksdb parameters in cnf file when compiling MyRocks from source

Hi,
I’m compiling percona-server from source, as in the installation guide.

Then run mysql using cnf file from here - blog_data/mysqld.cnf at master · y-trudeau/blog_data · GitHub
This is the configuration used in the post - https://www.percona.com/blog/myrocks-use-case/

to run mysql I use the following commands -
mysqld --defaults-file=/etc/my.cnf --initialize-insecure
mysqld --defaults-file=/etc/my.cnf &

mysql fails with the following error:
[ERROR] [MY-000067] [Server] unknown variable ‘rocksdb_default_cf_options=write_buffer_size=64m;target_file_size_base=32m;max_bytes_for_level_base=512m;level0_file_num_compaction_trigger=4;level0_slowdown_writes_trigger=10;level0_stop_writes_trigger=15;max_write_buffer_number=4;compression_per_level=kLZ4Compression;bottommost_compression=kZSTD;compression_opts=-14:1:0;block_based_table_factory={cache_index_and_filter_blocks=1;filter_policy=bloomfilter:10:false;whole_key_filtering=1};level_compaction_dynamic_level_bytes=true;optimize_filters_for_hits=true;compaction_pri=kMinOverlappingRatio’.

It seems that mysql has not rocksDB enabled yet.
The only way I see to enable rocksDB is to run in mySQL the set of INSTALL PLUGIN ROCKSDB commands
This can be done after mysql is already running, but I can’t bring up mysql with rocksdb parameters in the cnf file.

What are the correct steps to bring up MyRocks from source with specific rocksdb parameters?

Thanks,
Shmuel

The exact cnf file I used is:

[mysqld]

datadir=/media/myrocks_data
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log.SW
pid-file=/var/run/mysqld/mysqld.pid
port=3337
user=root

rocksdb_default_cf_options=write_buffer_size=64m;target_file_size_base=32m;max_bytes_for_level_base=512m;level0_file_num_compaction_trigger=4;level0_slowdown_writes_trigger=10;level0_stop_writes_trigger=15;max_write_buffer_number=4;compression_per_level=kLZ4Compression;bottommost_compression=kZSTD;compression_opts=-14:1:0;block_based_table_factory={cache_index_and_filter_blocks=1;filter_policy=bloomfilter:10:false;whole_key_filtering=1};level_compaction_dynamic_level_bytes=true;optimize_filters_for_hits=true;compaction_pri=kMinOverlappingRatio
rocksdb_block_size=16384
rocksdb_bytes_per_sync=4194304
rocksdb_compaction_sequential_deletes=199999
rocksdb_compaction_sequential_deletes_count_sd=1
rocksdb_compaction_sequential_deletes_window=200000
rocksdb_max_background_jobs=8
rocksdb_max_open_files=-1
rocksdb_table_cache_numshardbits=6
transaction_isolation=READ-COMMITTED
rocksdb_block_cache_size=32G
rocksdb_max_total_wal_size=4G
rocksdb_rate_limiter_bytes_per_sec=104857600
rocksdb_wal_recovery_mode=2
performance_schema=off
rocksdb_large_prefix=1
rocksdb_use_direct_io_for_flush_and_compaction=1
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_ALL_TABLES
symbolic-links=0
skip-log-bin
skip-name-resolve

datadir=/media/myrocks_data
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log.SW
pid-file=/var/run/mysqld/mysqld.pid
port=3337
user=root

rocksdb_default_cf_options=write_buffer_size=64m;target_file_size_base=32m;max_bytes_for_level_base=512m;level0_file_num_compaction_trigger=4;level0_slowdown_writes_trigger=10;level0_stop_writes_trigger=15;max_write_buffer_number=4;compression_per_level=kLZ4Compression;bottommost_compression=kZSTD;compression_opts=-14:1:0;block_based_table_factory={cache_index_and_filter_blocks=1;filter_policy=bloomfilter:10:false;whole_key_filtering=1};level_compaction_dynamic_level_bytes=true;optimize_filters_for_hits=true;compaction_pri=kMinOverlappingRatio
rocksdb_block_size=16384
rocksdb_bytes_per_sync=4194304
rocksdb_compaction_sequential_deletes=199999
rocksdb_compaction_sequential_deletes_count_sd=1
rocksdb_compaction_sequential_deletes_window=200000
rocksdb_max_background_jobs=8
rocksdb_max_open_files=-1
rocksdb_table_cache_numshardbits=6
transaction_isolation=READ-COMMITTED
rocksdb_block_cache_size=32G
rocksdb_max_total_wal_size=4G
rocksdb_rate_limiter_bytes_per_sec=104857600
rocksdb_wal_recovery_mode=2
performance_schema=off
rocksdb_large_prefix=1
rocksdb_use_direct_io_for_flush_and_compaction=1
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_ALL_TABLES
symbolic-links=0
skip-log-bin
skip-name-resolve

Yes, correct. MySQL will not recognize variables for plugins until after the plugin is loaded. You can use the following in your my.cnf plugin-load-add=ha_rocksdb.so before the rocksdb_* variables. You can also prefix all rocksdb variables with loose_ if you want to INSTALL PLUGIN after starting MySQL.