├── .circleci └── config.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── Dockerfiles ├── docker-compose.yml ├── leofs-all-in-one │ ├── .s3cfg │ ├── Dockerfile │ └── run_leofs_test2.sh ├── leofs-build-deps │ └── Dockerfile ├── leofs-client-tests │ ├── Dockerfile │ └── run_test.sh ├── leofs-nfs-test │ ├── Dockerfile │ ├── run_container_for_nfs_test.sh │ └── run_nfs_test.sh ├── leofs-package-centos6 │ ├── Dockerfile │ └── run_packaging.sh ├── leofs-package-centos7 │ ├── Dockerfile │ ├── run_container_for_packaging.sh │ └── run_packaging.sh ├── leofs-package-ubuntu14.04 │ ├── Dockerfile │ └── run_packaging.sh ├── leofs-package-ubuntu16.04 │ ├── Dockerfile │ ├── run_container_for_packaging.sh │ └── run_packaging.sh ├── leofs-package-ubuntu18.04 │ ├── Dockerfile │ ├── run_container_for_packaging.sh │ └── run_packaging.sh ├── leofs-release │ └── Dockerfile └── run_test.sh ├── LICENSE ├── Makefile ├── README.md ├── THANKS ├── apps ├── leo_gateway │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── cuttlefish │ ├── dialyzer.ignore-warnings │ ├── include │ │ ├── leo_gateway.hrl │ │ └── leo_http.hrl │ ├── priv │ │ ├── leo_gateway.conf │ │ ├── leo_gateway.conf.test │ │ ├── leo_gateway.schema │ │ ├── leo_gateway_snmp.yml │ │ └── test │ │ │ ├── nginx01.conf │ │ │ ├── nginx02.conf │ │ │ └── nginx03.conf │ ├── rebar │ ├── rebar.config │ ├── rebar.config.develop │ ├── rel │ │ ├── files │ │ │ ├── app.config │ │ │ ├── erl │ │ │ ├── leo_gateway │ │ │ ├── leo_gateway.cmd │ │ │ ├── nodetool │ │ │ ├── server_cert.pem │ │ │ ├── server_key.pem │ │ │ ├── start_erl.cmd │ │ │ ├── sys.config │ │ │ └── vm.args │ │ ├── reltool.config │ │ └── vars.config │ ├── replace_otp_vsn.sh │ ├── snmp │ │ ├── snmpa_gateway_0 │ │ │ ├── LEO-GATEWAY.bin │ │ │ ├── LEO-GATEWAY.mib │ │ │ ├── agent │ │ │ │ └── conf │ │ │ │ │ ├── agent.conf │ │ │ │ │ ├── community.conf │ │ │ │ │ ├── context.conf │ │ │ │ │ ├── notify.conf │ │ │ │ │ ├── standard.conf │ │ │ │ │ └── vacm.conf │ │ │ └── leo_gateway_snmp.config │ │ └── snmpa_gateway_1 │ │ │ ├── LEO-GATEWAY.bin │ │ │ ├── LEO-GATEWAY.mib │ │ │ ├── agent │ │ │ └── conf │ │ │ │ ├── agent.conf │ │ │ │ ├── community.conf │ │ │ │ ├── context.conf │ │ │ │ ├── notify.conf │ │ │ │ ├── standard.conf │ │ │ │ └── vacm.conf │ │ │ └── leo_gateway_snmp.config │ ├── src │ │ ├── leo_gateway.app.src │ │ ├── leo_gateway_api.erl │ │ ├── leo_gateway_app.erl │ │ ├── leo_gateway_cache_statistics.erl │ │ ├── leo_gateway_http_behaviour.erl │ │ ├── leo_gateway_http_commons.erl │ │ ├── leo_gateway_http_req_handler.erl │ │ ├── leo_gateway_rest_api.erl │ │ ├── leo_gateway_rpc_handler.erl │ │ ├── leo_gateway_s3_api.erl │ │ ├── leo_gateway_sup.erl │ │ ├── leo_large_object_commons.erl │ │ ├── leo_large_object_get_handler.erl │ │ ├── leo_large_object_move_handler.erl │ │ ├── leo_large_object_put_handler.erl │ │ ├── leo_large_object_worker.erl │ │ ├── leo_nfs_file_handler.erl │ │ ├── leo_nfs_mount3.hrl │ │ ├── leo_nfs_mount3.x │ │ ├── leo_nfs_mount3_server.erl │ │ ├── leo_nfs_mount3_svc.erl │ │ ├── leo_nfs_mount3_xdr.erl │ │ ├── leo_nfs_proto3.hrl │ │ ├── leo_nfs_proto3.x │ │ ├── leo_nfs_proto3_server.erl │ │ ├── leo_nfs_proto3_svc.erl │ │ ├── leo_nfs_proto3_xdr.erl │ │ ├── leo_nfs_readdir_state_behaviour.erl │ │ ├── leo_nfs_readdir_state_ets_server.erl │ │ ├── leo_nfs_state_behaviour.erl │ │ ├── leo_nfs_state_ets.erl │ │ ├── leo_nginx_conf_parser.erl │ │ ├── leo_nlm_lock_behaviour.erl │ │ ├── leo_nlm_lock_handler_common.erl │ │ ├── leo_nlm_lock_handler_ets.erl │ │ ├── leo_nlm_proto4.hrl │ │ ├── leo_nlm_proto4.x │ │ ├── leo_nlm_proto4_server.erl │ │ ├── leo_nlm_proto4_svc.erl │ │ ├── leo_nlm_proto4_xdr.erl │ │ └── leofs.erl │ └── test │ │ ├── FileLockTest.java │ │ ├── Makefile │ │ ├── leo_gateway_rpc_handler_tests.erl │ │ ├── leo_gateway_web_prop.erl │ │ ├── leo_gateway_web_tests.erl │ │ ├── leo_nfs_integration_tests.sh │ │ ├── leo_nfs_readdir_state_ets_server_tests.erl │ │ ├── leo_nginx_conf_parser_tests.erl │ │ ├── nfs_dummy_test_avs.log │ │ └── nfs_dummy_test_avs.tar.gz ├── leo_manager │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── cuttlefish │ ├── dialyzer.ignore-warnings │ ├── include │ │ ├── leo_manager.hrl │ │ └── tcp_server.hrl │ ├── priv │ │ ├── leo_manager_0.conf │ │ ├── leo_manager_0.conf.test │ │ ├── leo_manager_0.schema │ │ ├── leo_manager_1.conf │ │ ├── leo_manager_1.schema │ │ └── leo_manager_snmp.yml │ ├── rebar │ ├── rebar.config │ ├── rebar.config.develop │ ├── rel │ │ ├── files │ │ │ ├── app.config │ │ │ ├── erl │ │ │ ├── leo_manager │ │ │ ├── leo_manager.cmd │ │ │ ├── nodetool │ │ │ ├── start_erl.cmd │ │ │ ├── sys.config │ │ │ └── vm.args │ │ ├── reltool.config │ │ └── vars.config │ ├── replace_otp_vsn.sh │ ├── snmp │ │ ├── snmpa_manager_0 │ │ │ ├── LEO-MANAGER.bin │ │ │ ├── LEO-MANAGER.funcs │ │ │ ├── LEO-MANAGER.mib │ │ │ ├── agent │ │ │ │ └── conf │ │ │ │ │ ├── agent.conf │ │ │ │ │ ├── community.conf │ │ │ │ │ ├── context.conf │ │ │ │ │ ├── notify.conf │ │ │ │ │ ├── standard.conf │ │ │ │ │ └── vacm.conf │ │ │ └── leo_manager_snmp.config │ │ ├── snmpa_manager_1 │ │ │ ├── LEO-MANAGER.bin │ │ │ ├── LEO-MANAGER.funcs │ │ │ ├── LEO-MANAGER.mib │ │ │ ├── agent │ │ │ │ └── conf │ │ │ │ │ ├── agent.conf │ │ │ │ │ ├── community.conf │ │ │ │ │ ├── context.conf │ │ │ │ │ ├── notify.conf │ │ │ │ │ ├── standard.conf │ │ │ │ │ └── vacm.conf │ │ │ └── leo_manager_snmp.config │ │ ├── snmpa_manager_2 │ │ │ ├── LEO-MANAGER.bin │ │ │ ├── LEO-MANAGER.funcs │ │ │ ├── LEO-MANAGER.mib │ │ │ ├── agent │ │ │ │ └── conf │ │ │ │ │ ├── agent.conf │ │ │ │ │ ├── community.conf │ │ │ │ │ ├── context.conf │ │ │ │ │ ├── notify.conf │ │ │ │ │ ├── standard.conf │ │ │ │ │ └── vacm.conf │ │ │ └── leo_manager_snmp.config │ │ └── snmpa_manager_3 │ │ │ ├── LEO-MANAGER.bin │ │ │ ├── LEO-MANAGER.funcs │ │ │ ├── LEO-MANAGER.mib │ │ │ ├── agent │ │ │ └── conf │ │ │ │ ├── agent.conf │ │ │ │ ├── community.conf │ │ │ │ ├── context.conf │ │ │ │ ├── notify.conf │ │ │ │ ├── standard.conf │ │ │ │ └── vacm.conf │ │ │ └── leo_manager_snmp.config │ ├── src │ │ ├── leo_manager.app.src │ │ ├── leo_manager_api.erl │ │ ├── leo_manager_app.erl │ │ ├── leo_manager_cluster_monitor.erl │ │ ├── leo_manager_console.erl │ │ ├── leo_manager_console_behaiviour.erl │ │ ├── leo_manager_del_bucket_handler.erl │ │ ├── leo_manager_formatter_commons.erl │ │ ├── leo_manager_formatter_json.erl │ │ ├── leo_manager_formatter_text.erl │ │ ├── leo_manager_mnesia.erl │ │ ├── leo_manager_mq_client.erl │ │ ├── leo_manager_ring_sync.erl │ │ ├── leo_manager_sup.erl │ │ ├── leo_manager_table_sync.erl │ │ ├── leo_manager_transformer.erl │ │ ├── tcp_server.erl │ │ ├── tcp_server_acceptor.erl │ │ └── tcp_server_sup.erl │ └── test │ │ └── leo_manager_mnesia_tests.erl └── leo_storage │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── cuttlefish │ ├── dialyzer.ignore-warnings │ ├── include │ └── leo_storage.hrl │ ├── priv │ ├── leo_storage.conf │ ├── leo_storage.conf.test │ ├── leo_storage.schema │ └── leo_storage_snmp.yml │ ├── rebar │ ├── rebar.config │ ├── rel │ ├── files │ │ ├── app.config │ │ ├── erl │ │ ├── leo_storage │ │ ├── leo_storage.cmd │ │ ├── nodetool │ │ ├── start_erl.cmd │ │ ├── sys.config │ │ └── vm.args │ ├── reltool.config │ └── vars.config │ ├── replace_otp_vsn.sh │ ├── snmp │ ├── snmpa_storage_0 │ │ ├── LEO-STORAGE.bin │ │ ├── LEO-STORAGE.funcs │ │ ├── LEO-STORAGE.mib │ │ ├── agent │ │ │ └── conf │ │ │ │ ├── agent.conf │ │ │ │ ├── community.conf │ │ │ │ ├── context.conf │ │ │ │ ├── notify.conf │ │ │ │ ├── standard.conf │ │ │ │ └── vacm.conf │ │ └── leo_storage_snmp.config │ ├── snmpa_storage_1 │ │ ├── LEO-STORAGE.bin │ │ ├── LEO-STORAGE.funcs │ │ ├── LEO-STORAGE.mib │ │ ├── agent │ │ │ └── conf │ │ │ │ ├── agent.conf │ │ │ │ ├── community.conf │ │ │ │ ├── context.conf │ │ │ │ ├── notify.conf │ │ │ │ ├── standard.conf │ │ │ │ └── vacm.conf │ │ └── leo_storage_snmp.config │ ├── snmpa_storage_2 │ │ ├── LEO-STORAGE.bin │ │ ├── LEO-STORAGE.mib │ │ ├── agent │ │ │ └── conf │ │ │ │ ├── agent.conf │ │ │ │ ├── community.conf │ │ │ │ ├── context.conf │ │ │ │ ├── notify.conf │ │ │ │ ├── standard.conf │ │ │ │ └── vacm.conf │ │ └── leo_storage_snmp.config │ ├── snmpa_storage_3 │ │ ├── LEO-STORAGE.bin │ │ ├── LEO-STORAGE.mib │ │ ├── agent │ │ │ └── conf │ │ │ │ ├── agent.conf │ │ │ │ ├── community.conf │ │ │ │ ├── context.conf │ │ │ │ ├── notify.conf │ │ │ │ ├── standard.conf │ │ │ │ └── vacm.conf │ │ └── leo_storage_snmp.config │ └── snmpa_storage_4 │ │ ├── LEO-STORAGE.bin │ │ ├── LEO-STORAGE.mib │ │ ├── agent │ │ └── conf │ │ │ ├── agent.conf │ │ │ ├── community.conf │ │ │ ├── context.conf │ │ │ ├── notify.conf │ │ │ ├── standard.conf │ │ │ └── vacm.conf │ │ └── leo_storage_snmp.config │ ├── src │ ├── leo_storage.app.src │ ├── leo_storage_api.erl │ ├── leo_storage_app.erl │ ├── leo_storage_cluster_monitor.erl │ ├── leo_storage_handler_del_directory.erl │ ├── leo_storage_handler_directory.erl │ ├── leo_storage_handler_object.erl │ ├── leo_storage_handler_sync.erl │ ├── leo_storage_mq.erl │ ├── leo_storage_msg_collector.erl │ ├── leo_storage_read_repairer.erl │ ├── leo_storage_replicator.erl │ ├── leo_storage_statistics.erl │ ├── leo_storage_sup.erl │ ├── leo_storage_watchdog_error.erl │ ├── leo_storage_watchdog_fragment.erl │ ├── leo_storage_watchdog_msgs.erl │ ├── leo_storage_watchdog_sub.erl │ ├── leo_sync_local_cluster.erl │ └── leo_sync_remote_cluster.erl │ └── test │ ├── basho_bench_driver_leo_storage.erl │ ├── leo_storage_api_tests.erl │ ├── leo_storage_handler_directory_tests.erl │ ├── leo_storage_handler_object_tests.erl │ ├── leo_storage_mq_tests.erl │ ├── leo_storage_read_repairer_tests.erl │ ├── leo_storage_replicator_tests.erl │ ├── leo_storage_test.config │ ├── leo_sync_local_cluster_tests.erl │ └── leo_sync_remote_cluster_tests.erl ├── bootstrap.sh ├── build_mdcr_env.sh ├── docs ├── LICENSE ├── README.md ├── admin │ ├── index_of_commands.md │ ├── protocols │ │ ├── nfs_v3.md │ │ ├── rest.md │ │ └── s3.md │ ├── settings │ │ ├── README.md │ │ ├── cluster.md │ │ ├── environment_config.md │ │ ├── leo_gateway.md │ │ ├── leo_manager.md │ │ └── leo_storage.md │ ├── setup │ │ ├── hardware_requirements.md │ │ ├── network_config.md │ │ ├── planning_for_production.md │ │ └── supported_platforms.md │ ├── system_admin │ │ ├── backup_and_restore.md │ │ ├── integration.md │ │ ├── leo_manager.md │ │ ├── load_balancing.md │ │ ├── log_management.md │ │ ├── migration.md │ │ ├── monitoring.md │ │ ├── multiple_nodes.md │ │ └── persistent_configuration.md │ ├── system_operations │ │ ├── cluster.md │ │ ├── data.md │ │ ├── flow.md │ │ ├── multi_dc_replication.md │ │ ├── others.md │ │ ├── s3.md │ │ └── systemd.md │ └── troubleshooting.md ├── architecture │ ├── README.md │ ├── leo_gateway.md │ ├── leo_manager.md │ └── leo_storage.md ├── assets │ ├── graffle │ │ └── leofs-avs-file-format.graffle.zip │ ├── images │ │ └── favicon.png │ ├── leofs-architecture.001.jpg │ ├── leofs-architecture.0012.jpg │ ├── leofs-architecture.002.jpg │ ├── leofs-architecture.003.jpg │ ├── leofs-architecture.005.jpg │ ├── leofs-architecture.006.jpg │ ├── leofs-architecture.007.jpg │ ├── leofs-auto-compaction-figure.jpg │ ├── leofs-avs-file-format.jpg │ ├── leofs-compaction-state-transition.png │ ├── leofs-flow-diagram.jpg │ ├── leofs-gateway-disk-cache-size.png │ ├── leofs-monitoring-with-grafana.png │ ├── leofs-mq-figure.jpg │ ├── leofs-order-of-system-launch.png │ ├── leofs-upgrade-flow-diagram.jpg │ ├── leofs-watchdog-auto-compaction.jpg │ └── leofs-watchdog-mq.jpg ├── benchmark │ └── README.md ├── book.json ├── faq │ ├── administration.md │ ├── client.md │ ├── fundamentals.md │ └── limits.md ├── index.md ├── installation │ ├── cluster.md │ └── quick.md ├── issues │ └── documentation-issues.md ├── production_checklist │ └── README.md └── whats_new.md ├── git_checkout.sh ├── git_switch_head.sh ├── leofs-adm ├── leofs.mk ├── make_libs_docs.sh ├── make_reltool.sh ├── mdcr.sh ├── mkdocs.yml ├── mv_avs_dir.sh ├── pkg ├── Makefile ├── bootstrap │ └── .gitignore ├── leo_gateway │ ├── .gitignore │ ├── Makefile │ ├── comment │ ├── deinstall.sh │ ├── deploy │ │ ├── .gitignore │ │ └── sbin │ │ │ └── leo_gateway │ ├── description │ ├── displayfile │ ├── files │ │ ├── leo_gateway.conf │ │ ├── leo_gateway.xml │ │ ├── leo_gateway_snmp.config.0 │ │ ├── leo_gateway_snmp.config.1 │ │ └── start │ ├── install.sh │ ├── post_pkg │ └── pre_pkg ├── leo_manager │ ├── .gitignore │ ├── Makefile │ ├── comment │ ├── deinstall.sh │ ├── deploy │ │ ├── .gitignore │ │ └── sbin │ │ │ └── leo_manager │ ├── description │ ├── displayfile │ ├── files │ │ ├── leo_manager.conf.master │ │ ├── leo_manager.conf.slave │ │ ├── leo_manager.xml │ │ ├── leo_manager_snmp.config │ │ └── start │ └── install.sh └── leo_storage │ ├── .gitignore │ ├── Makefile │ ├── comment │ ├── deinstall.sh │ ├── deploy │ ├── .gitignore │ └── sbin │ │ └── leo_storage │ ├── description │ ├── displayfile │ ├── files │ ├── leo_storage │ ├── leo_storage.conf │ ├── leo_storage.xml │ ├── leo_storage_snmp.config.0 │ ├── leo_storage_snmp.config.1 │ ├── leo_storage_snmp.config.2 │ ├── leo_storage_snmp.config.3 │ └── start │ ├── install.sh │ ├── post_pkg │ └── pre_pkg ├── priv ├── mon │ ├── README.md │ ├── leofs-mon │ ├── leofs-mon-screenshot.png │ ├── template │ │ ├── leofs-gateway.grafana │ │ ├── leofs-gateway.telegraf │ │ ├── leofs-manager.grafana │ │ ├── leofs-manager.telegraf │ │ ├── leofs-storage.grafana │ │ └── leofs-storage.telegraf │ └── template_12 │ │ ├── leofs-gateway.grafana │ │ ├── leofs-gateway.telegraf │ │ ├── leofs-manager.grafana │ │ ├── leofs-manager.telegraf │ │ ├── leofs-storage.grafana │ │ └── leofs-storage.telegraf └── test │ ├── cache-test │ ├── app-g0.conf │ ├── app-m0.conf │ ├── app-m1.conf │ ├── app-s0.conf │ ├── app-s1.conf │ ├── app-s2.conf │ ├── app-s3.conf │ └── app-s4.conf │ ├── http-cache-test │ ├── app-g0.conf │ ├── app-m0.conf │ ├── app-m1.conf │ ├── app-s0.conf │ ├── app-s1.conf │ ├── app-s2.conf │ ├── app-s3.conf │ └── app-s4.conf │ ├── integration-test │ ├── app-g0.conf │ ├── app-m0.conf │ ├── app-m1.conf │ ├── app-s0.conf │ ├── app-s1.conf │ ├── app-s2.conf │ ├── app-s3.conf │ └── app-s4.conf │ ├── ls-test │ ├── README.md │ └── leofs-ls-bench │ ├── mdcr-test │ ├── c1 │ │ ├── leo_gateway.conf │ │ ├── leo_manager.conf.0 │ │ ├── leo_manager.conf.1 │ │ ├── leo_storage_0.conf │ │ ├── leo_storage_1.conf │ │ ├── leo_storage_2.conf │ │ └── leo_storage_3.conf │ └── c2 │ │ ├── leo_gateway.conf │ │ ├── leo_manager.conf.0 │ │ ├── leo_manager.conf.1 │ │ ├── leo_storage_0.conf │ │ ├── leo_storage_1.conf │ │ ├── leo_storage_2.conf │ │ └── leo_storage_3.conf │ ├── rack-awareness-test │ ├── app-g0.conf │ ├── app-m0.conf │ ├── app-m1.conf │ ├── app-s0.conf │ ├── app-s1.conf │ ├── app-s2.conf │ ├── app-s3.conf │ └── app-s4.conf │ └── watchdog-test │ ├── app-g0.conf │ ├── app-m0.conf │ ├── app-m1.conf │ ├── app-s0.conf │ ├── app-s1.conf │ ├── app-s2.conf │ ├── app-s3.conf │ └── app-s4.conf ├── rebar ├── rebar.config ├── rebar.config.project-fifo ├── rel ├── common │ ├── launch.environment │ ├── launch.sh │ ├── leofs-limits.conf │ ├── leofs.conf │ └── nodetool ├── leo_gateway │ ├── files │ │ ├── app.config │ │ ├── erl │ │ ├── leo_gateway.cmd │ │ ├── server_cert.pem │ │ ├── server_key.pem │ │ ├── start_erl.cmd │ │ ├── sys.config │ │ └── vm.args │ ├── reltool.config.in │ └── vars.config ├── leo_manager │ ├── files │ │ ├── app.config │ │ ├── erl │ │ ├── leo_manager.cmd │ │ ├── start_erl.cmd │ │ ├── sys.config │ │ └── vm.args │ ├── reltool.config.in │ └── vars.config ├── leo_storage │ ├── files │ │ ├── app.config │ │ ├── erl │ │ ├── leo_storage.cmd │ │ ├── start_erl.cmd │ │ ├── sys.config │ │ └── vm.args │ ├── reltool.config.in │ └── vars.config └── service │ ├── 90-leofs.preset │ ├── leofs-epmd.service.pre │ ├── leofs-epmd.socket │ ├── leofs-gateway.service │ ├── leofs-manager-master.service │ ├── leofs-manager-slave.service │ └── leofs-storage.service ├── releasenotes ├── leofs-0.10.md ├── leofs-0.12.md ├── leofs-0.14.md ├── leofs-0.16.md ├── leofs-0.9.md ├── leofs-1.0.md ├── leofs-1.1.md ├── leofs-1.2.md ├── leofs-1.3.md └── leofs-1.4.md ├── replace_otp_vsn.sh └── test ├── conf ├── leofs_16K_LOAD1M.config ├── leofs_R8W2.config └── leofs_integrity_test.config ├── include └── leo_s3_auth.hrl ├── src ├── basho_bench_driver_leofs.erl └── leo_s3_auth.erl ├── test_it_compaction_during_del_bucket.sh ├── test_it_del_bucket.sh ├── test_it_del_bucket_while_one_node_is_unavailable.sh └── test_it_rebalance_during_del_bucket.sh /.gitignore: -------------------------------------------------------------------------------- 1 | _build/ 2 | deps/ 3 | rel/leo_manager/leo_manager/ 4 | rel/leo_manager/service/ 5 | rel/leo_gateway/leo_gateway/ 6 | rel/leo_storage/leo_storage/ 7 | package/ 8 | 9 | rel/leo_manager/files/leo_manager.conf 10 | rel/leo_manager/files/leo_manager.schema 11 | 12 | # ignore this because it is env dependent 13 | rel/common/launch.environment 14 | 15 | # reltool.config files are generated from reltool.config.in 16 | rel/leo_gateway/reltool.config 17 | rel/leo_manager/reltool.config 18 | rel/leo_storage/reltool.config 19 | 20 | apps/leo_gateway/cache/ 21 | 22 | docs/_book/ 23 | docs/node_modules/ 24 | site/ 25 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "website"] 2 | path = website 3 | url = https://github.com/leo-project/website.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: erlang 2 | script: "make test" 3 | notifications: 4 | email: false 5 | otp_release: 6 | - 19.3 7 | - 20.3 8 | - 21.3 9 | - 22.2 10 | before_install: 11 | - sudo apt-get update -qq 12 | - sudo apt-get install -y check 13 | -------------------------------------------------------------------------------- /Dockerfiles/docker-compose.yml: -------------------------------------------------------------------------------- 1 | tester: 2 | image: leoproject/leofs-client-tests:0.1 3 | links: 4 | - leofs:s3.amazonaws.com 5 | - leofs:testc.s3.amazonaws.com 6 | - leofs:testg.s3.amazonaws.com 7 | - leofs:testp.s3.amazonaws.com 8 | 9 | leofs: 10 | image: leoproject/leofs-all-in-one:latest 11 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-all-in-one/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM leoproject/leofs-build-deps:0.1 2 | 3 | ARG REPO_BRANCH="develop" 4 | 5 | RUN set -xe \ 6 | # install leofs 7 | && git clone https://github.com/leo-project/leofs.git \ 8 | && cd leofs \ 9 | && git checkout $REPO_BRANCH \ 10 | ## add -q option for netcat(nc) to close the client socket and nc works as expected 11 | && sed -e "s/-N/-q 1/g" leofs-adm > leofs-adm.new \ 12 | && mv leofs-adm.new leofs-adm \ 13 | && chmod +x leofs-adm \ 14 | && make \ 15 | && cd .. \ 16 | # install leofs_test2 17 | && git clone https://github.com/leo-project/leofs_test2.git \ 18 | && cd leofs_test2 \ 19 | && make 20 | 21 | ## install s3cmd for delete-bucket tests 22 | RUN set -xe \ 23 | && apt-get -y install s3cmd \ 24 | && cd /leofs \ 25 | && sed -e "s/\.\/boot/USER=root \.\/boot/g" test/test_it_del_bucket.sh > test/test_it_del_bucket.sh.new \ 26 | && cp test/test_it_del_bucket.sh.new test/test_it_del_bucket.sh 27 | 28 | Add .s3cfg /root 29 | Add run_leofs_test2.sh /leofs 30 | 31 | WORKDIR /leofs 32 | 33 | EXPOSE 22 8080 10010 10011 10020 10021 34 | 35 | CMD USER=root ./bootstrap.sh start integration-test ; tail -f /dev/null 36 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-all-in-one/run_leofs_test2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -xe 4 | 5 | USER=root ./bootstrap.sh start cache-test 6 | sleep 3 7 | /leofs_test2/_build/default/bin/leofs_test -d /leofs/package/ -b test 8 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-build-deps/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM erlang:19.3.6.9-slim 2 | 3 | RUN set -xe \ 4 | && apt-get update \ 5 | && apt-get -y install build-essential libtool libncurses5-dev libssl-dev cmake check curl git g++ lsb-release \ 6 | && apt-get -y install sudo netcat-traditional 7 | 8 | CMD tail -f /dev/null 9 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-client-tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM leoproject/leofs-build-deps:0.1 2 | 3 | WORKDIR /root 4 | 5 | ENV GOPATH="$HOME/go" 6 | 7 | RUN set -xe \ 8 | && apt-get update \ 9 | # deps 10 | && apt-get -y install libcurl4-openssl-dev openjdk-7-jdk ant \ 11 | php5 php5-curl php-aws-sdk \ 12 | ruby ruby-dev libmagic-dev python-pip \ 13 | ## for aws-sdk-ruby 14 | && gem install aws-sdk \ 15 | && gem install rack -v=1.6.4 \ 16 | && gem install jeweler -v=1.6.4 \ 17 | && gem install content_type --conservative \ 18 | ## for boto/boto3 19 | && pip install boto boto3 filechunkio \ 20 | ## for aws-sdk-go 21 | && mkdir $GOPATH \ 22 | && curl -o go.tgz https://dl.google.com/go/go1.6.4.linux-amd64.tar.gz \ 23 | && echo "b58bf5cede40b21812dfa031258db18fc39746cc0972bc26dae0393acc377aaf *go.tgz" | sha256sum -c - \ 24 | && tar -C /usr/local -xzf go.tgz \ 25 | && rm go.tgz \ 26 | && export PATH="/usr/local/go/bin:$PATH" \ 27 | && go get github.com/aws/aws-sdk-go/service/s3 \ 28 | # build leofs_client_tests 29 | && git clone https://github.com/leo-project/leofs_client_tests.git \ 30 | && cd leofs_client_tests \ 31 | && git submodule update -i \ 32 | ## generate test data 33 | && cd temp_data \ 34 | && ./gen.sh \ 35 | && cd .. \ 36 | ## prep for aws-sdk-cpp 37 | && cd aws-sdk-cpp \ 38 | && mkdir build \ 39 | && cd build \ 40 | && cmake -DBUILD_ONLY="s3" .. \ 41 | && make \ 42 | && cd ../.. \ 43 | ## prep for aws-sdk-php 44 | && cd aws-sdk-php \ 45 | && curl -sS https://getcomposer.org/installer | php \ 46 | && php composer.phar install 47 | 48 | ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH 49 | 50 | ADD run_test.sh /root/leofs_client_tests/ 51 | 52 | CMD /root/leofs_client_tests/run_test.sh 53 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-client-tests/run_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ROOT_DIR=/root/leofs_client_tests 4 | 5 | # Prerequsites 6 | ## 1. Run coupled with the service leofs through docker-compose 7 | ## 2. DNS names like testc.leofs should be resolved through aliases (alternative hostnames) 8 | ## For more details, refer https://docs.docker.com/compose/compose-file/#aliases 9 | ## OR links for docker-compose.yml version 1 10 | ## For more details, refer https://docs.docker.com/compose/compose-file/compose-file-v1/#links 11 | 12 | ## Wait for the test LeoFS cluster up 13 | until curl http://testc.s3.amazonaws.com:8080/path/to/file; [ $? -eq 0 ]; do 14 | sleep 5 15 | done 16 | 17 | ## for safe 18 | sleep 5 19 | 20 | set -xe 21 | (cd $ROOT_DIR/aws-sdk-cpp/build; ./LeoFSTest.cpp v4 s3.amazonaws.com 8080 testc) 22 | (cd $ROOT_DIR/aws-sdk-go; go run ./LeoFSTest.go v4 s3.amazonaws.com 8080 testg) 23 | (cd $ROOT_DIR/aws-sdk-java; ant -Dsignver=v4 -Dhost="s3.amazonaws.com" -Dport=8080 -Dbucket="testj") 24 | (cd $ROOT_DIR/aws-sdk-php; php ./LeoFSTest.php v4 s3.amazonaws.com 8080 testp) 25 | (cd $ROOT_DIR/aws-sdk-ruby; ruby ./LeoFSTest.rb v4 s3.amazonaws.com 8080 testr) 26 | (cd $ROOT_DIR/boto; python ./LeoFSTest.py v4 s3.amazonaws.com 8080 testb) 27 | (cd $ROOT_DIR/boto3; python ./LeoFSTest.py v4 s3.amazonaws.com 8080 testb3) 28 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-nfs-test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM leoproject/leofs-all-in-one:latest 2 | 3 | WORKDIR /leofs 4 | 5 | RUN set -xe \ 6 | # install NFS utility and deps for leo_nfs_integration_tests.sh 7 | && apt-get -y install nfs-common uuid-runtime \ 8 | ## modify leo_gateway.conf to use NFS 9 | && sed -e "s/s3/nfs/g" apps/leo_gateway/priv/leo_gateway.conf > apps/leo_gateway/priv/leo_gateway.conf.new \ 10 | && mv apps/leo_gateway/priv/leo_gateway.conf.new apps/leo_gateway/priv/leo_gateway.conf \ 11 | ## modify leo_storage.conf to change the AVS dir 12 | && sed -e "s/\.\/avs/\/ssd\/avs/g" apps/leo_storage/priv/leo_storage.conf > apps/leo_storage/priv/leo_storage.conf.new \ 13 | && mv apps/leo_storage/priv/leo_storage.conf.new apps/leo_storage/priv/leo_storage.conf \ 14 | ## initialize the AVS dir for the NFS test 15 | && mkdir -p /mnt/leofs \ 16 | && mkdir /ssd \ 17 | && (cd apps/leo_gateway/test/; tar xzf nfs_dummy_test_avs.tar.gz -C /ssd) \ 18 | && USER=root make release_for_test 19 | 20 | Add run_nfs_test.sh /leofs 21 | 22 | CMD bash 23 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-nfs-test/run_container_for_nfs_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONTAINER_NAME=leo-nfs-tester 4 | set -xe 5 | 6 | docker pull leoproject/leofs-nfs-test:latest 7 | docker run --rm --privileged=true --name $CONTAINER_NAME leoproject/leofs-nfs-test:latest /sbin/init & 8 | 9 | # for safe 10 | sleep 10 11 | 12 | docker exec -it $CONTAINER_NAME ./run_nfs_test.sh 13 | RET=$? 14 | docker container stop $CONTAINER_NAME 15 | return $RET 16 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-nfs-test/run_nfs_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -xe 4 | 5 | service rpcbind start 6 | 7 | ./package/leo_manager_0/bin/leo_manager start 8 | sleep 1 9 | ./package/leo_manager_0/bin/leo_manager wait_ready 10 | 11 | ./package/leo_manager_1/bin/leo_manager start 12 | ./package/leo_manager_1/bin/leo_manager wait_ready 13 | 14 | ./package/leo_storage/bin/leo_storage start 15 | ./package/leo_gateway/bin/leo_gateway start 16 | ./package/leo_storage/bin/leo_storage wait_ready 17 | ./package/leo_gateway/bin/leo_gateway wait_ready 18 | 19 | ./leofs-adm start 20 | 21 | sleep 3 22 | 23 | ./leofs-adm add-bucket test 05236 24 | ./leofs-adm gen-nfs-mnt-key test 05236 127.0.0.1 25 | 26 | ./apps/leo_gateway/test/leo_nfs_integration_tests.sh 27 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-centos6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:6 2 | 3 | RUN set -xe \ 4 | && yum -y install gcc glibc-devel make ncurses-devel openssl-devel autoconf \ 5 | curl git cmake check check-devel automake \ 6 | patch gcc-c++ redhat-lsb-core nmap-ncat rpm-build lzo-devel \ 7 | sysstat wget sudo nc 8 | 9 | RUN set -xe \ 10 | && curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl \ 11 | && chmod a+x kerl \ 12 | && mkdir -p ~/bin \ 13 | && mv kerl ~/bin \ 14 | && echo "export PATH=$PATH:~/bin" >> ~/.bashrc \ 15 | && echo 'KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll" ' > ~/.kerlrc \ 16 | && ~/bin/kerl build 19.3 19.3 \ 17 | && mkdir -p ~/erlang/19.3 \ 18 | && ~/bin/kerl install 19.3 ~/erlang/19.3/ \ 19 | && echo "source ~/erlang/19.3/activate" >> ~/.bashrc \ 20 | && git clone https://github.com/leo-project/leofs_package.git \ 21 | && mkdir -p ~/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS} \ 22 | && cp leofs_package/rpm/make_rpm.sh ~/rpm/SPECS \ 23 | && cp leofs_package/rpm/leofs.spec ~/rpm/SPECS \ 24 | && cp leofs_package/common/check_version.sh ~/rpm/SPECS 25 | 26 | RUN set -xe \ 27 | && wget https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz \ 28 | && tar xzf hub-linux-amd64-2.5.0.tgz \ 29 | && ./hub-linux-amd64-2.5.0/install 30 | 31 | ADD run_packaging.sh /root/rpm/SPECS 32 | 33 | WORKDIR /root/rpm/SPECS 34 | 35 | CMD bash 36 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-centos6/run_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -xe 4 | 5 | # $1: The release tag will be set 6 | 7 | . ~/erlang/19.3/activate 8 | 9 | # 1. Do packaging 10 | sh make_rpm.sh $1 11 | 12 | # 2. Install the package 13 | rpm -i ~/rpmbuild/RPMS/x86_64/leofs-${1}-1.x86_64.rpm 14 | chsh -s /bin/bash leofs 15 | 16 | # 3. start LeoFS 17 | /usr/local/leofs/current/leo_manager_0/bin/leo_manager start 18 | /usr/local/leofs/current/leo_manager_0/bin/leo_manager wait_ready 19 | 20 | /usr/local/leofs/current/leo_manager_1/bin/leo_manager start 21 | /usr/local/leofs/current/leo_manager_1/bin/leo_manager wait_ready 22 | 23 | /usr/local/leofs/current/leo_storage/bin/leo_storage start 24 | /usr/local/leofs/current/leo_gateway/bin/leo_gateway start 25 | /usr/local/leofs/current/leo_storage/bin/leo_storage wait_ready 26 | /usr/local/leofs/current/leo_gateway/bin/leo_gateway wait_ready 27 | 28 | /usr/local/leofs/current/leofs-adm start 29 | /usr/local/leofs/current/leofs-adm add-bucket test 05236 30 | 31 | # 4. Upload the package as a release asset with release-id passed by a shell argument 32 | # Refer to https://developer.github.com/v3/repos/releases/#upload-a-release-asset 33 | git clone https://github.com/leo-project/leofs.git 34 | cd leofs 35 | mv ~/rpmbuild/RPMS/x86_64/leofs-${1}-1.x86_64.rpm leofs-${1}-1.el6.x86_64.rpm 36 | hub release edit -m "" -a leofs-${1}-1.el6.x86_64.rpm $1 37 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-centos7/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | RUN set -xe \ 4 | && yum -y install gcc glibc-devel make ncurses-devel openssl-devel autoconf \ 5 | curl git cmake check check-devel automake systemd-devel \ 6 | patch gcc-c++ redhat-lsb-core nmap-ncat rpm-build lzo-devel \ 7 | sysstat wget sudo nc 8 | 9 | RUN set -xe \ 10 | && curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl \ 11 | && chmod a+x kerl \ 12 | && mkdir -p ~/bin \ 13 | && mv kerl ~/bin \ 14 | && echo "export PATH=$PATH:~/bin" >> ~/.bashrc \ 15 | && echo 'KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-systemd" ' > ~/.kerlrc \ 16 | && ~/bin/kerl build 19.3 19.3_systemd \ 17 | && mkdir -p ~/erlang/19.3_systemd \ 18 | && ~/bin/kerl install 19.3_systemd ~/erlang/19.3_systemd/ \ 19 | && echo "source ~/erlang/19.3_systemd/activate" >> ~/.bashrc \ 20 | && git clone https://github.com/leo-project/leofs_package.git \ 21 | && mkdir -p ~/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS} \ 22 | && cp leofs_package/rpm/make_rpm.sh ~/rpm/SPECS \ 23 | && cp leofs_package/rpm/leofs.spec ~/rpm/SPECS \ 24 | && cp leofs_package/common/check_version.sh ~/rpm/SPECS 25 | 26 | RUN set -xe \ 27 | && yum -y install which \ 28 | && wget https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz \ 29 | && tar xzf hub-linux-amd64-2.5.0.tgz \ 30 | && ./hub-linux-amd64-2.5.0/install 31 | 32 | ADD run_packaging.sh /root/rpm/SPECS 33 | 34 | WORKDIR /root/rpm/SPECS 35 | 36 | CMD bash 37 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-centos7/run_container_for_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONTAINER_NAME=leo-centos7-packager 4 | set -xe 5 | 6 | docker pull leoproject/leofs-package-centos7:latest 7 | docker run --rm --privileged=true --name $CONTAINER_NAME leoproject/leofs-package-centos7:latest /sbin/init & 8 | 9 | # for safe 10 | sleep 10 11 | 12 | docker exec -it -e GITHUB_USER=$1 -e GITHUB_PASSWORD=$2 $CONTAINER_NAME ./run_packaging.sh $3 13 | RET=$? 14 | docker container stop $CONTAINER_NAME 15 | return $RET 16 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-centos7/run_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -xe 4 | 5 | # $1: The release tag will be set 6 | 7 | . ~/erlang/19.3_systemd/activate 8 | 9 | # 1. Do packaging 10 | sh make_rpm.sh $1 11 | 12 | # 2. Install the package 13 | rpm -i ~/rpmbuild/RPMS/x86_64/leofs-${1}-1.x86_64.rpm 14 | chsh -s /bin/bash leofs 15 | 16 | # 3. start LeoFS through systemd 17 | systemctl start leofs-manager-master 18 | systemctl start leofs-manager-slave 19 | systemctl start leofs-storage 20 | systemctl start leofs-gateway 21 | 22 | sleep 5 23 | 24 | /usr/local/leofs/current/leofs-adm start 25 | /usr/local/leofs/current/leofs-adm add-bucket test 05236 26 | 27 | # 4. Upload the package as a release asset with release-id passed by a shell argument 28 | # Refer to https://developer.github.com/v3/repos/releases/#upload-a-release-asset 29 | git clone https://github.com/leo-project/leofs.git 30 | cd leofs 31 | mv ~/rpmbuild/RPMS/x86_64/leofs-${1}-1.x86_64.rpm leofs-${1}-1.el7.x86_64.rpm 32 | hub release edit -m "" -a leofs-${1}-1.el7.x86_64.rpm $1 33 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu14.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | RUN set -xe \ 4 | && apt-get update \ 5 | && apt-get -y install build-essential libtool libncurses5-dev libssl-dev cmake check \ 6 | curl git fakeroot \ 7 | patch g++ lsb-release debhelper liblzo2-dev liblzo2-dev findutils \ 8 | netcat-openbsd sysstat wget sudo 9 | 10 | RUN set -xe \ 11 | && curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl \ 12 | && chmod a+x kerl \ 13 | && mkdir -p ~/bin \ 14 | && mv kerl ~/bin \ 15 | && echo "export PATH=$PATH:~/bin" >> ~/.bashrc \ 16 | && echo 'KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll" ' > ~/.kerlrc \ 17 | && ~/bin/kerl build 19.3 19.3 \ 18 | && mkdir -p ~/erlang/19.3 \ 19 | && ~/bin/kerl install 19.3 ~/erlang/19.3/ \ 20 | && echo "source ~/erlang/19.3/activate" >> ~/.bashrc \ 21 | && git clone https://github.com/leo-project/leofs_package.git \ 22 | && mkdir ~/deb \ 23 | && cp leofs_package/deb/make_deb.sh ~/deb \ 24 | && cp leofs_package/common/check_version.sh ~/deb 25 | 26 | RUN set -xe \ 27 | && wget https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz \ 28 | && tar xzf hub-linux-amd64-2.5.0.tgz \ 29 | && ./hub-linux-amd64-2.5.0/install 30 | 31 | ADD run_packaging.sh /root/deb 32 | 33 | WORKDIR /root/deb 34 | 35 | CMD bash 36 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu14.04/run_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -xe 4 | 5 | # $1: The release tag will be set 6 | 7 | . ~/erlang/19.3/activate 8 | 9 | # 1. Do packaging 10 | sh make_deb.sh $1 no 11 | 12 | # 2. Install the package 13 | dpkg -i leofs_${1}-1_amd64.deb 14 | chsh -s /bin/bash leofs 15 | 16 | # 3. start LeoFS 17 | /usr/local/leofs/current/leo_manager_0/bin/leo_manager start 18 | /usr/local/leofs/current/leo_manager_0/bin/leo_manager wait_ready 19 | 20 | /usr/local/leofs/current/leo_manager_1/bin/leo_manager start 21 | /usr/local/leofs/current/leo_manager_1/bin/leo_manager wait_ready 22 | 23 | /usr/local/leofs/current/leo_storage/bin/leo_storage start 24 | /usr/local/leofs/current/leo_gateway/bin/leo_gateway start 25 | /usr/local/leofs/current/leo_storage/bin/leo_storage wait_ready 26 | /usr/local/leofs/current/leo_gateway/bin/leo_gateway wait_ready 27 | 28 | /usr/local/leofs/current/leofs-adm start 29 | /usr/local/leofs/current/leofs-adm add-bucket test 05236 30 | 31 | # 4. Upload the package as a release asset with release-id passed by a shell argument 32 | # Refer to https://developer.github.com/v3/repos/releases/#upload-a-release-asset 33 | git clone https://github.com/leo-project/leofs.git 34 | cd leofs 35 | mv ../leofs_${1}-1_amd64.deb leofs_${1}-1_ubuntu-14.04_amd64.deb 36 | hub release edit -m "" -a leofs_${1}-1_ubuntu-14.04_amd64.deb $1 37 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | RUN set -xe \ 4 | && apt-get update \ 5 | && apt-get -y install build-essential libtool libncurses5-dev libssl-dev cmake check \ 6 | curl git fakeroot libsystemd-dev \ 7 | patch g++ lsb-release debhelper liblzo2-dev liblzo2-dev findutils \ 8 | netcat-openbsd sysstat wget sudo 9 | 10 | RUN set -xe \ 11 | && curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl \ 12 | && chmod a+x kerl \ 13 | && mkdir -p ~/bin \ 14 | && mv kerl ~/bin \ 15 | && echo "export PATH=$PATH:~/bin" >> ~/.bashrc \ 16 | && echo 'KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-systemd" ' > ~/.kerlrc \ 17 | && ~/bin/kerl build 19.3 19.3_systemd \ 18 | && mkdir -p ~/erlang/19.3_systemd \ 19 | && ~/bin/kerl install 19.3_systemd ~/erlang/19.3_systemd/ \ 20 | && echo "source ~/erlang/19.3_systemd/activate" >> ~/.bashrc \ 21 | && git clone https://github.com/leo-project/leofs_package.git \ 22 | && mkdir ~/deb \ 23 | && cp leofs_package/deb/make_deb.sh ~/deb \ 24 | && cp leofs_package/common/check_version.sh ~/deb 25 | 26 | RUN set -xe \ 27 | && wget https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz \ 28 | && tar xzf hub-linux-amd64-2.5.0.tgz \ 29 | && ./hub-linux-amd64-2.5.0/install 30 | 31 | ADD run_packaging.sh /root/deb 32 | 33 | WORKDIR /root/deb 34 | 35 | CMD bash 36 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu16.04/run_container_for_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONTAINER_NAME=leo-ubuntu16.04-packager 4 | set -xe 5 | 6 | docker pull leoproject/leofs-package-ubuntu16.04:latest 7 | docker run --rm --privileged=true --name $CONTAINER_NAME leoproject/leofs-package-ubuntu16.04:latest /sbin/init & 8 | 9 | # for safe 10 | sleep 10 11 | 12 | docker exec -it -e GITHUB_USER=$1 -e GITHUB_PASSWORD=$2 $CONTAINER_NAME ./run_packaging.sh $3 13 | RET=$? 14 | docker container stop $CONTAINER_NAME 15 | return $RET 16 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu16.04/run_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -xe 4 | 5 | # $1: The release tag will be set 6 | 7 | . ~/erlang/19.3_systemd/activate 8 | 9 | # 1. Do packaging 10 | sh make_deb.sh $1 yes 11 | 12 | # 2. Install the package 13 | dpkg -i leofs_${1}-1_amd64.deb 14 | chsh -s /bin/bash leofs 15 | 16 | # 3. start LeoFS through systemd 17 | systemctl start leofs-manager-master 18 | systemctl start leofs-manager-slave 19 | systemctl start leofs-storage 20 | systemctl start leofs-gateway 21 | 22 | sleep 5 23 | 24 | /usr/local/leofs/current/leofs-adm start 25 | /usr/local/leofs/current/leofs-adm add-bucket test 05236 26 | 27 | # 4. Upload the package as a release asset with release-id passed by a shell argument 28 | # Refer to https://developer.github.com/v3/repos/releases/#upload-a-release-asset 29 | git clone https://github.com/leo-project/leofs.git 30 | cd leofs 31 | mv ../leofs_${1}-1_amd64.deb leofs_${1}-1_ubuntu-16.04_amd64.deb 32 | hub release edit -m "" -a leofs_${1}-1_ubuntu-16.04_amd64.deb $1 33 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu18.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | RUN set -xe \ 4 | && apt-get update \ 5 | && apt-get -y install build-essential libtool libncurses5-dev libssl-dev cmake check \ 6 | curl git fakeroot libsystemd-dev \ 7 | patch g++ lsb-release debhelper liblzo2-dev liblzo2-dev findutils \ 8 | netcat-openbsd sysstat wget sudo 9 | 10 | RUN set -xe \ 11 | && curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl \ 12 | && chmod a+x kerl \ 13 | && mkdir -p ~/bin \ 14 | && mv kerl ~/bin \ 15 | && echo "export PATH=$PATH:~/bin" >> ~/.bashrc \ 16 | && echo 'KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-systemd" ' > ~/.kerlrc \ 17 | && ~/bin/kerl build 20.3 20.3_systemd \ 18 | && mkdir -p ~/erlang/20.3_systemd \ 19 | && ~/bin/kerl install 20.3_systemd ~/erlang/20.3_systemd/ \ 20 | && echo "source ~/erlang/20.3_systemd/activate" >> ~/.bashrc \ 21 | && git clone https://github.com/leo-project/leofs_package.git \ 22 | && mkdir ~/deb \ 23 | && cp leofs_package/deb/make_deb.sh ~/deb \ 24 | && cp leofs_package/common/check_version.sh ~/deb 25 | 26 | RUN set -xe \ 27 | && apt-get -y install systemd \ 28 | && wget https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz \ 29 | && tar xzf hub-linux-amd64-2.5.0.tgz \ 30 | && ./hub-linux-amd64-2.5.0/install 31 | 32 | ADD run_packaging.sh /root/deb 33 | 34 | WORKDIR /root/deb 35 | 36 | CMD bash 37 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu18.04/run_container_for_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONTAINER_NAME=leo-ubuntu18.04-packager 4 | set -xe 5 | 6 | docker pull leoproject/leofs-package-ubuntu18.04:latest 7 | docker run --rm --privileged=true --name $CONTAINER_NAME leoproject/leofs-package-ubuntu18.04:latest /sbin/init & 8 | 9 | # for safe 10 | sleep 10 11 | 12 | docker exec -it -e GITHUB_USER=$1 -e GITHUB_PASSWORD=$2 $CONTAINER_NAME ./run_packaging.sh $3 13 | RET=$? 14 | docker container stop $CONTAINER_NAME 15 | return $RET 16 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-package-ubuntu18.04/run_packaging.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -xe 4 | 5 | # $1: The release tag will be set 6 | 7 | . ~/erlang/20.3_systemd/activate 8 | 9 | # 1. Do packaging 10 | sh make_deb.sh $1 yes 11 | 12 | # 2. Install the package 13 | dpkg -i leofs_${1}-1_amd64.deb 14 | chsh -s /bin/bash leofs 15 | 16 | # 3. start LeoFS through systemd 17 | systemctl start leofs-manager-master 18 | systemctl start leofs-manager-slave 19 | systemctl start leofs-storage 20 | systemctl start leofs-gateway 21 | 22 | sleep 5 23 | 24 | /usr/local/leofs/current/leofs-adm start 25 | /usr/local/leofs/current/leofs-adm add-bucket test 05236 26 | 27 | # 4. Upload the package as a release asset with release-id passed by a shell argument 28 | # Refer to https://developer.github.com/v3/repos/releases/#upload-a-release-asset 29 | git clone https://github.com/leo-project/leofs.git 30 | cd leofs 31 | mv ../leofs_${1}-1_amd64.deb leofs_${1}-1_ubuntu-18.04_amd64.deb 32 | hub release edit -m "" -a leofs_${1}-1_ubuntu-18.04_amd64.deb $1 33 | -------------------------------------------------------------------------------- /Dockerfiles/leofs-release/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | RUN set -xe \ 4 | && apt-get update \ 5 | && apt-get -y install git wget \ 6 | && wget https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz \ 7 | && tar xzf hub-linux-amd64-2.5.0.tgz \ 8 | && ./hub-linux-amd64-2.5.0/install \ 9 | && git clone https://github.com/leo-project/leofs.git 10 | 11 | WORKDIR /leofs 12 | 13 | CMD bash 14 | -------------------------------------------------------------------------------- /Dockerfiles/run_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | Counter=1 4 | ## Wait for the test LeoFS cluster up 5 | until docker-compose up --abort-on-container-exit; [ $? -ne 0 ]; do 6 | echo "${Counter}th test passed." 7 | Counter=$(expr $Counter + 1) 8 | sleep 5 9 | done 10 | echo "${Counter}th test failed with code $?." 11 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | The following people have contributed to LeoFS and/or one of the related libraries or applications or documents that makes it run. 2 | 3 | THANKS 4 | ------ 5 | Ryosuke Nakai 6 | Masaki Matsushita 7 | Yohei Sasaki 8 | Jun Takizawa 9 | Nobuhiro Iwamatsu 10 | Loïc Hoguin 11 | Hitoshi Kuroyanagi 12 | Heinz N. Gies 13 | Hiroki Matsue 14 | Yoshinori Oe 15 | Satoshi Egi 16 | Jeff Li 17 | Paras Patel 18 | Mikolaj Golub 19 | Sergey Abramyan 20 | Kentaro Sasaki 21 | Taichi Nakashima 22 | Shuichiro Makigaki 23 | Wilson Li 24 | Hitoaki Iwase 25 | Maksim Zhylinski 26 | Kevin Meziere 27 | Vladimir Mosgalin 28 | Kunal Tyagi 29 | Rob Mayhue 30 | -------------------------------------------------------------------------------- /apps/leo_gateway/.gitignore: -------------------------------------------------------------------------------- 1 | ebin 2 | deps 3 | cherly 4 | snmp/*/db/* 5 | .eunit/ 6 | ring_* 7 | leofs_gateway.sh 8 | *.log 9 | *.swp 10 | *.json 11 | *.bak 12 | erl_crash.dump 13 | .leo_gateway_dialyzer_plt 14 | leo_gateway.dot 15 | .rebar/ 16 | rel/leo_gateway/ 17 | -------------------------------------------------------------------------------- /apps/leo_gateway/.travis.yml: -------------------------------------------------------------------------------- 1 | language: erlang 2 | script: "make" 3 | notifications: 4 | email: false 5 | otp_release: 6 | - 19.3 7 | - 20.3 8 | - 21.3 9 | - 22.2 10 | before_install: 11 | - sudo apt-get update -qq 12 | - sudo apt-get install -y check 13 | -------------------------------------------------------------------------------- /apps/leo_gateway/AUTHORS: -------------------------------------------------------------------------------- 1 | Yosuke Hara 2 | Yoshiyuki Kanno 3 | Wilson Li 4 | -------------------------------------------------------------------------------- /apps/leo_gateway/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Masaki Matsushita 2 | Loïc Hoguin 3 | Kentaro Sasaki 4 | -------------------------------------------------------------------------------- /apps/leo_gateway/cuttlefish: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_gateway/cuttlefish -------------------------------------------------------------------------------- /apps/leo_gateway/dialyzer.ignore-warnings: -------------------------------------------------------------------------------- 1 | ## Dialyzer - ignore warnings 2 | ## 3 | ## 4 | ## leo_gateway_nfs_mount3_xdr.erl(auto generated file) 5 | ## 6 | The pattern can never match since previous clauses completely covered the type {integer(),pos_integer()}),<<_:40,_:_*8>>,pos_integer(),'infinity',non_neg_integer()> 7 | The pattern {'error', ErrType} can never match the type 'match' | 'nomatch' | {'match',[binary() | [binary() | string() | char() | {integer(),integer()} | {'error',[any()],binary()} | {'incomplete',[any()],binary()}] | {integer(),integer()} | {'error',string(),binary()} | {'incomplete',string(),binary()}]} 8 | The call leo_cache_api:put_end_tran 9 | -------------------------------------------------------------------------------- /apps/leo_gateway/priv/test/nginx01.conf: -------------------------------------------------------------------------------- 1 | location /bucket_a/static_private { 2 | expires 24h; 3 | add_header Cache-Control private; 4 | } 5 | location /bucket_b/static_public_frequently_changed { 6 | expires 5m; 7 | add_header Cache-Control public; 8 | } 9 | -------------------------------------------------------------------------------- /apps/leo_gateway/priv/test/nginx02.conf: -------------------------------------------------------------------------------- 1 | location /bucket_a/test.png { 2 | expires @24h; 3 | add_header X-Original-Header OriginalValue; 4 | } 5 | 6 | location /bucket_b/urlencoded/%20%30%31%32 { 7 | expires -1; 8 | add_header Cache-Control no-cache; 9 | } 10 | -------------------------------------------------------------------------------- /apps/leo_gateway/priv/test/nginx03.conf: -------------------------------------------------------------------------------- 1 | location /bucket_a/test.png { 2 | expires 0; 3 | add_header X-Original-Header1 OriginalValue1; 4 | add_header X-Original-Header2 OriginalValue2; 5 | add_header X-Original-Header3 OriginalValue3; 6 | } 7 | 8 | location /bucket_b/~reserved/ { 9 | expires epoch; 10 | add_header Cache-Control no-cache; 11 | } 12 | -------------------------------------------------------------------------------- /apps/leo_gateway/rebar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_gateway/rebar -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/app.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Gateway 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_gateway/priv/leo_gateway.conf 27 | []. 28 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/erl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## This script replaces the default "erl" in erts-VSN/bin. This is necessary 4 | ## as escript depends on erl and in turn, erl depends on having access to a 5 | ## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect 6 | ## of running escript -- the embedded node bypasses erl and uses erlexec directly 7 | ## (as it should). 8 | ## 9 | ## Note that this script makes the assumption that there is a start_clean.boot 10 | ## file available in $ROOTDIR/release/VSN. 11 | 12 | # Determine the abspath of where this script is executing from. 13 | ERTS_BIN_DIR=$(cd ${0%/*} && pwd) 14 | 15 | # Now determine the root directory -- this script runs from erts-VSN/bin, 16 | # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR 17 | # path. 18 | ROOTDIR=${ERTS_BIN_DIR%/*/*} 19 | 20 | # Parse out release and erts info 21 | START_ERL=`cat $ROOTDIR/releases/start_erl.data` 22 | ERTS_VSN=${START_ERL% *} 23 | APP_VSN=${START_ERL#* } 24 | 25 | BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin 26 | EMU=beam 27 | PROGNAME=`echo $0 | sed 's/.*\\///'` 28 | CMD="$BINDIR/erlexec" 29 | export EMU 30 | export ROOTDIR 31 | export BINDIR 32 | export PROGNAME 33 | 34 | exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"} 35 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/leo_gateway.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @set node_name=leo_gateway 4 | 5 | @rem Get the abolute path to the parent directory, 6 | @rem which is assumed to be the node root. 7 | @for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI 8 | 9 | @set releases_dir=%node_root%\releases 10 | 11 | @rem Parse ERTS version and release version from start_erl.data 12 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 13 | @call :set_trim erts_version %%I 14 | @call :set_trim release_version %%J 15 | ) 16 | 17 | @set erts_bin=%node_root%\erts-%erts_version%\bin 18 | 19 | @set service_name=%node_name%_%release_version% 20 | 21 | @if "%1"=="install" @goto install 22 | @if "%1"=="uninstall" @goto uninstall 23 | @if "%1"=="start" @goto start 24 | @if "%1"=="stop" @goto stop 25 | @if "%1"=="restart" @call :stop && @goto start 26 | @if "%1"=="console" @goto console 27 | @rem TODO: attach, ping, restart and reboot 28 | 29 | :usage 30 | @echo Usage: %0 {install|uninstall|start|stop|restart|console} 31 | @goto :EOF 32 | 33 | :install 34 | @%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -sname %node_name% -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()." 35 | @goto :EOF 36 | 37 | :uninstall 38 | @%erts_bin%\erlsrv.exe remove %service_name% 39 | @%erts_bin%\epmd.exe -kill 40 | @goto :EOF 41 | 42 | :start 43 | @%erts_bin%\erlsrv.exe start %service_name% 44 | @goto :EOF 45 | 46 | :stop 47 | @%erts_bin%\erlsrv.exe stop %service_name% 48 | @goto :EOF 49 | 50 | :console 51 | @start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name% 52 | @goto :EOF 53 | 54 | :set_trim 55 | @set %1=%2 56 | @goto :EOF 57 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/server_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDIDCCAgigAwIBAgIJAJLkNZzERPIUMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV 3 | BAMTCWxvY2FsaG9zdDAeFw0xMDAzMTgxOTM5MThaFw0yMDAzMTUxOTM5MThaMBQx 4 | EjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 5 | ggEBAJeUCOZxbmtngF4S5lXckjSDLc+8C+XjMBYBPyy5eKdJY20AQ1s9/hhp3ulI 6 | 8pAvl+xVo4wQ+iBSvOzcy248Q+Xi6+zjceF7UNRgoYPgtJjKhdwcHV3mvFFrS/fp 7 | 9ggoAChaJQWDO1OCfUgTWXImhkw+vcDR11OVMAJ/h73dqzJPI9mfq44PTTHfYtgr 8 | v4LAQAOlhXIAa2B+a6PlF6sqDqJaW5jLTcERjsBwnRhUGi7JevQzkejujX/vdA+N 9 | jRBjKH/KLU5h3Q7wUchvIez0PXWVTCnZjpA9aR4m7YV05nKQfxtGd71czYDYk+j8 10 | hd005jetT4ir7JkAWValBybJVksCAwEAAaN1MHMwHQYDVR0OBBYEFJl9s51SnjJt 11 | V/wgKWqV5Q6jnv1ZMEQGA1UdIwQ9MDuAFJl9s51SnjJtV/wgKWqV5Q6jnv1ZoRik 12 | FjAUMRIwEAYDVQQDEwlsb2NhbGhvc3SCCQCS5DWcxETyFDAMBgNVHRMEBTADAQH/ 13 | MA0GCSqGSIb3DQEBBQUAA4IBAQB2ldLeLCc+lxK5i0EZquLamMBJwDIjGpT0JMP9 14 | b4XQOK2JABIu54BQIZhwcjk3FDJz/uOW5vm8k1kYni8FCjNZAaRZzCUfiUYTbTKL 15 | Rq9LuIAODyP2dnTqyKaQOOJHvrx9MRZ3XVecXPS0Tib4aO57vCaAbIkmhtYpTWmw 16 | e3t8CAIDVtgvjR6Se0a1JA4LktR7hBu22tDImvCSJn1nVAaHpani6iPBPPdMuMsP 17 | TBoeQfj8VpqBUjCStqJGa8ytjDFX73YaxV2mgrtGwPNme1x3YNRR11yTu7tksyMO 18 | GrmgxNriqYRchBhNEf72AKF0LR1ByKwfbDB9rIsV00HtCgOp 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/server_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAl5QI5nFua2eAXhLmVdySNIMtz7wL5eMwFgE/LLl4p0ljbQBD 3 | Wz3+GGne6UjykC+X7FWjjBD6IFK87NzLbjxD5eLr7ONx4XtQ1GChg+C0mMqF3Bwd 4 | Xea8UWtL9+n2CCgAKFolBYM7U4J9SBNZciaGTD69wNHXU5UwAn+Hvd2rMk8j2Z+r 5 | jg9NMd9i2Cu/gsBAA6WFcgBrYH5ro+UXqyoOolpbmMtNwRGOwHCdGFQaLsl69DOR 6 | 6O6Nf+90D42NEGMof8otTmHdDvBRyG8h7PQ9dZVMKdmOkD1pHibthXTmcpB/G0Z3 7 | vVzNgNiT6PyF3TTmN61PiKvsmQBZVqUHJslWSwIDAQABAoIBACI8Ky5xHDFh9RpK 8 | Rn/KC7OUlTpADKflgizWJ0Cgu2F9L9mkn5HyFHvLHa+u7CootbWJOiEejH/UcBtH 9 | WyMQtX0snYCpdkUpJv5wvMoebGu+AjHOn8tfm9T/2O6rhwgckLyMb6QpGbMo28b1 10 | p9QiY17BJPZx7qJQJcHKsAvwDwSThlb7MFmWf42LYWlzybpeYQvwpd+UY4I0WXLu 11 | /dqJIS9Npq+5Y5vbo2kAEAssb2hSCvhCfHmwFdKmBzlvgOn4qxgZ1iHQgfKI6Z3Y 12 | J0573ZgOVTuacn+lewtdg5AaHFcl/zIYEr9SNqRoPNGbPliuv6k6N2EYcufWL5lR 13 | sCmmmHECgYEAxm+7OpepGr++K3+O1e1MUhD7vSPkKJrCzNtUxbOi2NWj3FFUSPRU 14 | adWhuxvUnZgTcgM1+KuQ0fB2VmxXe9IDcrSFS7PKFGtd2kMs/5mBw4UgDZkOQh+q 15 | kDiBEV3HYYJWRq0w3NQ/9Iy1jxxdENHtGmG9aqamHxNtuO608wGW2S8CgYEAw4yG 16 | ZyAic0Q/U9V2OHI0MLxLCzuQz17C2wRT1+hBywNZuil5YeTuIt2I46jro6mJmWI2 17 | fH4S/geSZzg2RNOIZ28+aK79ab2jWBmMnvFCvaru+odAuser4N9pfAlHZvY0pT+S 18 | 1zYX3f44ygiio+oosabLC5nWI0zB2gG8pwaJlaUCgYEAgr7poRB+ZlaCCY0RYtjo 19 | mYYBKD02vp5BzdKSB3V1zeLuBWM84pjB6b3Nw0fyDig+X7fH3uHEGN+USRs3hSj6 20 | BqD01s1OT6fyfbYXNw5A1r+nP+5h26Wbr0zblcKxdQj4qbbBZC8hOJNhqTqqA0Qe 21 | MmzF7jiBaiZV/Cyj4x1f9BcCgYEAhjL6SeuTuOctTqs/5pz5lDikh6DpUGcH8qaV 22 | o6aRAHHcMhYkZzpk8yh1uUdD7516APmVyvn6rrsjjhLVq4ZAJjwB6HWvE9JBN0TR 23 | bILF+sREHUqU8Zn2Ku0nxyfXCKIOnxlx/J/y4TaGYqBqfXNFWiXNUrjQbIlQv/xR 24 | K48g/MECgYBZdQlYbMSDmfPCC5cxkdjrkmAl0EgV051PWAi4wR+hLxIMRjHBvAk7 25 | IweobkFvT4TICulgroLkYcSa5eOZGxB/DHqcQCbWj3reFV0VpzmTDoFKG54sqBRl 26 | vVntGt0pfA40fF17VoS7riAdHF53ippTtsovHEsg5tq5NrBl5uKm2g== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/start_erl.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++. 4 | @rem Other args are position dependent. 5 | @set args="%*" 6 | @for /F "delims=++ tokens=1,2,3" %%I in (%args%) do @( 7 | @set erl_args=%%I 8 | @call :set_trim node_name %%J 9 | @call :set_trim node_root %%K 10 | ) 11 | 12 | @set releases_dir=%node_root%\releases 13 | 14 | @rem parse ERTS version and release version from start_erl.dat 15 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 16 | @call :set_trim erts_version %%I 17 | @call :set_trim release_version %%J 18 | ) 19 | 20 | @set erl_exe=%node_root%\erts-%erts_version%\bin\erl.exe 21 | @set boot_file=%releases_dir%\%release_version%\%node_name% 22 | 23 | @if exist %releases_dir%\%release_version%\sys.config ( 24 | @set app_config=%releases_dir%\%release_version%\sys.config 25 | ) else ( 26 | @set app_config=%node_root%\etc\app.config 27 | ) 28 | 29 | @if exist %releases_dir%\%release_version%\vm.args ( 30 | @set vm_args=%releases_dir%\%release_version%\vm.args 31 | ) else ( 32 | @set vm_args=%node_root%\etc\vm.args 33 | ) 34 | 35 | @%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args% 36 | 37 | :set_trim 38 | @set %1=%2 39 | @goto :EOF 40 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/sys.config: -------------------------------------------------------------------------------- 1 | [ 2 | %% SASL config 3 | {sasl, [ 4 | {sasl_error_logger, {file, "log/sasl-error.log"}}, 5 | {errlog_type, error}, 6 | {error_logger_mf_dir, "log/sasl"}, % Log directory 7 | {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size 8 | {error_logger_mf_maxfiles, 5} % 5 files max 9 | ]} 10 | ]. 11 | 12 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/files/vm.args: -------------------------------------------------------------------------------- 1 | ## Name of the node 2 | -name {{node}} 3 | 4 | ## Cookie for distributed erlang 5 | -setcookie {{cookie}} 6 | 7 | ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive 8 | ## (Disabled by default..use with caution!) 9 | ##-heart 10 | 11 | ## Enable kernel poll and a few async threads 12 | +K true 13 | +A 32 14 | 15 | ## Increase number of concurrent ports/sockets 16 | ##-env ERL_MAX_PORTS 4096 17 | 18 | ## Tweak GC to run more often 19 | ##-env ERL_FULLSWEEP_AFTER 10 20 | 21 | ## SNMP Config file 22 | -config {{platform_snmp_dir}}/{{snmp_conf_dir}}/leo_gateway_snmp 23 | 24 | ## Sets the maximum number of concurrent processes for this system 25 | +P 1048576 26 | 27 | ## set up the node with the -hidden flag 28 | -hidden 29 | -------------------------------------------------------------------------------- /apps/leo_gateway/rel/vars.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Gateway 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_gateway/priv/leo_gateway.conf 27 | -------------------------------------------------------------------------------- /apps/leo_gateway/replace_otp_vsn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . -name rebar.config|xargs sed -i 's/require_otp_vsn,\s\+"\(.\+\)"/require_otp_vsn, "19|20|21|22"/g' 3 | -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/LEO-GATEWAY.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_gateway/snmp/snmpa_gateway_0/LEO-GATEWAY.bin -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4000}. 3 | {snmpEngineID, "Erlang SNMP LEO GATEWAY"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_gateway/snmp/snmpa_gateway_0/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO GATEWAY"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35450,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. 7 | -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_0/leo_gateway_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_gateway_0/db"}, 3 | {config, [{dir, "snmp/snmpa_gateway_0/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/LEO-GATEWAY.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_gateway/snmp/snmpa_gateway_1/LEO-GATEWAY.bin -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4001}. 3 | {snmpEngineID, "Erlang SNMP LEO GATEWAY"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_gateway/snmp/snmpa_gateway_1/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO GATEWAY"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35450,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_gateway/snmp/snmpa_gateway_1/leo_gateway_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_gateway_1/db"}, 3 | {config, [{dir, "snmp/snmpa_gateway_1/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_gateway/src/leo_gateway_sup.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% Leo Gateway 4 | %% 5 | %% Copyright (c) 2012-2018 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %% --------------------------------------------------------------------- 22 | %% Leo Gateway - Supervisor 23 | %% 24 | %% @doc 25 | %% @end 26 | %%====================================================================== 27 | -module(leo_gateway_sup). 28 | 29 | -behaviour(supervisor). 30 | 31 | -include("leo_gateway.hrl"). 32 | 33 | %% External exports 34 | -export([start_link/0]). 35 | 36 | %% supervisor callbacks 37 | -export([init/1]). 38 | 39 | %% @spec start_link() -> ServerRet 40 | %% @doc API for starting the supervisor. 41 | start_link() -> 42 | supervisor:start_link({local, ?MODULE}, ?MODULE, []). 43 | 44 | %% @spec init([]) -> SupervisorTree 45 | %% @doc supervisor callback. 46 | init([]) -> 47 | {ok, {_SupFlags = {one_for_one, 5, 60}, []}}. 48 | -------------------------------------------------------------------------------- /apps/leo_gateway/src/leo_nfs_mount3.hrl: -------------------------------------------------------------------------------- 1 | %% 2 | %% src/leo_nfs_mount3.hrl was generated by erpcgen (do not edit) 3 | %% 4 | -define(MOUNTPROG, 100005). 5 | -define(MOUNTVERS3, 3). 6 | -define(FHSIZE3, 64). 7 | -define(FHSIZE, 32). 8 | -define(MNTNAMLEN, 255). 9 | -define(MNTPATHLEN, 1024). 10 | -------------------------------------------------------------------------------- /apps/leo_gateway/src/leo_nfs_proto3.hrl: -------------------------------------------------------------------------------- 1 | %% 2 | %% src/leo_nfs_proto3.hrl was generated by erpcgen (do not edit) 3 | %% 4 | -define(NFS3_PROGRAM, 100003). 5 | -define(NFS_V3, 3). 6 | -define(FSF3_CANSETTIME, 16). 7 | -define(FSF3_HOMOGENEOUS, 8). 8 | -define(FSF3_SYMLINK, 2). 9 | -define(FSF3_LINK, 1). 10 | -define(ACCESS3_EXECUTE, 32). 11 | -define(ACCESS3_DELETE, 16). 12 | -define(ACCESS3_EXTEND, 8). 13 | -define(ACCESS3_MODIFY, 4). 14 | -define(ACCESS3_LOOKUP, 2). 15 | -define(ACCESS3_READ, 1). 16 | -define(NFS3_WRITEVERFSIZE, 8). 17 | -define(NFS3_CREATEVERFSIZE, 8). 18 | -define(NFS3_COOKIEVERFSIZE, 8). 19 | -define(NFS3_FHSIZE, 64). 20 | -------------------------------------------------------------------------------- /apps/leo_gateway/src/leo_nfs_readdir_state_behaviour.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% Leo Gateway 4 | %% 5 | %% Copyright (c) 2012-2018 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -module(leo_nfs_readdir_state_behaviour). 23 | 24 | -callback(start_link(Params::any()) -> 25 | ok | {error, any()}). 26 | 27 | -callback(add_readdir_entry(CookieVerf::binary(), ReadDirEntry::list()) -> 28 | true). 29 | 30 | -callback(get_readdir_entry(CookieVerf::binary()) -> 31 | {ok, list()}| not_found). 32 | 33 | -callback(del_readdir_entry(CookieVerf::binary()) -> 34 | true). 35 | -------------------------------------------------------------------------------- /apps/leo_gateway/src/leo_nfs_state_behaviour.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% Leo Gateway 4 | %% 5 | %% Copyright (c) 2012-2018 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -module(leo_nfs_state_behaviour). 23 | 24 | -callback(init(Params::any()) -> 25 | ok | {error, any()}). 26 | 27 | -callback(add_path(Path4S3::binary()) -> 28 | {ok, binary()}| {error, any()}). 29 | 30 | -callback(get_path(UID::binary()) -> 31 | {ok, binary()}| not_found). 32 | 33 | -callback(del_path(UID::binary()) -> 34 | true). 35 | 36 | -callback(get_uid_list() -> 37 | {ok, list(binary())}| {error, any()}). 38 | 39 | -callback(get_path_list() -> 40 | {ok, list(binary())}| {error, any()}). 41 | 42 | -callback(add_write_verfier(WriteVerf::binary()) -> 43 | true). 44 | 45 | -callback(get_write_verfier() -> 46 | {ok, binary()}| not_found). 47 | -------------------------------------------------------------------------------- /apps/leo_gateway/src/leo_nlm_lock_behaviour.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% Leo Gateway / Network Lock Manager written in Erlang 4 | %% 5 | %% Copyright (c) 2012-2018 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -module(leo_nlm_lock_behaviour). 23 | 24 | -include("leo_gateway.hrl"). 25 | 26 | -callback(start_link(Args::any()) -> 27 | {ok, any()}). 28 | 29 | -callback(test(FileHandler::binary(), Lock::#lock_record{}) -> 30 | ok | {error, #lock_record{}} | {error, any()}). 31 | 32 | -callback(lock(FileHandler::binary(), Lock::#lock_record{}) -> 33 | ok | {error, #lock_record{}} | {error, any()}). 34 | 35 | -callback(unlock(FileHandler::binary(), Owner::binary(), Start::non_neg_integer(), End::integer()) -> 36 | ok). 37 | -------------------------------------------------------------------------------- /apps/leo_gateway/src/leo_nlm_proto4.hrl: -------------------------------------------------------------------------------- 1 | %% 2 | %% src/leo_nlm_proto4.hrl was generated by erpcgen (do not edit) 3 | %% 4 | -define(NLM_PROG, 100021). 5 | -define(NLM4_VERS, 4). 6 | -define(MAXNETOBJ_SZ, 1024). 7 | -define(LM_MAXNAMELEN, 1025). 8 | -define(LM_MAXSTRLEN, 1024). 9 | -------------------------------------------------------------------------------- /apps/leo_gateway/test/Makefile: -------------------------------------------------------------------------------- 1 | default: 2 | make test_lock_java 3 | 4 | test_lock_java: FileLockTestWorker.java FileLockTest.java 5 | javac FileLockTestWorker.java 6 | javac FileLockTest.java 7 | -------------------------------------------------------------------------------- /apps/leo_gateway/test/nfs_dummy_test_avs.log: -------------------------------------------------------------------------------- 1 | rd(put_req_params, { 2 | path = <<>>, 3 | body = <<>>, 4 | meta = <<>>, 5 | msize = 0, 6 | dsize = 0, 7 | total_chunks = 0, 8 | cindex = 0, 9 | csize = 0, 10 | digest = 0, 11 | bucket_info = undefined 12 | }). 13 | 14 | Req_Old = #put_req_params{ 15 | path = <<"test/test_old_dir/$$_dir_$$">> 16 | }. 17 | 18 | Req_New = #put_req_params{ 19 | path = <<"test/test_new_dir/\x00_dir_\x00">> 20 | }. 21 | 22 | Req_BNew = #put_req_params{ 23 | path = <<"test/test_both_dir/\x00_dir_\x00">> 24 | }. 25 | 26 | Req_BOld = #put_req_params{ 27 | path = <<"test/test_both_dir/$$_dir_$$">> 28 | }. 29 | 30 | leo_gateway_rpc_handler:put(Req_Old). 31 | leo_gateway_rpc_handler:put(Req_New). 32 | leo_gateway_rpc_handler:put(Req_BNew). 33 | leo_gateway_rpc_handler:put(Req_BOld). 34 | -------------------------------------------------------------------------------- /apps/leo_gateway/test/nfs_dummy_test_avs.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_gateway/test/nfs_dummy_test_avs.tar.gz -------------------------------------------------------------------------------- /apps/leo_manager/.gitignore: -------------------------------------------------------------------------------- 1 | deps/ 2 | ebin/ 3 | *.ets 4 | snmp/*/db 5 | .eunit/ 6 | Mnesia*/ 7 | work/ 8 | log/ 9 | .leo_manager_dialyzer_plt 10 | leo_manager.dot 11 | leo_manager.png 12 | .rebar/ 13 | rel/leo_manager/ 14 | -------------------------------------------------------------------------------- /apps/leo_manager/.travis.yml: -------------------------------------------------------------------------------- 1 | language: erlang 2 | script: "make" 3 | notifications: 4 | email: false 5 | otp_release: 6 | - 19.3 7 | - 20.3 8 | - 21.3 9 | - 22.2 10 | -------------------------------------------------------------------------------- /apps/leo_manager/AUTHORS: -------------------------------------------------------------------------------- 1 | Yosuke Hara 2 | Yoshiyuki Kanno 3 | -------------------------------------------------------------------------------- /apps/leo_manager/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Masaki Matsushita 2 | Heinz N. Gies 3 | Shuichiro Makigaki 4 | -------------------------------------------------------------------------------- /apps/leo_manager/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all deps compile xref eunit release check_plt build_plt dialyzer doc callgraph graphviz clean distclean 2 | 3 | REBAR := ./rebar 4 | APPS = erts kernel stdlib sasl crypto compiler inets mnesia public_key runtime_tools snmp syntax_tools tools xmerl webtool ssl 5 | LIBS = deps/leo_commons/ebin deps/leo_logger/ebin deps/leo_object_storage/ebin deps/leo_mq/ebin \ 6 | deps/leo_redundant_manager/ebin deps/leo_rpc/ebin deps/leo_statistics/ebin \ 7 | deps/leo_s3_libs deps/savanna_commons 8 | PLT_FILE = .leo_manager_dialyzer_plt 9 | DOT_FILE = leo_manager.dot 10 | CALL_GRAPH_FILE = leo_manager.png 11 | 12 | all: deps compile xref eunit 13 | deps: 14 | @$(REBAR) get-deps 15 | compile: 16 | @$(REBAR) compile 17 | xref: 18 | @$(REBAR) xref skip_deps=true 19 | eunit: 20 | @$(REBAR) eunit skip_deps=true 21 | release: 22 | rm -rf rel/leo_manager 23 | @$(REBAR) compile 24 | (cd rel/ && ../rebar generate) 25 | check_plt: 26 | @$(REBAR) compile 27 | dialyzer --check_plt --plt $(PLT_FILE) --apps $(APPS) 28 | build_plt: 29 | @$(REBAR) compile 30 | dialyzer --build_plt --output_plt $(PLT_FILE) --apps $(APPS) $(LIBS) 31 | dialyzer: 32 | @$(REBAR) compile 33 | dialyzer -Wno_return --plt $(PLT_FILE) -r ebin/ --dump_callgraph $(DOT_FILE) -Wrace_conditions | fgrep -v -f ./dialyzer.ignore-warnings 34 | doc: compile 35 | @$(REBAR) doc 36 | callgraph: graphviz 37 | dot -Tpng -o$(CALL_GRAPH_FILE) $(DOT_FILE) 38 | graphviz: 39 | $(if $(shell which dot),,$(error "To make the depgraph, you need graphviz installed")) 40 | clean: 41 | @$(REBAR) clean 42 | distclean: 43 | @$(REBAR) delete-deps 44 | @$(REBAR) clean 45 | -------------------------------------------------------------------------------- /apps/leo_manager/cuttlefish: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/cuttlefish -------------------------------------------------------------------------------- /apps/leo_manager/dialyzer.ignore-warnings: -------------------------------------------------------------------------------- 1 | The pattern can never match the type 2 | he pattern {'error', Cause = 'not_found'} can never match the type {'error','invalid_version'} 3 | The call leo_misc:any_to_binary 4 | -------------------------------------------------------------------------------- /apps/leo_manager/include/tcp_server.hrl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% Leo Manager 4 | %% 5 | %% Copyright (c) 2012-2015 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -record(tcp_server_params, { 23 | prefix_of_name = "tcp_server_" :: string(), 24 | listen = [binary, {packet, line}, {active, false}, {reuseaddr, true}] :: [term()], 25 | port = 10010 :: pos_integer(), 26 | num_of_listeners = 3 :: pos_integer(), 27 | restart_times = 3 :: pos_integer(), 28 | time = 60 :: pos_integer(), 29 | shutdown = 2000 :: pos_integer(), 30 | accept_timeout = infinity :: infinity|non_neg_integer(), 31 | accept_error_sleep_time = 3000 :: pos_integer(), 32 | recv_length = 0 :: non_neg_integer(), 33 | recv_timeout = infinity :: infinity|non_neg_integer() 34 | }). 35 | -------------------------------------------------------------------------------- /apps/leo_manager/rebar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/rebar -------------------------------------------------------------------------------- /apps/leo_manager/rel/files/app.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Manager 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_manager/priv/leo_manager_*.conf 27 | []. 28 | -------------------------------------------------------------------------------- /apps/leo_manager/rel/files/erl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## This script replaces the default "erl" in erts-VSN/bin. This is necessary 4 | ## as escript depends on erl and in turn, erl depends on having access to a 5 | ## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect 6 | ## of running escript -- the embedded node bypasses erl and uses erlexec directly 7 | ## (as it should). 8 | ## 9 | ## Note that this script makes the assumption that there is a start_clean.boot 10 | ## file available in $ROOTDIR/release/VSN. 11 | 12 | # Determine the abspath of where this script is executing from. 13 | ERTS_BIN_DIR=$(cd ${0%/*} && pwd) 14 | 15 | # Now determine the root directory -- this script runs from erts-VSN/bin, 16 | # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR 17 | # path. 18 | ROOTDIR=${ERTS_BIN_DIR%/*/*} 19 | 20 | # Parse out release and erts info 21 | START_ERL=`cat $ROOTDIR/releases/start_erl.data` 22 | ERTS_VSN=${START_ERL% *} 23 | APP_VSN=${START_ERL#* } 24 | 25 | BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin 26 | EMU=beam 27 | PROGNAME=`echo $0 | sed 's/.*\\///'` 28 | CMD="$BINDIR/erlexec" 29 | export EMU 30 | export ROOTDIR 31 | export BINDIR 32 | export PROGNAME 33 | 34 | exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"} 35 | -------------------------------------------------------------------------------- /apps/leo_manager/rel/files/leo_manager.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @set node_name=leo_manager 4 | 5 | @rem Get the abolute path to the parent directory, 6 | @rem which is assumed to be the node root. 7 | @for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI 8 | 9 | @set releases_dir=%node_root%\releases 10 | 11 | @rem Parse ERTS version and release version from start_erl.data 12 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 13 | @call :set_trim erts_version %%I 14 | @call :set_trim release_version %%J 15 | ) 16 | 17 | @set erts_bin=%node_root%\erts-%erts_version%\bin 18 | 19 | @set service_name=%node_name%_%release_version% 20 | 21 | @if "%1"=="install" @goto install 22 | @if "%1"=="uninstall" @goto uninstall 23 | @if "%1"=="start" @goto start 24 | @if "%1"=="stop" @goto stop 25 | @if "%1"=="restart" @call :stop && @goto start 26 | @if "%1"=="console" @goto console 27 | @rem TODO: attach, ping, restart and reboot 28 | 29 | :usage 30 | @echo Usage: %0 {install|uninstall|start|stop|restart|console} 31 | @goto :EOF 32 | 33 | :install 34 | @%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -sname %node_name% -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()." 35 | @goto :EOF 36 | 37 | :uninstall 38 | @%erts_bin%\erlsrv.exe remove %service_name% 39 | @%erts_bin%\epmd.exe -kill 40 | @goto :EOF 41 | 42 | :start 43 | @%erts_bin%\erlsrv.exe start %service_name% 44 | @goto :EOF 45 | 46 | :stop 47 | @%erts_bin%\erlsrv.exe stop %service_name% 48 | @goto :EOF 49 | 50 | :console 51 | @start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name% 52 | @goto :EOF 53 | 54 | :set_trim 55 | @set %1=%2 56 | @goto :EOF 57 | -------------------------------------------------------------------------------- /apps/leo_manager/rel/files/start_erl.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++. 4 | @rem Other args are position dependent. 5 | @set args="%*" 6 | @for /F "delims=++ tokens=1,2,3" %%I in (%args%) do @( 7 | @set erl_args=%%I 8 | @call :set_trim node_name %%J 9 | @call :set_trim node_root %%K 10 | ) 11 | 12 | @set releases_dir=%node_root%\releases 13 | 14 | @rem parse ERTS version and release version from start_erl.dat 15 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 16 | @call :set_trim erts_version %%I 17 | @call :set_trim release_version %%J 18 | ) 19 | 20 | @set erl_exe=%node_root%\erts-%erts_version%\bin\erl.exe 21 | @set boot_file=%releases_dir%\%release_version%\%node_name% 22 | 23 | @if exist %releases_dir%\%release_version%\sys.config ( 24 | @set app_config=%releases_dir%\%release_version%\sys.config 25 | ) else ( 26 | @set app_config=%node_root%\etc\app.config 27 | ) 28 | 29 | @if exist %releases_dir%\%release_version%\vm.args ( 30 | @set vm_args=%releases_dir%\%release_version%\vm.args 31 | ) else ( 32 | @set vm_args=%node_root%\etc\vm.args 33 | ) 34 | 35 | @%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args% 36 | 37 | :set_trim 38 | @set %1=%2 39 | @goto :EOF 40 | -------------------------------------------------------------------------------- /apps/leo_manager/rel/files/sys.config: -------------------------------------------------------------------------------- 1 | [ 2 | %% SASL config 3 | {sasl, [ 4 | {sasl_error_logger, {file, "log/sasl-error.log"}}, 5 | {errlog_type, error}, 6 | {error_logger_mf_dir, "log/sasl"}, % Log directory 7 | {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size 8 | {error_logger_mf_maxfiles, 5} % 5 files max 9 | ]} 10 | ]. 11 | 12 | -------------------------------------------------------------------------------- /apps/leo_manager/rel/files/vm.args: -------------------------------------------------------------------------------- 1 | ## Name of the node 2 | -name {{node}} 3 | 4 | ## Cookie for distributed erlang 5 | -setcookie {{cookie}} 6 | 7 | ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive 8 | ## (Disabled by default..use with caution!) 9 | ##-heart 10 | 11 | ## Enable kernel poll and a few async threads 12 | +K true 13 | +A 32 14 | 15 | ## Increase number of concurrent ports/sockets 16 | ##-env ERL_MAX_PORTS 4096 17 | 18 | ## Tweak GC to run more often 19 | ##-env ERL_FULLSWEEP_AFTER 10 20 | 21 | ## SNMP Config file 22 | -config {{platform_snmp_dir}}/{{snmp_conf_dir}}/leo_manager_snmp 23 | 24 | ## set up the node with the -hidden flag 25 | -hidden 26 | -------------------------------------------------------------------------------- /apps/leo_manager/rel/vars.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Manager 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_manager/priv/leo_manager_*.conf 27 | -------------------------------------------------------------------------------- /apps/leo_manager/replace_otp_vsn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . -name rebar.config|xargs sed -i 's/require_otp_vsn,\s\+"\(.\+\)"/require_otp_vsn, "19|20|21"/g' 3 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/LEO-MANAGER.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_0/LEO-MANAGER.bin -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/LEO-MANAGER.funcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_0/LEO-MANAGER.funcs -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4020}. 3 | {snmpEngineID, "Erlang SNMP LEO MANAGER"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_0/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO MANAGER"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35450,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. 7 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_0/leo_manager_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_manager_0/db"}, 3 | {config, [{dir, "snmp/snmpa_manager_0/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/LEO-MANAGER.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_1/LEO-MANAGER.bin -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/LEO-MANAGER.funcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_1/LEO-MANAGER.funcs -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4021}. 3 | {snmpEngineID, "Erlang SNMP LEO MANAGER"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_1/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO MANAGER"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35450,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. 7 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_1/leo_manager_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_manager_1/db"}, 3 | {config, [{dir, "snmp/snmpa_manager_1/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/LEO-MANAGER.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_2/LEO-MANAGER.bin -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/LEO-MANAGER.funcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_2/LEO-MANAGER.funcs -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 14020}. 3 | {snmpEngineID, "Erlang SNMP LEO MANAGER"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_2/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO MANAGER"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35480,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. 7 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_2/leo_manager_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_manager_2/db"}, 3 | {config, [{dir, "snmp/snmpa_manager_2/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/LEO-MANAGER.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_3/LEO-MANAGER.bin -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/LEO-MANAGER.funcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_3/LEO-MANAGER.funcs -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 14021}. 3 | {snmpEngineID, "Erlang SNMP LEO MANAGER"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/snmp/snmpa_manager_3/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO MANAGER"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35480,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. 7 | -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_manager/snmp/snmpa_manager_3/leo_manager_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_manager_3/db"}, 3 | {config, [{dir, "snmp/snmpa_manager_3/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_manager/src/leo_manager_app.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% LeoManager 4 | %% 5 | %% Copyright (c) 2012-2017 Rakuten Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -module(leo_manager_app). 23 | 24 | -behaviour(application). 25 | 26 | -include("leo_manager.hrl"). 27 | -include_lib("eunit/include/eunit.hrl"). 28 | 29 | %% Application and Supervisor callbacks 30 | -export([start/2, prep_stop/1, stop/1]). 31 | 32 | %%---------------------------------------------------------------------- 33 | %% Application behaviour callbacks 34 | %%---------------------------------------------------------------------- 35 | start(_Type, _Args) -> 36 | case leo_manager_sup:start_link() of 37 | {ok,_Pid} = Ret -> 38 | _ = timer:apply_after(?APPLY_AFTER_TIME, leo_manager_cluster_monitor, 39 | get_remote_node_proc, []), 40 | Ret; 41 | Other -> 42 | Other 43 | end. 44 | 45 | prep_stop(_State) -> 46 | leo_redundant_manager_sup:stop(), 47 | leo_mq_sup:stop(), 48 | leo_logger_api:stop(), 49 | ok. 50 | 51 | stop(_State) -> 52 | ok. 53 | -------------------------------------------------------------------------------- /apps/leo_manager/src/leo_manager_console_behaiviour.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% LeoManager 4 | %% 5 | %% Copyright (c) 2012-2017 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -module(leo_manager_console_behaiviour). 23 | 24 | -include("leo_manager.hrl"). 25 | 26 | %% @doc Request from 'tcp_server_acceptor' 27 | -callback(handle_call(Socket::port(), Command::binary(), #state{}) -> 28 | {reply, any(), #state{}} | {noreply, #state{}}). 29 | 30 | 31 | %% @doc Check to have a command 32 | -callback(has_command(Command::binary()) -> 33 | boolean()). 34 | -------------------------------------------------------------------------------- /apps/leo_manager/src/leo_manager_formatter_commons.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% LeoManager 4 | %% 5 | %% Copyright (c) 2012-2017 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -module(leo_manager_formatter_commons). 23 | 24 | -include("leo_manager.hrl"). 25 | 26 | -export([exchange_value/2]). 27 | 28 | 29 | %% @doc Exchange value 30 | -spec(exchange_value(Values, Ret) -> 31 | Ret when Values::[{Ret, any()}], 32 | Ret::any()). 33 | exchange_value([], Ret) -> 34 | Ret; 35 | exchange_value([{Ret, NewRet}|_], Ret) -> 36 | NewRet; 37 | exchange_value([{_,_}|Rest], Ret) -> 38 | exchange_value(Rest, Ret). 39 | -------------------------------------------------------------------------------- /apps/leo_manager/src/tcp_server_sup.erl: -------------------------------------------------------------------------------- 1 | %%====================================================================== 2 | %% 3 | %% LeoManager 4 | %% 5 | %% Copyright (c) 2012-2017 Rakuten, Inc. 6 | %% 7 | %% This file is provided to you under the Apache License, 8 | %% Version 2.0 (the "License"); you may not use this file 9 | %% except in compliance with the License. You may obtain 10 | %% a copy of the License at 11 | %% 12 | %% http://www.apache.org/licenses/LICENSE-2.0 13 | %% 14 | %% Unless required by applicable law or agreed to in writing, 15 | %% software distributed under the License is distributed on an 16 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | %% KIND, either express or implied. See the License for the 18 | %% specific language governing permissions and limitations 19 | %% under the License. 20 | %% 21 | %%====================================================================== 22 | -module(tcp_server_sup). 23 | 24 | -behaviour(supervisor). 25 | 26 | -include("tcp_server.hrl"). 27 | 28 | %% External API 29 | -export([start_link/0, 30 | stop/0]). 31 | 32 | %% Callbacks 33 | -export([init/1]). 34 | 35 | %%----------------------------------------------------------------------- 36 | %% External API 37 | %%----------------------------------------------------------------------- 38 | start_link() -> 39 | supervisor:start_link({local, ?MODULE}, ?MODULE, []). 40 | 41 | stop() -> 42 | case whereis(?MODULE) of 43 | Pid when is_pid(Pid) -> 44 | exit(Pid, shutdown), 45 | ok; 46 | _ -> 47 | not_started 48 | end. 49 | 50 | %% --------------------------------------------------------------------- 51 | %% Callbacks 52 | %% --------------------------------------------------------------------- 53 | init([]) -> 54 | {ok, {{one_for_one, 5, 60}, []}}. 55 | -------------------------------------------------------------------------------- /apps/leo_storage/.gitignore: -------------------------------------------------------------------------------- 1 | leo_*.sh 2 | .eunit 3 | ebin 4 | deps 5 | snmp/*/db 6 | ring_* 7 | .leo_storage_dialyzer_plt 8 | leo_storage.dot 9 | leo_storage.png 10 | .rebar/ 11 | rel/leo_storage 12 | -------------------------------------------------------------------------------- /apps/leo_storage/.travis.yml: -------------------------------------------------------------------------------- 1 | language: erlang 2 | script: "make" 3 | notifications: 4 | email: false 5 | otp_release: 6 | - 19.3 7 | - 20.3 8 | - 21.3 9 | - 22.2 10 | -------------------------------------------------------------------------------- /apps/leo_storage/AUTHORS: -------------------------------------------------------------------------------- 1 | Yosuke Hara 2 | Yoshiyuki Kanno 3 | -------------------------------------------------------------------------------- /apps/leo_storage/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all get_deps compile xref eunit release check_plt build_plt dialyzer doc callgraph graphviz clean distclean 2 | 3 | REBAR := ./rebar 4 | APPS = erts kernel stdlib sasl crypto compiler inets mnesia public_key runtime_tools snmp syntax_tools tools xmerl webtool ssl 5 | LIBS = deps/leo_commons/ebin deps/leo_logger/ebin deps/leo_mq/ebin deps/leo_object_storage/ebin deps/leo_ordning_reda/ebin \ 6 | deps/leo_redundant_manager/ebin deps/leo_rpc/ebin deps/leo_statistics/ebin 7 | PLT_FILE = .leo_storage_dialyzer_plt 8 | DOT_FILE = leo_storage.dot 9 | CALL_GRAPH_FILE = leo_storage.png 10 | 11 | REBAR := ./rebar 12 | all: get_deps compile xref eunit 13 | get_deps: 14 | @$(REBAR) get-deps 15 | compile: 16 | @$(REBAR) compile 17 | xref: 18 | @$(REBAR) xref skip_deps=true 19 | eunit: 20 | @$(REBAR) eunit skip_deps=true 21 | release: 22 | rm -rf rel/leo_storage 23 | @$(REBAR) compile 24 | (cd rel/ && ../rebar generate) 25 | check_plt: 26 | @$(REBAR) compile 27 | dialyzer --check_plt --plt $(PLT_FILE) --apps $(APPS) 28 | build_plt: 29 | @$(REBAR) compile 30 | dialyzer --build_plt --output_plt $(PLT_FILE) --apps $(APPS) $(LIBS) 31 | dialyzer: 32 | @$(REBAR) compile 33 | dialyzer -Wno_return --plt $(PLT_FILE) -r ebin/ --dump_callgraph $(DOT_FILE) | fgrep -v -f ./dialyzer.ignore-warnings 34 | doc: compile 35 | @$(REBAR) doc 36 | callgraph: graphviz 37 | dot -Tpng -o$(CALL_GRAPH_FILE) $(DOT_FILE) 38 | graphviz: 39 | $(if $(shell which dot),,$(error "To make the depgraph, you need graphviz installed")) 40 | clean: 41 | @$(REBAR) clean 42 | distclean: 43 | @$(REBAR) delete-deps 44 | @$(REBAR) clean 45 | -------------------------------------------------------------------------------- /apps/leo_storage/cuttlefish: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/cuttlefish -------------------------------------------------------------------------------- /apps/leo_storage/dialyzer.ignore-warnings: -------------------------------------------------------------------------------- 1 | The pattern 'delete' can never match the type 'put' 2 | The pattern {'ok', _} can never match the type {'error',reference(),_} | {'ok',reference(),{'etag',binary()}} 3 | The pattern 'ok' can never match the type 'not_found' | {'error',_} 4 | -------------------------------------------------------------------------------- /apps/leo_storage/rebar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/rebar -------------------------------------------------------------------------------- /apps/leo_storage/rel/files/app.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Storage 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_storage/priv/leo_storage.conf 27 | []. 28 | -------------------------------------------------------------------------------- /apps/leo_storage/rel/files/erl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## This script replaces the default "erl" in erts-VSN/bin. This is necessary 4 | ## as escript depends on erl and in turn, erl depends on having access to a 5 | ## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect 6 | ## of running escript -- the embedded node bypasses erl and uses erlexec directly 7 | ## (as it should). 8 | ## 9 | ## Note that this script makes the assumption that there is a start_clean.boot 10 | ## file available in $ROOTDIR/release/VSN. 11 | 12 | # Determine the abspath of where this script is executing from. 13 | ERTS_BIN_DIR=$(cd ${0%/*} && pwd) 14 | 15 | # Now determine the root directory -- this script runs from erts-VSN/bin, 16 | # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR 17 | # path. 18 | ROOTDIR=${ERTS_BIN_DIR%/*/*} 19 | 20 | # Parse out release and erts info 21 | START_ERL=`cat $ROOTDIR/releases/start_erl.data` 22 | ERTS_VSN=${START_ERL% *} 23 | APP_VSN=${START_ERL#* } 24 | 25 | BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin 26 | EMU=beam 27 | PROGNAME=`echo $0 | sed 's/.*\\///'` 28 | CMD="$BINDIR/erlexec" 29 | export EMU 30 | export ROOTDIR 31 | export BINDIR 32 | export PROGNAME 33 | 34 | exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"} 35 | -------------------------------------------------------------------------------- /apps/leo_storage/rel/files/leo_storage.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @set node_name=leo_storage 4 | 5 | @rem Get the abolute path to the parent directory, 6 | @rem which is assumed to be the node root. 7 | @for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI 8 | 9 | @set releases_dir=%node_root%\releases 10 | 11 | @rem Parse ERTS version and release version from start_erl.data 12 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 13 | @call :set_trim erts_version %%I 14 | @call :set_trim release_version %%J 15 | ) 16 | 17 | @set erts_bin=%node_root%\erts-%erts_version%\bin 18 | 19 | @set service_name=%node_name%_%release_version% 20 | 21 | @if "%1"=="install" @goto install 22 | @if "%1"=="uninstall" @goto uninstall 23 | @if "%1"=="start" @goto start 24 | @if "%1"=="stop" @goto stop 25 | @if "%1"=="restart" @call :stop && @goto start 26 | @if "%1"=="console" @goto console 27 | @rem TODO: attach, ping, restart and reboot 28 | 29 | :usage 30 | @echo Usage: %0 {install|uninstall|start|stop|restart|console} 31 | @goto :EOF 32 | 33 | :install 34 | @%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -sname %node_name% -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()." 35 | @goto :EOF 36 | 37 | :uninstall 38 | @%erts_bin%\erlsrv.exe remove %service_name% 39 | @%erts_bin%\epmd.exe -kill 40 | @goto :EOF 41 | 42 | :start 43 | @%erts_bin%\erlsrv.exe start %service_name% 44 | @goto :EOF 45 | 46 | :stop 47 | @%erts_bin%\erlsrv.exe stop %service_name% 48 | @goto :EOF 49 | 50 | :console 51 | @start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name% 52 | @goto :EOF 53 | 54 | :set_trim 55 | @set %1=%2 56 | @goto :EOF 57 | -------------------------------------------------------------------------------- /apps/leo_storage/rel/files/start_erl.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++. 4 | @rem Other args are position dependent. 5 | @set args="%*" 6 | @for /F "delims=++ tokens=1,2,3" %%I in (%args%) do @( 7 | @set erl_args=%%I 8 | @call :set_trim node_name %%J 9 | @call :set_trim node_root %%K 10 | ) 11 | 12 | @set releases_dir=%node_root%\releases 13 | 14 | @rem parse ERTS version and release version from start_erl.dat 15 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 16 | @call :set_trim erts_version %%I 17 | @call :set_trim release_version %%J 18 | ) 19 | 20 | @set erl_exe=%node_root%\erts-%erts_version%\bin\erl.exe 21 | @set boot_file=%releases_dir%\%release_version%\%node_name% 22 | 23 | @if exist %releases_dir%\%release_version%\sys.config ( 24 | @set app_config=%releases_dir%\%release_version%\sys.config 25 | ) else ( 26 | @set app_config=%node_root%\etc\app.config 27 | ) 28 | 29 | @if exist %releases_dir%\%release_version%\vm.args ( 30 | @set vm_args=%releases_dir%\%release_version%\vm.args 31 | ) else ( 32 | @set vm_args=%node_root%\etc\vm.args 33 | ) 34 | 35 | @%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args% 36 | 37 | :set_trim 38 | @set %1=%2 39 | @goto :EOF 40 | -------------------------------------------------------------------------------- /apps/leo_storage/rel/files/sys.config: -------------------------------------------------------------------------------- 1 | [ 2 | %% SASL config 3 | {sasl, [ 4 | {sasl_error_logger, {file, "log/sasl-error.log"}}, 5 | {errlog_type, error}, 6 | {error_logger_mf_dir, "log/sasl"}, % Log directory 7 | {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size 8 | {error_logger_mf_maxfiles, 5} % 5 files max 9 | ]} 10 | ]. 11 | 12 | -------------------------------------------------------------------------------- /apps/leo_storage/rel/files/vm.args: -------------------------------------------------------------------------------- 1 | ## Name of the node 2 | -name {{node}} 3 | 4 | ## Cookie for distributed erlang 5 | -setcookie {{cookie}} 6 | 7 | ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive 8 | ## (Disabled by default..use with caution!) 9 | ##-heart 10 | 11 | ## Enable kernel poll and a few async threads 12 | +K true 13 | +A 32 14 | 15 | ## Increase number of concurrent ports/sockets 16 | ##-env ERL_MAX_PORTS 4096 17 | 18 | ## Tweak GC to run more often 19 | ##-env ERL_FULLSWEEP_AFTER 10 20 | 21 | ## SNMP Config file 22 | -config {{platform_snmp_dir}}/{{snmp_conf_dir}}/leo_storage_snmp 23 | 24 | ## Sets the maximum number of concurrent processes for this system 25 | +P 1048576 26 | 27 | ## set up the node with the -hidden flag 28 | -hidden 29 | -------------------------------------------------------------------------------- /apps/leo_storage/rel/vars.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Storage 5 | %% 6 | %% Copyright (c) 2012-2018 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_storage/priv/leo_storage.conf 27 | -------------------------------------------------------------------------------- /apps/leo_storage/replace_otp_vsn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . -name rebar.config|xargs sed -i 's/require_otp_vsn,\s\+"\(.\+\)"/require_otp_vsn, "19|20|21|22"/g' 3 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/LEO-STORAGE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_0/LEO-STORAGE.bin -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/LEO-STORAGE.funcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_0/LEO-STORAGE.funcs -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4010}. 3 | {snmpEngineID, "Erlang SNMP LEO STORAGE"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_0/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO STORAGE"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35450,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. 7 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_0/leo_storage_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_storage_0/db"}, 3 | {config, [{dir, "snmp/snmpa_storage_0/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/LEO-STORAGE.bin: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.bin -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/LEO-STORAGE.funcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_1/LEO-STORAGE.funcs -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/LEO-STORAGE.mib: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.mib -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4011}. 3 | {snmpEngineID, "Erlang SNMP LeoFS"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_1/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. 2 | {sysDescr, "Erlang SNMP LEO STORAGE"}. 3 | {sysServices, 72}. 4 | {sysObjectID, [1,3,6,1,4,1,35450,1]}. 5 | {sysContact, "dev@leo-project.net"}. 6 | {snmpEnableAuthenTraps, enabled}. 7 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_1/leo_storage_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_storage_1/db"}, 3 | {config, [{dir, "snmp/snmpa_storage_1/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/LEO-STORAGE.bin: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.bin -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/LEO-STORAGE.mib: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.mib -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4012}. 3 | {snmpEngineID, "Erlang SNMP LeoFS"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_2/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. {sysDescr, "Erlang SNMP LEO STORAGE"}. {sysServices, 72}. {sysObjectID, [1,3,6,1,4,1,35450,1]}. {sysContact, "dev@leo-project.net"}. {snmpEnableAuthenTraps, enabled}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_2/leo_storage_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_storage_2/db"}, 3 | {config, [{dir, "snmp/snmpa_storage_2/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/LEO-STORAGE.bin: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.bin -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/LEO-STORAGE.mib: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.mib -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4013}. 3 | {snmpEngineID, "Erlang SNMP LeoFS"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_3/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. {sysDescr, "Erlang SNMP LEO STORAGE"}. {sysServices, 72}. {sysObjectID, [1,3,6,1,4,1,35450,1]}. {sysContact, "dev@leo-project.net"}. {snmpEnableAuthenTraps, enabled}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_3/leo_storage_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_storage_3/db"}, 3 | {config, [{dir, "snmp/snmpa_storage_3/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/LEO-STORAGE.bin: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.bin -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/LEO-STORAGE.mib: -------------------------------------------------------------------------------- 1 | ../snmpa_storage_0/LEO-STORAGE.mib -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/agent/conf/agent.conf: -------------------------------------------------------------------------------- 1 | {intAgentIpAddress, [127,0,0,1]}. 2 | {intAgentUDPPort, 4014}. 3 | {snmpEngineID, "Erlang SNMP LeoFS"}. 4 | {snmpEngineMaxMessageSize, 484}. 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/agent/conf/community.conf: -------------------------------------------------------------------------------- 1 | {"public", "public", "initial", "", ""}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/agent/conf/context.conf: -------------------------------------------------------------------------------- 1 | %% This file was automatically generated by snmp_config v4.15 2010-02-17 12:08:41 2 | 3 | %% The default context 4 | "". 5 | -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/agent/conf/notify.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/snmp/snmpa_storage_4/agent/conf/notify.conf -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/agent/conf/standard.conf: -------------------------------------------------------------------------------- 1 | {sysName, "leofs"}. {sysDescr, "Erlang SNMP LEO STORAGE"}. {sysServices, 72}. {sysObjectID, [1,3,6,1,4,1,35450,1]}. {sysContact, "dev@leo-project.net"}. {snmpEnableAuthenTraps, enabled}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/agent/conf/vacm.conf: -------------------------------------------------------------------------------- 1 | {vacmSecurityToGroup, v2c, "initial", "initial"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmSecurityToGroup, v1, "initial", "initial"}. {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. {vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. -------------------------------------------------------------------------------- /apps/leo_storage/snmp/snmpa_storage_4/leo_storage_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "snmp/snmpa_storage_4/db"}, 3 | {config, [{dir, "snmp/snmpa_storage_4/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /apps/leo_storage/src/leo_storage.app.src: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoStorage 5 | %% 6 | %% Copyright (c) 2012-2018 Rakuten, Inc. 7 | %% Copyright (c) 2019-2020 Lions Data, Ltd. 8 | %% 9 | %% This file is provided to you under the Apache License, 10 | %% Version 2.0 (the "License"); you may not use this file 11 | %% except in compliance with the License. You may obtain 12 | %% a copy of the License at 13 | %% 14 | %% http://www.apache.org/licenses/LICENSE-2.0 15 | %% 16 | %% Unless required by applicable law or agreed to in writing, 17 | %% software distributed under the License is distributed on an 18 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19 | %% KIND, either express or implied. See the License for the 20 | %% specific language governing permissions and limitations 21 | %% under the License. 22 | %% 23 | %%====================================================================== 24 | {application, leo_storage, 25 | [ 26 | {description, "LEO Storage Server"}, 27 | {vsn, "1.4.4"}, 28 | {id, "leo_storage"}, 29 | {registered, []}, 30 | {applications, [kernel, stdlib, crypto, os_mon]}, 31 | {mod, {leo_storage_app, []}}, 32 | {env, [ 33 | {num_of_replicators, 32}, 34 | {num_of_repairers, 32}, 35 | {num_of_mq_procs, 5}, 36 | {log_level, 1}, 37 | {log_appender, [{file, [{path, "./"}]}]} 38 | ]} 39 | ] 40 | }. 41 | -------------------------------------------------------------------------------- /apps/leo_storage/test/leo_storage_test.config: -------------------------------------------------------------------------------- 1 | {mode, max}. 2 | {duration, 1}. 3 | {concurrent, 20}. 4 | 5 | {driver, basho_bench_driver_leo_storage}. 6 | 7 | {key_generator, {uniform_int, 1000000}}. 8 | {operations, [{put, 1}]}. 9 | 10 | -------------------------------------------------------------------------------- /build_mdcr_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #====================================================================== 3 | # 4 | # LeoFS 5 | # 6 | # Copyright (c) 2013-2014 Rakuten, Inc. 7 | # 8 | # This file is provided to you under the Apache License, 9 | # Version 2.0 (the "License"); you may not use this file 10 | # except in compliance with the License. You may obtain 11 | # a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, 16 | # software distributed under the License is distributed on an 17 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | # KIND, either express or implied. See the License for the 19 | # specific language governing permissions and limitations 20 | # under the License. 21 | # 22 | #====================================================================== 23 | echo "*** LeoFS - Start building mdcr test-environment ***" 24 | 25 | ./mdcr.sh deploy 26 | ./mdcr.sh start 27 | 28 | echo "*** leofs - Finished :) ***" 29 | -------------------------------------------------------------------------------- /docs/admin/protocols/rest.md: -------------------------------------------------------------------------------- 1 | # Interface: REST-API 2 | ## Configuration 3 | 4 | Update LeoGateway's protocol configuration to `rest` in your [LeoGateway configuration](https://github.com/leo-project/leofs/blob/1.3.2.1/apps/leo_gateway/priv/leo_gateway.conf) 5 | 6 | 7 | ```ini 8 | ## -------------------------------------------------------------------- 9 | ## GATEWAY Protocol 10 | ## -------------------------------------------------------------------- 11 | ## Gateway Protocol to use: [s3 | rest | embed | nfs] 12 | protocol = rest 13 | ``` 14 | 15 | ## Interface 16 | ### Description of LeoFS’ behavior for each HTTP verb 17 | 18 | | HTTP Verb | LeoFS’ Behavior | 19 | |-----------|-----------------| 20 | | PUT/POST | Insert an object into the storage cluster | 21 | | GET | Retrieve an object from the storage cluster | 22 | | DELETE | Remove an object from the storage cluster | 23 | 24 | ### URL format 25 | 26 | * URL format: http[s]://``:8080/`` 27 | * LeoFS only uses the `` which part of the URL to identify objects. 28 | * You can check that an object exists in a LeoFS' cluster by using `leofs-adm whereis` command. 29 | 30 | ```bash 31 | $ leofs-adm whereis 32 | ``` 33 | 34 | 35 | ## Examples 36 | ### POST/PUT 37 | 38 | ```bash 39 | $ curl -X POST -H "Content-Type:image/jpg" \ 40 | --data-binary @test_1.jpg https://hostname:8080/_test/_image/file.png 41 | 42 | $ curl -X PUT -H "Content-Type:image/jpg" \ 43 | --data-binary @test_2.jpg https://hostname:8080/_test/_image/file.png 44 | ``` 45 | 46 | ### GET 47 | 48 | ```bash 49 | $ curl -X GET https://hostname:8080/_test/_image/test_2.jpg 50 | ``` 51 | 52 | ### DELETE 53 | 54 | ```bash 55 | $ curl -X DELETE https://hostname:8080/_test/_image/file.png 56 | ``` 57 | 58 | 59 | ## Related Links 60 | 61 | * [For Administrators / Settings / LeoGateway Settings](/admin/settings/leo_gateway.md) -------------------------------------------------------------------------------- /docs/admin/setup/hardware_requirements.md: -------------------------------------------------------------------------------- 1 | # Hardware Requirements 2 | ## Minimum Requirements 3 | 4 | | | CPU | Memory | Disk | 5 | |---------|-----|--------|--------| 6 | | Manager | 1 | 512 MB | 20 GB | 7 | | Gateway | 2 | 1 GB | 20 GB | 8 | | Storage | 2 | 1 GB | 100 GB | 9 | 10 | 11 | ## Hardware Recommendation 12 | 13 | 1. **Workload on Manager is low**, it does not consume many resources 14 | 2. **Better CPU allows LeoGateway** to process more operations (OPS, *Operation Per Second*) 15 | 3. LeoGateway utilizes **memory and disk as cache**, adding those resources can reduce the workload to LeoStorage 16 | 4. **SSD** on a LeoStoage node significantly improves small object read performance 17 | 5. **10Gbps network** is recommended 18 | 19 | 20 | ## Reference Platform 21 | 22 | | Hardware | Detail | 23 | |----------|---------------------------| 24 | | CPU | 16C32T (Intel E5-2630 v3) | 25 | | Memory | 32 GB | 26 | | Network | 10 GbE | 27 | | Disk | SSD (Crucial BX100) | 28 | 29 | 30 | ### Performance 31 | 32 | | Data Set | Read | Write | Resource Usage | 33 | |--------------------|-----------|-----------|----------------| 34 | | Image (32KB) | 20,000 OPS| 20,000 OPS| High CPU Usage | 35 | | Small Mixed (<2MB) | 1,200 OPS | 1,500 OPS | High Disk I/O | 36 | 37 | 38 | ## Related Links 39 | 40 | - [For Administrators / Setup / Planning for Production](planning_for_production.md) 41 | - leo-project/notes - LeoFS Benchmark Report -------------------------------------------------------------------------------- /docs/admin/setup/planning_for_production.md: -------------------------------------------------------------------------------- 1 | # Planning for Production 2 | 3 | This section provides information to set up LeoFS on the production environment. Planning for production involves ensuring that the hardware and software requirements are met, and the deployment and security consideration are taken into account before installing LeoFS. You can choose to install LeoFS on-premises on [supported platforms](supported_platforms.md) or virtualization platforms. 4 | 5 | Before you begin the actual installation, ensure that you go through the section. 6 | For installation instructions on different platforms: 7 | 8 | * On-premises 9 | * Virtualization platforms: 10 | * Amazon Web Services and Docker 11 | 12 | 13 | ## Related Links 14 | 15 | - [For Administrators / Setup / Supported Platforms](supported_platforms.md) 16 | - [For Administrators / Setup / Hardware Requirements](hardware_requirements.md) 17 | - [For Administrators / Setup / Network Configuration](network_config.md) -------------------------------------------------------------------------------- /docs/admin/setup/supported_platforms.md: -------------------------------------------------------------------------------- 1 | # Supported Platforms 2 | 3 | LeoFS supports popular operating systems and virtual environments. 4 | 5 | | Platform | Version | 32/64 bit | Supported | 6 | |--- |--- |--- |--- | 7 | | CentOS | 7 | 64 bit | Development, testing and production | 8 | | CentOS | 6 | 64 bit | Development, testing and production | 9 | | Ubuntu Linux | 16.04 | 64 bit | Development, testing and production | 10 | | Ubuntu Linux | 14.04 | 64 bit | Development, testing and production | 11 | | AWS.EC2 Red Hat Enterprise Linux | 7 | 64 bit | Development, testing | 12 | | AWS.EC2 Red Hat Enterprise Linux | 6 | 64 bit | Development, testing | 13 | | AWS.EC2 Ubuntu | 16.04 | 64 bit | Development, testing | 14 | | AWS.EC2 Ubuntu | 14.04 | 64 bit | Development, testing | 15 | 16 | 17 | ## Related Links 18 | 19 | - [For Administrators / Setup / Planning for Production](planning_for_production.md) 20 | -------------------------------------------------------------------------------- /docs/admin/system_admin/backup_and_restore.md: -------------------------------------------------------------------------------- 1 | # Backup and Restore -------------------------------------------------------------------------------- /docs/admin/system_operations/others.md: -------------------------------------------------------------------------------- 1 | # Other Operations 2 | 3 | ## MQ Operations 4 | 5 | ## Object Cache Operations -------------------------------------------------------------------------------- /docs/admin/troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting -------------------------------------------------------------------------------- /docs/architecture/README.md: -------------------------------------------------------------------------------- 1 | # Architecture 2 | 3 | ## Concept 4 | 5 | What we’re focused on is **high availability**, **high scalability**, and **high-cost performance ratio** because unstructured data which have been exponentially increasing day by day, and we needed to more efficiently manage objects to find values from tons of raw data. 6 | 7 | ## Architecture Overview 8 | 9 | We succeeded in designing and implementing LeoFS as simple as possible. LeoFS consists of three components, [LeoManager](leo_manager.md), [LeoStorage](leo_storage.md), and [LeoGateway](leo_gateway.md). The role of each component is clearly defined. 10 | 11 | ![](../assets/leofs-architecture.001.jpg) 12 | 13 | What we also carefully desined LeoFS is three things: 14 | 15 | * To keep running LeoFS without SPOF 16 | * To keep maintaining high performance regardless of the kind of data and amount data 17 | * To provide easy administration by the LeoFS' CLI, [leofs-adm](https://github.com/leo-project/leofs/blob/master/leofs-adm) 18 | 19 | 20 | ## Related Links 21 | 22 | - [Concept and Architecture / LeoGateway's Architecture](leo_gateway.md) 23 | - [Concept and Architecture / LeoStorage's Architecture](leo_storage.md) 24 | - [Concept and Architecture / LeoManager's Architecture](leo_manager.md) -------------------------------------------------------------------------------- /docs/architecture/leo_gateway.md: -------------------------------------------------------------------------------- 1 | # LeoGateway's Architecture 2 | 3 | LeoGateway consists of the fast HTTP server which is Cowboy, the multi-protocols handler, and the object cache. It provides multi-protocols which are the RESTful API, Amazon S3-API, and NFS v3. If you adopt using Amazon S3-API, you can easily access LeoFS with S3 clients which include s3cmd, DragonDisk and AWS SDKs - Java, Ruby, Go, Python (Boto3) and others. 4 | 5 | 6 | ![](../assets/leofs-architecture.002.jpg) 7 | 8 | A client requests an object or a bucket operation to a LeoGateway node, then it requests the message of an operation to a LeoStorage node. 9 | 10 | A destination LeoStorage node is decided by RING *(distributed hash table)*, which is generated and distributed at LeoManager nodes. 11 | 12 | LeoGateway also provides built-in support for the object cache to realize keeping high performance and reduction of traffic between LeoGateway nodes and LeoStorage nodes. 13 | 14 | 15 | ## Related Links 16 | 17 | - [For Administrators / Settings / LeoGateway Settings](/admin/settings/leo_gateway.md) 18 | - [For Administrators / Interface / S3-API](/admin/protocols/s3.md) 19 | - [For Administrators / Interface / REST-API](/admin/protocols/rest.md) 20 | - [For Administrators / Interface / NFS v3](/admin/protocols/nfs_v3.md) 21 | - [For Administrators / System Operations / S3-API related Operations](/admin/system_operations/s3.md) -------------------------------------------------------------------------------- /docs/architecture/leo_manager.md: -------------------------------------------------------------------------------- 1 | # LeoManager's Architecture 2 | 3 | LeoManager monitors the state of LeoGateway and LeoStorage nodes to keep the high availability of a LeoFS system. A consistency of RING (*distributed hash table*) of LeoGateway and LeoStorage nodes are always monitored by LeoManager to prevent split-brain. 4 | 5 | 6 | ![](../assets/leofs-architecture.007.jpg) 7 | 8 | Both LeoManager nodes manage configurations of a system and information of every node to be able to recover a system reliability, and the data are replicated by Erlang Mnesia to avoid data loss. 9 | 10 | LeoManager provides [leofs-adm as a LeoFS administration commands](../admin/index_of_commands.md) to be able to operate LeoFS quickly. The administration commands already cover entire LeoFS features. 11 | 12 | ## Related Links 13 | 14 | - [For Administrators / Index of LeoFS' Commands](/admin/index_of_commands.md) 15 | - [For Administrators / Settings / LeoManager Settings](/admin/settings/leo_manager.md) -------------------------------------------------------------------------------- /docs/assets/graffle/leofs-avs-file-format.graffle.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/graffle/leofs-avs-file-format.graffle.zip -------------------------------------------------------------------------------- /docs/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/images/favicon.png -------------------------------------------------------------------------------- /docs/assets/leofs-architecture.001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-architecture.001.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-architecture.0012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-architecture.0012.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-architecture.002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-architecture.002.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-architecture.003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-architecture.003.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-architecture.005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-architecture.005.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-architecture.006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-architecture.006.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-architecture.007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-architecture.007.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-auto-compaction-figure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-auto-compaction-figure.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-avs-file-format.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-avs-file-format.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-compaction-state-transition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-compaction-state-transition.png -------------------------------------------------------------------------------- /docs/assets/leofs-flow-diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-flow-diagram.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-gateway-disk-cache-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-gateway-disk-cache-size.png -------------------------------------------------------------------------------- /docs/assets/leofs-monitoring-with-grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-monitoring-with-grafana.png -------------------------------------------------------------------------------- /docs/assets/leofs-mq-figure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-mq-figure.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-order-of-system-launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-order-of-system-launch.png -------------------------------------------------------------------------------- /docs/assets/leofs-upgrade-flow-diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-upgrade-flow-diagram.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-watchdog-auto-compaction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-watchdog-auto-compaction.jpg -------------------------------------------------------------------------------- /docs/assets/leofs-watchdog-mq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/docs/assets/leofs-watchdog-mq.jpg -------------------------------------------------------------------------------- /docs/book.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "LeoFS Documentation", 3 | "plugins": ["toc"], 4 | "pluginsConfig": { 5 | "toc": { 6 | "addClass": true, 7 | "className": "toc" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | README.md -------------------------------------------------------------------------------- /docs/production_checklist/README.md: -------------------------------------------------------------------------------- 1 | # Production Checklist: LeoFS 2 | 3 | 4 | 5 | ## What version should we use? 6 | Use the latest stable one. With the version <= v1.4.0, LeoFS had some serious issues that may cause data-lost, so that use at least >= v1.4.1. Or in case you need to keep running LeoFS with older one for some reason, make sure that you avoid those issues with the below check list. 7 | 8 | ## Check list to avoid serious issues for those who have to keep running some older version of LeoFS 9 | 10 | - [large_object.reading_chunked_obj_len](https://github.com/leo-project/leofs/blob/1.3.2.1/apps/leo_gateway/priv/leo_gateway.conf#L126) <= [large_object.chunked_obj_len](https://github.com/leo-project/leofs/blob/1.3.2.1/apps/leo_gateway/priv/leo_gateway.conf#L117) in `leo_gateway.conf`. This setting prevents LeoFS from suffering [LeoFS Issue#531](https://github.com/leo-project/leofs/issues/531). 11 | 12 | - If you are supposed to use multipart upload feature then set the part size to something less than 10MB. This setting prevents LeoFS from suffering [LEOFS_Issue#1017](https://github.com/leo-project/leofs/issues/1017). 13 | 14 | - Never use PUT Object acl request[^1]. Not using PUT Object acl prevents LeoFS from suffering [LEOFS_Issue#1021](https://github.com/leo-project/leofs/issues/1021). 15 | 16 | [^1]: PUT Object acl 17 | 18 | -------------------------------------------------------------------------------- /git_checkout.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage() 4 | { 5 | echo "Usage: ./git_checkout.sh [-h|--help] [--pull] BRANCH" 6 | } 7 | 8 | WITH_PULL=1 9 | BRANCH= 10 | 11 | for opt in $@; do 12 | case ${opt} in 13 | -h|--help) 14 | usage 15 | exit 1 16 | ;; 17 | --pull) 18 | WITH_PULL=0 19 | ;; 20 | *) 21 | BRANCH=${opt} 22 | ;; 23 | esac 24 | shift 25 | done 26 | 27 | if [ -z "${BRANCH}" ]; then 28 | echo "[ERROR] branch not specified" 29 | usage 30 | exit 1 31 | fi 32 | 33 | for dir in `find deps/leo_* -maxdepth 0` deps/savanna_commons deps/savanna_agent 34 | do 35 | cd $dir 36 | echo $dir 37 | git checkout ${BRANCH} 38 | if [ ${WITH_PULL} = 0 ]; then 39 | git pull 40 | fi 41 | cd ../../ 42 | done 43 | -------------------------------------------------------------------------------- /git_switch_head.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if echo $1 | grep -q -v "^\{.\+\}$"; then 4 | branch_or_tag=\"${1}\" 5 | else 6 | branch_or_tag=$1 7 | fi 8 | 9 | if [ $# -lt 1 ]; then 10 | echo 'missing operand. specify a git refspec' 11 | exit 1 12 | fi 13 | find . -name "rebar.config" -print0 |xargs -0 grep leo-project|awk -F ":" '{print $1}'|uniq|xargs sed -i -s "s/{git,\([^,]\+leo-project[^,]\+\),\\s\+[\"{]\([^\"]\+\)[\"}]}}/{git,\1, $branch_or_tag}}/g" 14 | -------------------------------------------------------------------------------- /leofs.mk: -------------------------------------------------------------------------------- 1 | LEOFS_VERSION=1.4.4 2 | -------------------------------------------------------------------------------- /make_libs_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 1 ]; then 4 | echo "Usage: ./git_checkout.sh " 5 | exit 1 6 | fi 7 | 8 | for lib in leo_backend_db \ 9 | leo_cache \ 10 | leo_commons \ 11 | leo_dcerl \ 12 | leo_logger \ 13 | leo_mcerl \ 14 | leo_mq \ 15 | leo_object_storage \ 16 | leo_ordning_reda \ 17 | leo_pod \ 18 | leo_redundant_manager \ 19 | leo_rpc \ 20 | leo_s3_libs \ 21 | leo_statistics 22 | do 23 | echo $lib 24 | cd "deps/$lib" && sh ./make_rst_doc.sh && cp doc/rst/* $1/$lib/ 25 | cd - 26 | done 27 | echo "Finished" 28 | -------------------------------------------------------------------------------- /make_reltool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # requires first parameter to be either "yes" or "no", which is done by "make reltool" 4 | with_sd_notify=$1 5 | 6 | sed " 7 | 1 i\\ 8 | %% CAUTION: Don't edit this file as it's automatically generated through \"make release\" 9 | 1 i\\ 10 | %% Edit \"reltool.config.in\" instead 11 | b $with_sd_notify 12 | :yes 13 | s/%% SD_NOTIFY_PLACEHOLDER/,{app, sd_notify, [{incl_cond, include}]}/ 14 | b 15 | :no 16 | /%% SD_NOTIFY_PLACEHOLDER/d" $2 17 | -------------------------------------------------------------------------------- /pkg/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all leo_manager leo_gateway leo_storage 2 | 3 | all: leo_manager leo_gateway leo_storage 4 | 5 | clean: clean_manager clean_gateway clean_storage 6 | 7 | clean_manager: 8 | make -C leo_manager clean 9 | 10 | clean_gateway: 11 | make -C leo_gateway clean 12 | 13 | clean_storage: 14 | make -C leo_storage clean 15 | 16 | leo_manager: 17 | make -C leo_manager package 18 | 19 | leo_gateway: 20 | make -C leo_gateway package 21 | 22 | leo_storage: 23 | make -C leo_storage package 24 | -------------------------------------------------------------------------------- /pkg/bootstrap/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /pkg/leo_gateway/.gitignore: -------------------------------------------------------------------------------- 1 | *.tgz 2 | packlist 3 | build-info 4 | -------------------------------------------------------------------------------- /pkg/leo_gateway/Makefile: -------------------------------------------------------------------------------- 1 | include ../../leofs.mk 2 | VERSION=$(LEOFS_VERSION) 3 | COMPONENT_INTERNAL=leo_gateway 4 | COMPONENT=leo_gateway 5 | COMPONENT_PATH=../../package/$(COMPONENT_INTERNAL) 6 | DIR=$(STAGE_DIR)/$(COMPONENT) 7 | PKG_CATEGORY=leofs 8 | PKG_HOMEPAGE=https://leo-project.net/leofs/ 9 | DEPS="erlang>=16.1.2" 10 | 11 | include ../../deps/fifo_utils/priv/pkg.mk 12 | 13 | .PHONY: build_info package package_list all bootstrap 14 | 15 | all: package 16 | 17 | package: prepare $(FILE).tgz 18 | 19 | prepare: 20 | -rm -r $(DIR) 21 | cp -r $(COMPONENT_PATH) $(DIR) 22 | mkdir $(DIR)/share 23 | cp files/$(COMPONENT).xml $(DIR)/share 24 | cp files/start $(DIR)/erts-*/bin/start 25 | rm $(DIR)/etc/leo_gateway.conf 26 | cp files/leo_gateway.conf $(DIR)/etc/leo_gateway.conf.example 27 | cp files/leo_gateway_snmp.config.0 $(DIR)/snmp/snmpa_gateway_0/leo_gateway_snmp.config 28 | cp files/leo_gateway_snmp.config.1 $(DIR)/snmp/snmpa_gateway_1/leo_gateway_snmp.config 29 | 30 | clean: clean-pkg 31 | -rm $(STAGE_DIR)/sbin/leofs-adm 32 | -rm -r $(DIR) 33 | -rm *.tgz 34 | -------------------------------------------------------------------------------- /pkg/leo_gateway/comment: -------------------------------------------------------------------------------- 1 | LeoFS gateway. 2 | -------------------------------------------------------------------------------- /pkg/leo_gateway/deinstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | case $2 in 4 | DEINSTALL) 5 | ;; 6 | POST-DEINSTALL) 7 | ;; 8 | esac 9 | -------------------------------------------------------------------------------- /pkg/leo_gateway/deploy/.gitignore: -------------------------------------------------------------------------------- 1 | leo_gateway 2 | -------------------------------------------------------------------------------- /pkg/leo_gateway/description: -------------------------------------------------------------------------------- 1 | leo_gateway is handling http request and response and acceptable S3-API. 2 | -------------------------------------------------------------------------------- /pkg/leo_gateway/displayfile: -------------------------------------------------------------------------------- 1 | .------------------------------------------------------------------------------. 2 | | | 3 | | Write some nice information that comes in handy when you instal leo_gateway. | 4 | | | 5 | `------------------------------------------------------------------------------' 6 | 7 | -------------------------------------------------------------------------------- /pkg/leo_gateway/files/leo_gateway_snmp.config.0: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "/var/db/leo_gateway/snmp"}, 3 | {config, [{dir, "snmp/snmpa_gateway_0/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /pkg/leo_gateway/files/leo_gateway_snmp.config.1: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "/var/db/leo_gateway/snmp"}, 3 | {config, [{dir, "snmp/snmpa_gateway_1/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /pkg/leo_gateway/files/start: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # %CopyrightBegin% 4 | # 5 | # Copyright Ericsson AB 1996-2009. All Rights Reserved. 6 | # 7 | # The contents of this file are subject to the Erlang Public License, 8 | # Version 1.1, (the "License"); you may not use this file except in 9 | # compliance with the License. You should have received a copy of the 10 | # Erlang Public License along with this software. If not, it can be 11 | # retrieved online at http://www.erlang.org/. 12 | # 13 | # Software distributed under the License is distributed on an "AS IS" 14 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 15 | # the License for the specific language governing rights and limitations 16 | # under the License. 17 | # 18 | # %CopyrightEnd% 19 | # 20 | # This program invokes the erlang emulator by calling run_erl. 21 | # It should only be used at an embedded target system. 22 | # It should be modified to give the correct flags to erl (via start_erl), 23 | # e.g -mode embedded -sname XXX 24 | # 25 | # Usage: start [Data] 26 | # 27 | ROOTDIR=/opt/local/lib/erlang 28 | 29 | if [ -z "$RELDIR" ] 30 | then 31 | RELDIR=$ROOTDIR/releases 32 | fi 33 | 34 | START_ERL_DATA=${1:-$RELDIR/start_erl.data} 35 | 36 | $ROOTDIR/bin/run_erl -daemon /tmp/ /var/log/leo_gateway "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA" 37 | -------------------------------------------------------------------------------- /pkg/leo_gateway/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | USER=leofs 4 | GROUP=$USER 5 | COMPONENT=leo_gateway 6 | DIR=/opt/local/$COMPONENT 7 | 8 | case $2 in 9 | PRE-INSTALL) 10 | if grep "^$GROUP:" /etc/group > /dev/null 2>&1 11 | then 12 | echo "Group already exists, skipping creation." 13 | else 14 | echo Creating $GROUP group ... 15 | groupadd $GROUP 16 | fi 17 | if id $USER > /dev/null 2>&1 18 | then 19 | echo "User already exists, skipping creation." 20 | else 21 | echo Creating $USER user ... 22 | useradd -g $GROUP -d /var/db/leofs -s /bin/false $USER 23 | fi 24 | echo Creating directories ... 25 | mkdir -p /var/db/leofs 26 | chown -R $USER:$GROUP /var/db/leofs 27 | mkdir -p /var/db/$COMPONENT/snmp 28 | chown -R $USER:$GROUP /var/db/$COMPONENT 29 | mkdir -p /var/log/$COMPONENT/sasl 30 | chown -R $USER:$GROUP /var/log/$COMPONENT 31 | if [ -d /tmp/$COMPONENT ] 32 | then 33 | chown -R $USER:$GROUP /tmp/$COMPONENT/ 34 | fi 35 | ;; 36 | POST-INSTALL) 37 | if svcs svc:/network/$COMPONENT:default > /dev/null 2>&1 38 | then 39 | echo Service already existings ... 40 | else 41 | echo Importing service ... 42 | svccfg import $DIR/share/$COMPONENT.xml 43 | fi 44 | echo Trying to guess configuration ... 45 | IP=`ifconfig net0 | grep inet | awk -e '{print $2}'` 46 | if [ ! -f $DIR/etc/leo_gateway.conf ] 47 | then 48 | cp $DIR/etc/leo_gateway.conf.example $DIR/etc/leo_gateway.conf 49 | sed --in-place -e "s/127.0.0.1/${IP}/g" $DIR/etc/leo_gateway.conf 50 | fi 51 | ;; 52 | esac 53 | -------------------------------------------------------------------------------- /pkg/leo_gateway/post_pkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/pkg/leo_gateway/post_pkg -------------------------------------------------------------------------------- /pkg/leo_gateway/pre_pkg: -------------------------------------------------------------------------------- 1 | @pkgdep erlang>=15.1.1 2 | -------------------------------------------------------------------------------- /pkg/leo_manager/.gitignore: -------------------------------------------------------------------------------- 1 | *.tgz 2 | packlist 3 | build-info 4 | -------------------------------------------------------------------------------- /pkg/leo_manager/Makefile: -------------------------------------------------------------------------------- 1 | include ../../leofs.mk 2 | VERSION=$(LEOFS_VERSION) 3 | COMPONENT_INTERNAL=leo_manager 4 | COMPONENT=leo_manager 5 | COMPONENT_PATH=../../package/$(COMPONENT_INTERNAL)_0 6 | DIR=$(STAGE_DIR)/$(COMPONENT) 7 | PKG_CATEGORY=leofs 8 | PKG_HOMEPAGE=https://leo-project.net/leofs/ 9 | DEPS="erlang>=16.1.2" 10 | TARGET_DIR=/opt/local 11 | 12 | include ../../deps/fifo_utils/priv/pkg.mk 13 | 14 | .PHONY: build_info package package_list all bootstrap 15 | 16 | all: package 17 | 18 | package: prepare $(FILE).tgz 19 | 20 | prepare: 21 | -rm -r $(DIR) || true 22 | cp -r $(COMPONENT_PATH) $(DIR) 23 | mkdir $(DIR)/share 24 | cp ../../leofs-adm $(STAGE_DIR)/sbin 25 | cp files/$(COMPONENT).xml $(DIR)/share 26 | cp files/start $(DIR)/erts-*/bin/start 27 | rm $(DIR)/etc/leo_manager.conf || true 28 | cp files/leo_manager.conf.master $(DIR)/etc/leo_manager.conf.example 29 | cp files/leo_manager_snmp.config $(DIR)/snmp/snmpa_manager_0/ 30 | cp files/leo_manager_snmp.config $(DIR)/snmp/snmpa_manager_1/ 31 | 32 | clean: clean-pkg 33 | -rm $(STAGE_DIR)/sbin/leofs-adm 34 | -rm -r $(DIR) 35 | -rm *.tgz 36 | -------------------------------------------------------------------------------- /pkg/leo_manager/comment: -------------------------------------------------------------------------------- 1 | LeoFS manager. 2 | -------------------------------------------------------------------------------- /pkg/leo_manager/deinstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | case $2 in 4 | DEINSTALL) 5 | ;; 6 | POST-DEINSTALL) 7 | ;; 8 | esac 9 | -------------------------------------------------------------------------------- /pkg/leo_manager/deploy/.gitignore: -------------------------------------------------------------------------------- 1 | leo_manager/ 2 | sbin/leofs-adm 3 | -------------------------------------------------------------------------------- /pkg/leo_manager/description: -------------------------------------------------------------------------------- 1 | leo_maager is the coordinating component of LeoFS. 2 | -------------------------------------------------------------------------------- /pkg/leo_manager/displayfile: -------------------------------------------------------------------------------- 1 | .------------------------------------------------------------------------------. 2 | | | 3 | | Write some nice information that comes in handy when you instal leo_manager. | 4 | | | 5 | | The SmartOS packages don't distingush between the master and slave package, | 6 | | so they ship with example configurations for both scenarios. | 7 | | This means, before you start the manager the first time place decide what | 8 | | mode to run it in and either copy the .master or .slave app.config into | 9 | | place and adjust it for your values. | 10 | | | 11 | | The files can be found in: /opt/local/leo_manager/etc | 12 | | | 13 | `------------------------------------------------------------------------------' 14 | 15 | -------------------------------------------------------------------------------- /pkg/leo_manager/files/leo_manager_snmp.config: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "/var/db/leo_manager/snmp"}, 3 | {config, [{dir, "/opt/local/leo_manager/snmp/snmpa_manager_0/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /pkg/leo_manager/files/start: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # %CopyrightBegin% 4 | # 5 | # Copyright Ericsson AB 1996-2009. All Rights Reserved. 6 | # 7 | # The contents of this file are subject to the Erlang Public License, 8 | # Version 1.1, (the "License"); you may not use this file except in 9 | # compliance with the License. You should have received a copy of the 10 | # Erlang Public License along with this software. If not, it can be 11 | # retrieved online at http://www.erlang.org/. 12 | # 13 | # Software distributed under the License is distributed on an "AS IS" 14 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 15 | # the License for the specific language governing rights and limitations 16 | # under the License. 17 | # 18 | # %CopyrightEnd% 19 | # 20 | # This program invokes the erlang emulator by calling run_erl. 21 | # It should only be used at an embedded target system. 22 | # It should be modified to give the correct flags to erl (via start_erl), 23 | # e.g -mode embedded -sname XXX 24 | # 25 | # Usage: start [Data] 26 | # 27 | ROOTDIR=/opt/local/lib/erlang 28 | 29 | if [ -z "$RELDIR" ] 30 | then 31 | RELDIR=$ROOTDIR/releases 32 | fi 33 | 34 | START_ERL_DATA=${1:-$RELDIR/start_erl.data} 35 | 36 | $ROOTDIR/bin/run_erl -daemon /tmp/ /var/log/leo_manager "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA" 37 | -------------------------------------------------------------------------------- /pkg/leo_manager/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | USER=leofs 4 | GROUP=$USER 5 | COMPONENT=leo_manager 6 | DIR=/opt/local/$COMPONENT 7 | 8 | case $2 in 9 | PRE-INSTALL) 10 | if grep "^$GROUP:" /etc/group > /dev/null 2>&1 11 | then 12 | echo "Group already exists, skipping creation." 13 | else 14 | echo Creating $GROUP group ... 15 | groupadd $GROUP 16 | fi 17 | if id $USER > /dev/null 2>&1 18 | then 19 | echo "User already exists, skipping creation." 20 | else 21 | echo Creating $USER user ... 22 | useradd -g $GROUP -d /var/db/leofs -s /bin/false $USER 23 | fi 24 | echo Creating directories ... 25 | mkdir -p /var/db/leofs 26 | chown -R $USER:$GROUP /var/db/leofs 27 | mkdir -p /var/db/$COMPONENT/mnesia 28 | mkdir -p /var/db/$COMPONENT/work 29 | mkdir -p /var/db/$COMPONENT/snmp 30 | chown -R $USER:$GROUP /var/db/$COMPONENT 31 | mkdir -p /var/log/$COMPONENT/sasl 32 | chown -R $USER:$GROUP /var/log/$COMPONENT 33 | if [ -d /tmp/$COMPONENT ] 34 | then 35 | chown -R $USER:$GROUP /tmp/$COMPONENT/ 36 | fi 37 | ;; 38 | POST-INSTALL) 39 | if svcs svc:/network/$COMPONENT:default > /dev/null 2>&1 40 | then 41 | echo Service already existings ... 42 | else 43 | echo Importing service ... 44 | svccfg import $DIR/share/$COMPONENT.xml 45 | fi 46 | echo Trying to guess configuration ... 47 | IP=`ifconfig net0 | grep inet | awk -e '{print $2}'` 48 | if [ ! -f $DIR/etc/leo_manager.conf ] 49 | then 50 | cp $DIR/etc/leo_manager.conf.example $DIR/etc/leo_manager.conf 51 | sed --in-place -e "s/127.0.0.1/${IP}/g" $DIR/etc/leo_manager.conf 52 | fi 53 | ;; 54 | esac 55 | -------------------------------------------------------------------------------- /pkg/leo_storage/.gitignore: -------------------------------------------------------------------------------- 1 | *.tgz 2 | packlist 3 | build-info 4 | -------------------------------------------------------------------------------- /pkg/leo_storage/Makefile: -------------------------------------------------------------------------------- 1 | include ../../leofs.mk 2 | VERSION=$(LEOFS_VERSION) 3 | COMPONENT_INTERNAL=leo_storage 4 | COMPONENT=leo_storage 5 | COMPONENT_PATH=../../package/$(COMPONENT_INTERNAL) 6 | DIR=$(STAGE_DIR)/$(COMPONENT) 7 | PKG_CATEGORY=leofs 8 | PKG_HOMEPAGE=https://leo-project.net/leofs/ 9 | DEPS="erlang>=16.1.2" 10 | 11 | include ../../deps/fifo_utils/priv/pkg.mk 12 | 13 | .PHONY: build_info package package_list all bootstrap 14 | 15 | all: package 16 | 17 | package: prepare $(FILE).tgz 18 | 19 | prepare: 20 | -rm -r $(DIR) 21 | cp -r $(COMPONENT_PATH) $(DIR) 22 | mkdir $(DIR)/share 23 | cp files/$(COMPONENT).xml $(DIR)/share 24 | cp files/start $(DIR)/erts-*/bin/start 25 | rm $(DIR)/etc/leo_storage.conf 26 | cp files/leo_storage.conf $(DIR)/etc/leo_storage.conf.example 27 | cp files/$(COMPONENT)_snmp.config.0 $(DIR)/snmp/snmpa_storage_0/$(COMPONENT)_snmp.config 28 | cp files/$(COMPONENT)_snmp.config.1 $(DIR)/snmp/snmpa_storage_1/$(COMPONENT)_snmp.config 29 | cp files/$(COMPONENT)_snmp.config.2 $(DIR)/snmp/snmpa_storage_2/$(COMPONENT)_snmp.config 30 | cp files/$(COMPONENT)_snmp.config.3 $(DIR)/snmp/snmpa_storage_3/$(COMPONENT)_snmp.config 31 | 32 | clean: clean-pkg 33 | -rm -r $(DIR) 34 | -rm *.tgz 35 | -------------------------------------------------------------------------------- /pkg/leo_storage/comment: -------------------------------------------------------------------------------- 1 | LeoFS storage server. 2 | -------------------------------------------------------------------------------- /pkg/leo_storage/deinstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | case $2 in 4 | DEINSTALL) 5 | ;; 6 | POST-DEINSTALL) 7 | ;; 8 | esac 9 | -------------------------------------------------------------------------------- /pkg/leo_storage/deploy/.gitignore: -------------------------------------------------------------------------------- 1 | leo_storage/ 2 | -------------------------------------------------------------------------------- /pkg/leo_storage/description: -------------------------------------------------------------------------------- 1 | leo_storage handles the data storage for LeoFS. 2 | -------------------------------------------------------------------------------- /pkg/leo_storage/displayfile: -------------------------------------------------------------------------------- 1 | .------------------------------------------------------------------------------. 2 | | | 3 | | Write some nice information that comes in handy when you instal leo_storage. | 4 | | | 5 | `------------------------------------------------------------------------------' 6 | 7 | -------------------------------------------------------------------------------- /pkg/leo_storage/files/leo_storage_snmp.config.0: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "/var/db/leo_storage/snmp"}, 3 | {config, [{dir, "snmp/snmpa_storage_0/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /pkg/leo_storage/files/leo_storage_snmp.config.1: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "/var/db/leo_storage/snmp"}, 3 | {config, [{dir, "snmp/snmpa_storage_1/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /pkg/leo_storage/files/leo_storage_snmp.config.2: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "/var/db/leo_storage/snmp"}, 3 | {config, [{dir, "snmp/snmpa_storage_2/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /pkg/leo_storage/files/leo_storage_snmp.config.3: -------------------------------------------------------------------------------- 1 | [{snmp, [{agent, [{versions, [v1, v2]}, 2 | {db_dir, "/var/db/leo_storage/snmp"}, 3 | {config, [{dir, "snmp/snmpa_storage_3/agent/conf"}, 4 | {verbosity, silence}]}, 5 | {net_if, [{verbosity, silence}]} 6 | ]}, 7 | {verbosity, silence}]} 8 | ]. 9 | -------------------------------------------------------------------------------- /pkg/leo_storage/files/start: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # %CopyrightBegin% 4 | # 5 | # Copyright Ericsson AB 1996-2009. All Rights Reserved. 6 | # 7 | # The contents of this file are subject to the Erlang Public License, 8 | # Version 1.1, (the "License"); you may not use this file except in 9 | # compliance with the License. You should have received a copy of the 10 | # Erlang Public License along with this software. If not, it can be 11 | # retrieved online at http://www.erlang.org/. 12 | # 13 | # Software distributed under the License is distributed on an "AS IS" 14 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 15 | # the License for the specific language governing rights and limitations 16 | # under the License. 17 | # 18 | # %CopyrightEnd% 19 | # 20 | # This program invokes the erlang emulator by calling run_erl. 21 | # It should only be used at an embedded target system. 22 | # It should be modified to give the correct flags to erl (via start_erl), 23 | # e.g -mode embedded -sname XXX 24 | # 25 | # Usage: start [Data] 26 | # 27 | ROOTDIR=/opt/local/lib/erlang 28 | 29 | if [ -z "$RELDIR" ] 30 | then 31 | RELDIR=$ROOTDIR/releases 32 | fi 33 | 34 | START_ERL_DATA=${1:-$RELDIR/start_erl.data} 35 | 36 | $ROOTDIR/bin/run_erl -daemon /tmp/ /var/log/leo_storage "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA" 37 | -------------------------------------------------------------------------------- /pkg/leo_storage/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | USER=leofs 4 | GROUP=$USER 5 | COMPONENT=leo_storage 6 | DIR=/opt/local/$COMPONENT 7 | 8 | case $2 in 9 | PRE-INSTALL) 10 | if grep "^$GROUP:" /etc/group > /dev/null 2>&1 11 | then 12 | echo "Group already exists, skipping creation." 13 | else 14 | echo Creating $GROUP group ... 15 | groupadd $GROUP 16 | fi 17 | if id $USER > /dev/null 2>&1 18 | then 19 | echo "User already exists, skipping creation." 20 | else 21 | echo Creating $USER user ... 22 | useradd -g $GROUP -d /var/db/leofs -s /bin/false $USER 23 | fi 24 | echo Creating directories ... 25 | mkdir -p /var/db/leofs 26 | chown -R $USER:$GROUP /var/db/leofs 27 | mkdir -p /var/db/$COMPONENT/snmp 28 | chown -R $USER:$GROUP /var/db/$COMPONENT 29 | mkdir -p /var/log/$COMPONENT/sasl 30 | chown -R $USER:$GROUP /var/log/$COMPONENT 31 | if [ -d /tmp/$COMPONENT ] 32 | then 33 | chown -R $USER:$GROUP /tmp/$COMPONENT/ 34 | fi 35 | ;; 36 | POST-INSTALL) 37 | if svcs svc:/network/$COMPONENT:default > /dev/null 2>&1 38 | then 39 | echo Service already existings ... 40 | else 41 | echo Importing service ... 42 | svccfg import $DIR/share/$COMPONENT.xml 43 | fi 44 | echo Trying to guess configuration ... 45 | IP=`ifconfig net0 | grep inet | awk -e '{print $2}'` 46 | if [ ! -f $DIR/etc/leo_storage.conf ] 47 | then 48 | cp $DIR/etc/leo_storage.conf.example $DIR/etc/leo_storage.conf 49 | sed --in-place -e "s/127.0.0.1/${IP}/g" $DIR/etc/leo_storage.conf 50 | fi 51 | ;; 52 | esac 53 | -------------------------------------------------------------------------------- /pkg/leo_storage/post_pkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/pkg/leo_storage/post_pkg -------------------------------------------------------------------------------- /pkg/leo_storage/pre_pkg: -------------------------------------------------------------------------------- 1 | @pkgdep erlang>=15.1.1 2 | -------------------------------------------------------------------------------- /priv/mon/leofs-mon-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/priv/mon/leofs-mon-screenshot.png -------------------------------------------------------------------------------- /priv/test/ls-test/README.md: -------------------------------------------------------------------------------- 1 | # LeoFS's ls-command benchmark tool 2 | 3 | #### leo-ls-bench's usage 4 | ```bash 5 | usage: leofs-ls-bench [--help] 6 | leofs-ls-bench -c -d -k 7 | [-num-of-sub-dirs ] [--debug] 8 | 9 | description of the parameters: 10 | * : [s3cmd | nfs] 11 | ``` 12 | 13 | 14 | ### Run leofs-ls-bench 15 | #### TEST 16 | ```bash 17 | $ leofs-ls-bench -c -d -k --debug 18 | ``` 19 | #### Run 20 | * Without sub-directories 21 | 22 | ```bash 23 | $ leofs-ls-bench -c -d -k 24 | 25 | ## example: 26 | $ leofs-ls-bench -c 3 -d test/ -k s3cmd 27 | ``` 28 | 29 | * Within sub-directories 30 | 31 | ```bash 32 | $ leofs-ls-bench -c -d -k -num-of-sub-dirs 33 | 34 | ## example: 35 | ## - affects the processing. 36 | ## In this case, "test/sub_1", "test/sub_2" and "test/sub_3" will be requested. 37 | $ leofs-ls-bench -c 3 -d test/sub_ -k s3cmd -num-of-sub-dirs 3 38 | 39 | ``` 40 | 41 | #### Log file 42 | After executing a benchmark, you're able to find the log-file as below: 43 | 44 | * ``leofs-ls-bnech-result..log`` 45 | 46 | 47 | ## License 48 | [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) 49 | 50 | ## Sponsors 51 | 52 | LeoProject/LeoFS is sponsored by [Rakuten, Inc.](http://global.rakuten.com/corp/) and supported by [Rakuten Institute of Technology](http://rit.rakuten.co.jp/). 53 | -------------------------------------------------------------------------------- /rebar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/rebar -------------------------------------------------------------------------------- /rebar.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS 5 | %% 6 | %% Copyright (c) 2012-2018 Rakuten, Inc. 7 | %% Copyright (c) 2019-2020 Lions Data, Ltd. 8 | %% 9 | %% This file is provided to you under the Apache License, 10 | %% Version 2.0 (the "License"); you may not use this file 11 | %% except in compliance with the License. You may obtain 12 | %% a copy of the License at 13 | %% 14 | %% http://www.apache.org/licenses/LICENSE-2.0 15 | %% 16 | %% Unless required by applicable law or agreed to in writing, 17 | %% software distributed under the License is distributed on an 18 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19 | %% KIND, either express or implied. See the License for the 20 | %% specific language governing permissions and limitations 21 | %% under the License. 22 | %% 23 | %%====================================================================== 24 | {require_otp_vsn, "19|20|21|22"}. 25 | 26 | {sub_dirs, ["rel", "apps/leo_gateway","apps/leo_manager","apps/leo_storage"]}. 27 | 28 | {deps, []}. 29 | 30 | {erl_opts, [debug_info, warn_untyped_record, 31 | {platform_define, "^[0-9]+", namespaced_types}]}. 32 | -------------------------------------------------------------------------------- /rebar.config.project-fifo: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS 5 | %% 6 | %% Copyright (c) 2012-2017 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | {require_otp_vsn, "R16B*|17|18|19"}. 24 | 25 | {sub_dirs, ["apps/leo_gateway","apps/leo_manager","apps/leo_storage"]}. 26 | 27 | {deps, [ 28 | {fifo_utils, "0.1.*", {git, "https://github.com/leo-project/fifo_utils.git", "6911b96d5bd813d3688108afb57746020c61daf2"}} 29 | ]}. 30 | 31 | {erl_opts, [debug_info, warn_untyped_record, 32 | {platform_define, "^[0-9]+", namespaced_types}]}. 33 | -------------------------------------------------------------------------------- /rel/common/launch.environment: -------------------------------------------------------------------------------- 1 | # Directories used by launch script can be re-defined here, if needed 2 | # Default values will be picked for commented or empty parameters 3 | 4 | # Directory with main .conf file. It must be writable by $RUNNER_USER 5 | # RUNNER_ETC_DIR= 6 | 7 | # Directory for .schema file. 8 | # RUNNER_SCHEMA_DIR= 9 | 10 | # Directory for erlang log files (erlang.log.* and run_erl.log) 11 | # RUNNER_LOG_DIR= 12 | 13 | # Defaults to "leofs" 14 | RUNNER_USER= 15 | 16 | # Defaults to 65535 17 | # MAX_OPEN_FILES= 18 | 19 | # Defaults to "0" when launched under systemd or heart is active, which means 20 | # that no dumps are created before restart. Uncomment line below to set it to 21 | # "-1" and create dumps on every crash if leo_(manager|storage|gateway) is 22 | # restarted frequently in order to dig down further for identifying the root 23 | # cause. "-1" means that runtime system won't be rebooted until the crash dump 24 | # file is completely written. 25 | # ERL_CRASH_DUMP_SECONDS=-1 26 | -------------------------------------------------------------------------------- /rel/common/leofs-limits.conf: -------------------------------------------------------------------------------- 1 | # Increase amount of open files (required by LeoGateway and LeoStorage on some systems) 2 | 3 | leofs soft nofile 65535 4 | leofs hard nofile 65535 5 | -------------------------------------------------------------------------------- /rel/common/leofs.conf: -------------------------------------------------------------------------------- 1 | # This file uses shell syntax (spaces around "=" aren't allowed). 2 | 3 | # By default LeoFS nodes load config files from /usr/local/leofs/current/leo_*/etc. 4 | # To make them use config files from /etc/leofs/leo_* instead, change this 5 | # option to GLOBAL_CONFIG=yes 6 | 7 | GLOBAL_CONFIG=no 8 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/app.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Gateway 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_gateway/priv/leo_gateway.conf 27 | []. 28 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/erl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## This script replaces the default "erl" in erts-VSN/bin. This is necessary 4 | ## as escript depends on erl and in turn, erl depends on having access to a 5 | ## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect 6 | ## of running escript -- the embedded node bypasses erl and uses erlexec directly 7 | ## (as it should). 8 | ## 9 | ## Note that this script makes the assumption that there is a start_clean.boot 10 | ## file available in $ROOTDIR/release/VSN. 11 | 12 | # Determine the abspath of where this script is executing from. 13 | ERTS_BIN_DIR=$(cd ${0%/*} && pwd) 14 | 15 | # Now determine the root directory -- this script runs from erts-VSN/bin, 16 | # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR 17 | # path. 18 | ROOTDIR=${ERTS_BIN_DIR%/*/*} 19 | 20 | # Parse out release and erts info 21 | START_ERL=`cat $ROOTDIR/releases/start_erl.data` 22 | ERTS_VSN=${START_ERL% *} 23 | APP_VSN=${START_ERL#* } 24 | 25 | BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin 26 | EMU=beam 27 | PROGNAME=`echo $0 | sed 's/.*\\///'` 28 | CMD="$BINDIR/erlexec" 29 | export EMU 30 | export ROOTDIR 31 | export BINDIR 32 | export PROGNAME 33 | 34 | exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"} 35 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/leo_gateway.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @set node_name=leo_gateway 4 | 5 | @rem Get the abolute path to the parent directory, 6 | @rem which is assumed to be the node root. 7 | @for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI 8 | 9 | @set releases_dir=%node_root%\releases 10 | 11 | @rem Parse ERTS version and release version from start_erl.data 12 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 13 | @call :set_trim erts_version %%I 14 | @call :set_trim release_version %%J 15 | ) 16 | 17 | @set erts_bin=%node_root%\erts-%erts_version%\bin 18 | 19 | @set service_name=%node_name%_%release_version% 20 | 21 | @if "%1"=="install" @goto install 22 | @if "%1"=="uninstall" @goto uninstall 23 | @if "%1"=="start" @goto start 24 | @if "%1"=="stop" @goto stop 25 | @if "%1"=="restart" @call :stop && @goto start 26 | @if "%1"=="console" @goto console 27 | @rem TODO: attach, ping, restart and reboot 28 | 29 | :usage 30 | @echo Usage: %0 {install|uninstall|start|stop|restart|console} 31 | @goto :EOF 32 | 33 | :install 34 | @%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -sname %node_name% -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()." 35 | @goto :EOF 36 | 37 | :uninstall 38 | @%erts_bin%\erlsrv.exe remove %service_name% 39 | @%erts_bin%\epmd.exe -kill 40 | @goto :EOF 41 | 42 | :start 43 | @%erts_bin%\erlsrv.exe start %service_name% 44 | @goto :EOF 45 | 46 | :stop 47 | @%erts_bin%\erlsrv.exe stop %service_name% 48 | @goto :EOF 49 | 50 | :console 51 | @start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name% 52 | @goto :EOF 53 | 54 | :set_trim 55 | @set %1=%2 56 | @goto :EOF 57 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/server_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDIDCCAgigAwIBAgIJAJLkNZzERPIUMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV 3 | BAMTCWxvY2FsaG9zdDAeFw0xMDAzMTgxOTM5MThaFw0yMDAzMTUxOTM5MThaMBQx 4 | EjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 5 | ggEBAJeUCOZxbmtngF4S5lXckjSDLc+8C+XjMBYBPyy5eKdJY20AQ1s9/hhp3ulI 6 | 8pAvl+xVo4wQ+iBSvOzcy248Q+Xi6+zjceF7UNRgoYPgtJjKhdwcHV3mvFFrS/fp 7 | 9ggoAChaJQWDO1OCfUgTWXImhkw+vcDR11OVMAJ/h73dqzJPI9mfq44PTTHfYtgr 8 | v4LAQAOlhXIAa2B+a6PlF6sqDqJaW5jLTcERjsBwnRhUGi7JevQzkejujX/vdA+N 9 | jRBjKH/KLU5h3Q7wUchvIez0PXWVTCnZjpA9aR4m7YV05nKQfxtGd71czYDYk+j8 10 | hd005jetT4ir7JkAWValBybJVksCAwEAAaN1MHMwHQYDVR0OBBYEFJl9s51SnjJt 11 | V/wgKWqV5Q6jnv1ZMEQGA1UdIwQ9MDuAFJl9s51SnjJtV/wgKWqV5Q6jnv1ZoRik 12 | FjAUMRIwEAYDVQQDEwlsb2NhbGhvc3SCCQCS5DWcxETyFDAMBgNVHRMEBTADAQH/ 13 | MA0GCSqGSIb3DQEBBQUAA4IBAQB2ldLeLCc+lxK5i0EZquLamMBJwDIjGpT0JMP9 14 | b4XQOK2JABIu54BQIZhwcjk3FDJz/uOW5vm8k1kYni8FCjNZAaRZzCUfiUYTbTKL 15 | Rq9LuIAODyP2dnTqyKaQOOJHvrx9MRZ3XVecXPS0Tib4aO57vCaAbIkmhtYpTWmw 16 | e3t8CAIDVtgvjR6Se0a1JA4LktR7hBu22tDImvCSJn1nVAaHpani6iPBPPdMuMsP 17 | TBoeQfj8VpqBUjCStqJGa8ytjDFX73YaxV2mgrtGwPNme1x3YNRR11yTu7tksyMO 18 | GrmgxNriqYRchBhNEf72AKF0LR1ByKwfbDB9rIsV00HtCgOp 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/server_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAl5QI5nFua2eAXhLmVdySNIMtz7wL5eMwFgE/LLl4p0ljbQBD 3 | Wz3+GGne6UjykC+X7FWjjBD6IFK87NzLbjxD5eLr7ONx4XtQ1GChg+C0mMqF3Bwd 4 | Xea8UWtL9+n2CCgAKFolBYM7U4J9SBNZciaGTD69wNHXU5UwAn+Hvd2rMk8j2Z+r 5 | jg9NMd9i2Cu/gsBAA6WFcgBrYH5ro+UXqyoOolpbmMtNwRGOwHCdGFQaLsl69DOR 6 | 6O6Nf+90D42NEGMof8otTmHdDvBRyG8h7PQ9dZVMKdmOkD1pHibthXTmcpB/G0Z3 7 | vVzNgNiT6PyF3TTmN61PiKvsmQBZVqUHJslWSwIDAQABAoIBACI8Ky5xHDFh9RpK 8 | Rn/KC7OUlTpADKflgizWJ0Cgu2F9L9mkn5HyFHvLHa+u7CootbWJOiEejH/UcBtH 9 | WyMQtX0snYCpdkUpJv5wvMoebGu+AjHOn8tfm9T/2O6rhwgckLyMb6QpGbMo28b1 10 | p9QiY17BJPZx7qJQJcHKsAvwDwSThlb7MFmWf42LYWlzybpeYQvwpd+UY4I0WXLu 11 | /dqJIS9Npq+5Y5vbo2kAEAssb2hSCvhCfHmwFdKmBzlvgOn4qxgZ1iHQgfKI6Z3Y 12 | J0573ZgOVTuacn+lewtdg5AaHFcl/zIYEr9SNqRoPNGbPliuv6k6N2EYcufWL5lR 13 | sCmmmHECgYEAxm+7OpepGr++K3+O1e1MUhD7vSPkKJrCzNtUxbOi2NWj3FFUSPRU 14 | adWhuxvUnZgTcgM1+KuQ0fB2VmxXe9IDcrSFS7PKFGtd2kMs/5mBw4UgDZkOQh+q 15 | kDiBEV3HYYJWRq0w3NQ/9Iy1jxxdENHtGmG9aqamHxNtuO608wGW2S8CgYEAw4yG 16 | ZyAic0Q/U9V2OHI0MLxLCzuQz17C2wRT1+hBywNZuil5YeTuIt2I46jro6mJmWI2 17 | fH4S/geSZzg2RNOIZ28+aK79ab2jWBmMnvFCvaru+odAuser4N9pfAlHZvY0pT+S 18 | 1zYX3f44ygiio+oosabLC5nWI0zB2gG8pwaJlaUCgYEAgr7poRB+ZlaCCY0RYtjo 19 | mYYBKD02vp5BzdKSB3V1zeLuBWM84pjB6b3Nw0fyDig+X7fH3uHEGN+USRs3hSj6 20 | BqD01s1OT6fyfbYXNw5A1r+nP+5h26Wbr0zblcKxdQj4qbbBZC8hOJNhqTqqA0Qe 21 | MmzF7jiBaiZV/Cyj4x1f9BcCgYEAhjL6SeuTuOctTqs/5pz5lDikh6DpUGcH8qaV 22 | o6aRAHHcMhYkZzpk8yh1uUdD7516APmVyvn6rrsjjhLVq4ZAJjwB6HWvE9JBN0TR 23 | bILF+sREHUqU8Zn2Ku0nxyfXCKIOnxlx/J/y4TaGYqBqfXNFWiXNUrjQbIlQv/xR 24 | K48g/MECgYBZdQlYbMSDmfPCC5cxkdjrkmAl0EgV051PWAi4wR+hLxIMRjHBvAk7 25 | IweobkFvT4TICulgroLkYcSa5eOZGxB/DHqcQCbWj3reFV0VpzmTDoFKG54sqBRl 26 | vVntGt0pfA40fF17VoS7riAdHF53ippTtsovHEsg5tq5NrBl5uKm2g== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/start_erl.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++. 4 | @rem Other args are position dependent. 5 | @set args="%*" 6 | @for /F "delims=++ tokens=1,2,3" %%I in (%args%) do @( 7 | @set erl_args=%%I 8 | @call :set_trim node_name %%J 9 | @call :set_trim node_root %%K 10 | ) 11 | 12 | @set releases_dir=%node_root%\releases 13 | 14 | @rem parse ERTS version and release version from start_erl.dat 15 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 16 | @call :set_trim erts_version %%I 17 | @call :set_trim release_version %%J 18 | ) 19 | 20 | @set erl_exe=%node_root%\erts-%erts_version%\bin\erl.exe 21 | @set boot_file=%releases_dir%\%release_version%\%node_name% 22 | 23 | @if exist %releases_dir%\%release_version%\sys.config ( 24 | @set app_config=%releases_dir%\%release_version%\sys.config 25 | ) else ( 26 | @set app_config=%node_root%\etc\app.config 27 | ) 28 | 29 | @if exist %releases_dir%\%release_version%\vm.args ( 30 | @set vm_args=%releases_dir%\%release_version%\vm.args 31 | ) else ( 32 | @set vm_args=%node_root%\etc\vm.args 33 | ) 34 | 35 | @%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args% 36 | 37 | :set_trim 38 | @set %1=%2 39 | @goto :EOF 40 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/sys.config: -------------------------------------------------------------------------------- 1 | [ 2 | %% SASL config 3 | {sasl, [ 4 | {sasl_error_logger, {file, "log/sasl-error.log"}}, 5 | {errlog_type, error}, 6 | {error_logger_mf_dir, "log/sasl"}, % Log directory 7 | {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size 8 | {error_logger_mf_maxfiles, 5} % 5 files max 9 | ]} 10 | ]. 11 | 12 | -------------------------------------------------------------------------------- /rel/leo_gateway/files/vm.args: -------------------------------------------------------------------------------- 1 | ## Name of the node 2 | -name {{node}} 3 | 4 | ## Cookie for distributed erlang 5 | -setcookie {{cookie}} 6 | 7 | ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive 8 | ## (Disabled by default..use with caution!) 9 | ##-heart 10 | 11 | ## Enable kernel poll and a few async threads 12 | +K true 13 | +A 32 14 | 15 | ## Increase number of concurrent ports/sockets 16 | ##-env ERL_MAX_PORTS 4096 17 | 18 | ## Tweak GC to run more often 19 | ##-env ERL_FULLSWEEP_AFTER 10 20 | 21 | ## SNMP Config file 22 | -config {{platform_snmp_dir}}/{{snmp_conf_dir}}/leo_gateway_snmp 23 | 24 | ## Sets the maximum number of concurrent processes for this system 25 | +P 1048576 26 | 27 | ## set up the node with the -hidden flag 28 | -hidden 29 | -------------------------------------------------------------------------------- /rel/leo_gateway/vars.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Gateway 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_gateway/priv/leo_gateway.conf 27 | -------------------------------------------------------------------------------- /rel/leo_manager/files/app.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Manager 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_manager/priv/leo_manager_*.conf 27 | []. 28 | -------------------------------------------------------------------------------- /rel/leo_manager/files/erl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## This script replaces the default "erl" in erts-VSN/bin. This is necessary 4 | ## as escript depends on erl and in turn, erl depends on having access to a 5 | ## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect 6 | ## of running escript -- the embedded node bypasses erl and uses erlexec directly 7 | ## (as it should). 8 | ## 9 | ## Note that this script makes the assumption that there is a start_clean.boot 10 | ## file available in $ROOTDIR/release/VSN. 11 | 12 | # Determine the abspath of where this script is executing from. 13 | ERTS_BIN_DIR=$(cd ${0%/*} && pwd) 14 | 15 | # Now determine the root directory -- this script runs from erts-VSN/bin, 16 | # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR 17 | # path. 18 | ROOTDIR=${ERTS_BIN_DIR%/*/*} 19 | 20 | # Parse out release and erts info 21 | START_ERL=`cat $ROOTDIR/releases/start_erl.data` 22 | ERTS_VSN=${START_ERL% *} 23 | APP_VSN=${START_ERL#* } 24 | 25 | BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin 26 | EMU=beam 27 | PROGNAME=`echo $0 | sed 's/.*\\///'` 28 | CMD="$BINDIR/erlexec" 29 | export EMU 30 | export ROOTDIR 31 | export BINDIR 32 | export PROGNAME 33 | 34 | exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"} 35 | -------------------------------------------------------------------------------- /rel/leo_manager/files/leo_manager.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @set node_name=leo_manager 4 | 5 | @rem Get the abolute path to the parent directory, 6 | @rem which is assumed to be the node root. 7 | @for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI 8 | 9 | @set releases_dir=%node_root%\releases 10 | 11 | @rem Parse ERTS version and release version from start_erl.data 12 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 13 | @call :set_trim erts_version %%I 14 | @call :set_trim release_version %%J 15 | ) 16 | 17 | @set erts_bin=%node_root%\erts-%erts_version%\bin 18 | 19 | @set service_name=%node_name%_%release_version% 20 | 21 | @if "%1"=="install" @goto install 22 | @if "%1"=="uninstall" @goto uninstall 23 | @if "%1"=="start" @goto start 24 | @if "%1"=="stop" @goto stop 25 | @if "%1"=="restart" @call :stop && @goto start 26 | @if "%1"=="console" @goto console 27 | @rem TODO: attach, ping, restart and reboot 28 | 29 | :usage 30 | @echo Usage: %0 {install|uninstall|start|stop|restart|console} 31 | @goto :EOF 32 | 33 | :install 34 | @%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -sname %node_name% -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()." 35 | @goto :EOF 36 | 37 | :uninstall 38 | @%erts_bin%\erlsrv.exe remove %service_name% 39 | @%erts_bin%\epmd.exe -kill 40 | @goto :EOF 41 | 42 | :start 43 | @%erts_bin%\erlsrv.exe start %service_name% 44 | @goto :EOF 45 | 46 | :stop 47 | @%erts_bin%\erlsrv.exe stop %service_name% 48 | @goto :EOF 49 | 50 | :console 51 | @start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name% 52 | @goto :EOF 53 | 54 | :set_trim 55 | @set %1=%2 56 | @goto :EOF 57 | -------------------------------------------------------------------------------- /rel/leo_manager/files/start_erl.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++. 4 | @rem Other args are position dependent. 5 | @set args="%*" 6 | @for /F "delims=++ tokens=1,2,3" %%I in (%args%) do @( 7 | @set erl_args=%%I 8 | @call :set_trim node_name %%J 9 | @call :set_trim node_root %%K 10 | ) 11 | 12 | @set releases_dir=%node_root%\releases 13 | 14 | @rem parse ERTS version and release version from start_erl.dat 15 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 16 | @call :set_trim erts_version %%I 17 | @call :set_trim release_version %%J 18 | ) 19 | 20 | @set erl_exe=%node_root%\erts-%erts_version%\bin\erl.exe 21 | @set boot_file=%releases_dir%\%release_version%\%node_name% 22 | 23 | @if exist %releases_dir%\%release_version%\sys.config ( 24 | @set app_config=%releases_dir%\%release_version%\sys.config 25 | ) else ( 26 | @set app_config=%node_root%\etc\app.config 27 | ) 28 | 29 | @if exist %releases_dir%\%release_version%\vm.args ( 30 | @set vm_args=%releases_dir%\%release_version%\vm.args 31 | ) else ( 32 | @set vm_args=%node_root%\etc\vm.args 33 | ) 34 | 35 | @%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args% 36 | 37 | :set_trim 38 | @set %1=%2 39 | @goto :EOF 40 | -------------------------------------------------------------------------------- /rel/leo_manager/files/sys.config: -------------------------------------------------------------------------------- 1 | [ 2 | %% SASL config 3 | {sasl, [ 4 | {sasl_error_logger, {file, "log/sasl-error.log"}}, 5 | {errlog_type, error}, 6 | {error_logger_mf_dir, "log/sasl"}, % Log directory 7 | {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size 8 | {error_logger_mf_maxfiles, 5} % 5 files max 9 | ]} 10 | ]. 11 | 12 | -------------------------------------------------------------------------------- /rel/leo_manager/files/vm.args: -------------------------------------------------------------------------------- 1 | ## Name of the node 2 | -name {{node}} 3 | 4 | ## Cookie for distributed erlang 5 | -setcookie {{cookie}} 6 | 7 | ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive 8 | ## (Disabled by default..use with caution!) 9 | ##-heart 10 | 11 | ## Enable kernel poll and a few async threads 12 | +K true 13 | +A 32 14 | 15 | ## Increase number of concurrent ports/sockets 16 | ##-env ERL_MAX_PORTS 4096 17 | 18 | ## Tweak GC to run more often 19 | ##-env ERL_FULLSWEEP_AFTER 10 20 | 21 | ## SNMP Config file 22 | -config {{platform_snmp_dir}}/{{snmp_conf_dir}}/leo_manager_snmp 23 | 24 | ## set up the node with the -hidden flag 25 | -hidden 26 | -------------------------------------------------------------------------------- /rel/leo_manager/vars.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Manager 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_manager/priv/leo_manager_*.conf 27 | -------------------------------------------------------------------------------- /rel/leo_storage/files/app.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Storage 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_storage/priv/leo_storage.conf 27 | []. 28 | -------------------------------------------------------------------------------- /rel/leo_storage/files/erl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## This script replaces the default "erl" in erts-VSN/bin. This is necessary 4 | ## as escript depends on erl and in turn, erl depends on having access to a 5 | ## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect 6 | ## of running escript -- the embedded node bypasses erl and uses erlexec directly 7 | ## (as it should). 8 | ## 9 | ## Note that this script makes the assumption that there is a start_clean.boot 10 | ## file available in $ROOTDIR/release/VSN. 11 | 12 | # Determine the abspath of where this script is executing from. 13 | ERTS_BIN_DIR=$(cd ${0%/*} && pwd) 14 | 15 | # Now determine the root directory -- this script runs from erts-VSN/bin, 16 | # so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR 17 | # path. 18 | ROOTDIR=${ERTS_BIN_DIR%/*/*} 19 | 20 | # Parse out release and erts info 21 | START_ERL=`cat $ROOTDIR/releases/start_erl.data` 22 | ERTS_VSN=${START_ERL% *} 23 | APP_VSN=${START_ERL#* } 24 | 25 | BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin 26 | EMU=beam 27 | PROGNAME=`echo $0 | sed 's/.*\\///'` 28 | CMD="$BINDIR/erlexec" 29 | export EMU 30 | export ROOTDIR 31 | export BINDIR 32 | export PROGNAME 33 | 34 | exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"} 35 | -------------------------------------------------------------------------------- /rel/leo_storage/files/leo_storage.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @set node_name=leo_storage 4 | 5 | @rem Get the abolute path to the parent directory, 6 | @rem which is assumed to be the node root. 7 | @for /F "delims=" %%I in ("%~dp0..") do @set node_root=%%~fI 8 | 9 | @set releases_dir=%node_root%\releases 10 | 11 | @rem Parse ERTS version and release version from start_erl.data 12 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 13 | @call :set_trim erts_version %%I 14 | @call :set_trim release_version %%J 15 | ) 16 | 17 | @set erts_bin=%node_root%\erts-%erts_version%\bin 18 | 19 | @set service_name=%node_name%_%release_version% 20 | 21 | @if "%1"=="install" @goto install 22 | @if "%1"=="uninstall" @goto uninstall 23 | @if "%1"=="start" @goto start 24 | @if "%1"=="stop" @goto stop 25 | @if "%1"=="restart" @call :stop && @goto start 26 | @if "%1"=="console" @goto console 27 | @rem TODO: attach, ping, restart and reboot 28 | 29 | :usage 30 | @echo Usage: %0 {install|uninstall|start|stop|restart|console} 31 | @goto :EOF 32 | 33 | :install 34 | @%erts_bin%\erlsrv.exe add %service_name% -c "Erlang node %node_name% in %node_root%" -sname %node_name% -w %node_root% -m %node_root%\bin\start_erl.cmd -args " ++ %node_name% ++ %node_root%" -stopaction "init:stop()." 35 | @goto :EOF 36 | 37 | :uninstall 38 | @%erts_bin%\erlsrv.exe remove %service_name% 39 | @%erts_bin%\epmd.exe -kill 40 | @goto :EOF 41 | 42 | :start 43 | @%erts_bin%\erlsrv.exe start %service_name% 44 | @goto :EOF 45 | 46 | :stop 47 | @%erts_bin%\erlsrv.exe stop %service_name% 48 | @goto :EOF 49 | 50 | :console 51 | @start %erts_bin%\werl.exe -boot %releases_dir%\%release_version%\%node_name% 52 | @goto :EOF 53 | 54 | :set_trim 55 | @set %1=%2 56 | @goto :EOF 57 | -------------------------------------------------------------------------------- /rel/leo_storage/files/start_erl.cmd: -------------------------------------------------------------------------------- 1 | @setlocal 2 | 3 | @rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++. 4 | @rem Other args are position dependent. 5 | @set args="%*" 6 | @for /F "delims=++ tokens=1,2,3" %%I in (%args%) do @( 7 | @set erl_args=%%I 8 | @call :set_trim node_name %%J 9 | @call :set_trim node_root %%K 10 | ) 11 | 12 | @set releases_dir=%node_root%\releases 13 | 14 | @rem parse ERTS version and release version from start_erl.dat 15 | @for /F "tokens=1,2" %%I in (%releases_dir%\start_erl.data) do @( 16 | @call :set_trim erts_version %%I 17 | @call :set_trim release_version %%J 18 | ) 19 | 20 | @set erl_exe=%node_root%\erts-%erts_version%\bin\erl.exe 21 | @set boot_file=%releases_dir%\%release_version%\%node_name% 22 | 23 | @if exist %releases_dir%\%release_version%\sys.config ( 24 | @set app_config=%releases_dir%\%release_version%\sys.config 25 | ) else ( 26 | @set app_config=%node_root%\etc\app.config 27 | ) 28 | 29 | @if exist %releases_dir%\%release_version%\vm.args ( 30 | @set vm_args=%releases_dir%\%release_version%\vm.args 31 | ) else ( 32 | @set vm_args=%node_root%\etc\vm.args 33 | ) 34 | 35 | @%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args% 36 | 37 | :set_trim 38 | @set %1=%2 39 | @goto :EOF 40 | -------------------------------------------------------------------------------- /rel/leo_storage/files/sys.config: -------------------------------------------------------------------------------- 1 | [ 2 | %% SASL config 3 | {sasl, [ 4 | {sasl_error_logger, {file, "log/sasl-error.log"}}, 5 | {errlog_type, error}, 6 | {error_logger_mf_dir, "log/sasl"}, % Log directory 7 | {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size 8 | {error_logger_mf_maxfiles, 5} % 5 files max 9 | ]} 10 | ]. 11 | 12 | -------------------------------------------------------------------------------- /rel/leo_storage/files/vm.args: -------------------------------------------------------------------------------- 1 | ## Name of the node 2 | -name {{node}} 3 | 4 | ## Cookie for distributed erlang 5 | -setcookie {{cookie}} 6 | 7 | ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive 8 | ## (Disabled by default..use with caution!) 9 | ##-heart 10 | 11 | ## Enable kernel poll and a few async threads 12 | +K true 13 | +A 32 14 | 15 | ## Increase number of concurrent ports/sockets 16 | ##-env ERL_MAX_PORTS 4096 17 | 18 | ## Tweak GC to run more often 19 | ##-env ERL_FULLSWEEP_AFTER 10 20 | 21 | ## SNMP Config file 22 | -config {{platform_snmp_dir}}/{{snmp_conf_dir}}/leo_storage_snmp 23 | 24 | ## Sets the maximum number of concurrent processes for this system 25 | +P 1048576 26 | 27 | ## set up the node with the -hidden flag 28 | -hidden 29 | -------------------------------------------------------------------------------- /rel/leo_storage/vars.config: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | %%====================================================================== 3 | %% 4 | %% LeoFS Storage 5 | %% 6 | %% Copyright (c) 2012-2014 Rakuten, Inc. 7 | %% 8 | %% This file is provided to you under the Apache License, 9 | %% Version 2.0 (the "License"); you may not use this file 10 | %% except in compliance with the License. You may obtain 11 | %% a copy of the License at 12 | %% 13 | %% http://www.apache.org/licenses/LICENSE-2.0 14 | %% 15 | %% Unless required by applicable law or agreed to in writing, 16 | %% software distributed under the License is distributed on an 17 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | %% KIND, either express or implied. See the License for the 19 | %% specific language governing permissions and limitations 20 | %% under the License. 21 | %% 22 | %%====================================================================== 23 | 24 | %% We move from this configuration to like ini-file configuration, 25 | %% which is using "basho/cuttlefish" 26 | %% See: leofs/deps/leo_storage/priv/leo_storage.conf 27 | -------------------------------------------------------------------------------- /rel/service/90-leofs.preset: -------------------------------------------------------------------------------- 1 | # Enable Erlang Port Mapper Daemon (epmd) socket 2 | 3 | enable leofs-epmd.socket 4 | -------------------------------------------------------------------------------- /rel/service/leofs-epmd.service.pre: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Erlang Port Mapper Daemon 3 | After=network.target 4 | Wants=network.target 5 | Requires=leofs-epmd.socket 6 | 7 | [Service] 8 | ExecStart=/usr/local/leofs/current/leo_manager_0/%ERTS_VSN%/bin/epmd -systemd 9 | ExecStop=/usr/local/leofs/current/leo_manager_0/%ERTS_VSN%/bin/epmd -kill 10 | Type=notify 11 | Restart=always 12 | User=leofs 13 | Group=leofs 14 | 15 | [Install] 16 | Also=leofs-epmd.socket 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /rel/service/leofs-epmd.socket: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Erlang Port Mapper Daemon Activation Socket 3 | 4 | [Socket] 5 | ListenStream=0.0.0.0:4369 6 | Accept=false 7 | 8 | [Install] 9 | WantedBy=sockets.target 10 | -------------------------------------------------------------------------------- /rel/service/leofs-gateway.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LeoFS gateway node 3 | After=network-online.target 4 | Wants=network-online.target 5 | After=leofs-epmd.socket leofs-epmd.service 6 | Requires=leofs-epmd.socket 7 | After=leofs-manager-master.service leofs-manager-slave.service 8 | 9 | [Service] 10 | Environment=NODE_EXTRA_NAME= 11 | Type=notify 12 | User=leofs 13 | Group=leofs 14 | LimitNOFILE=65535 15 | 16 | TimeoutStartSec=2min 17 | ExecStart=/usr/local/leofs/current/leo_gateway/bin/leo_gateway foreground_start 18 | 19 | Restart=on-failure 20 | RestartSec=20 21 | 22 | TimeoutStopSec=5min 23 | ExecStop=/usr/local/leofs/current/leo_gateway/bin/leo_gateway stop 24 | 25 | [Install] 26 | WantedBy=multi-user.target 27 | -------------------------------------------------------------------------------- /rel/service/leofs-manager-master.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LeoFS master management node 3 | After=network-online.target 4 | Wants=network-online.target 5 | After=leofs-epmd.socket leofs-epmd.service 6 | Requires=leofs-epmd.socket 7 | 8 | [Service] 9 | Environment=NODE_EXTRA_NAME= 10 | Type=notify 11 | User=leofs 12 | Group=leofs 13 | 14 | TimeoutStartSec=5min 15 | ExecStart=/usr/local/leofs/current/leo_manager_0/bin/leo_manager foreground_start 16 | 17 | Restart=on-failure 18 | RestartSec=20 19 | 20 | TimeoutStopSec=5min 21 | ExecStop=/usr/local/leofs/current/leo_manager_0/bin/leo_manager stop 22 | 23 | [Install] 24 | WantedBy=multi-user.target 25 | -------------------------------------------------------------------------------- /rel/service/leofs-manager-slave.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LeoFS slave management node 3 | After=network-online.target 4 | Wants=network-online.target 5 | After=leofs-epmd.socket leofs-epmd.service 6 | Requires=leofs-epmd.socket 7 | After=leofs-manager-master.service 8 | 9 | [Service] 10 | Environment=NODE_EXTRA_NAME= 11 | Type=notify 12 | User=leofs 13 | Group=leofs 14 | 15 | TimeoutStartSec=5min 16 | ExecStart=/usr/local/leofs/current/leo_manager_1/bin/leo_manager foreground_start 17 | 18 | Restart=on-failure 19 | RestartSec=20 20 | 21 | TimeoutStopSec=5min 22 | ExecStop=/usr/local/leofs/current/leo_manager_1/bin/leo_manager stop 23 | 24 | [Install] 25 | WantedBy=multi-user.target 26 | -------------------------------------------------------------------------------- /rel/service/leofs-storage.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=LeoFS storage node 3 | After=network-online.target 4 | Wants=network-online.target 5 | After=leofs-epmd.socket leofs-epmd.service 6 | Requires=leofs-epmd.socket 7 | After=leofs-manager-master.service leofs-manager-slave.service 8 | 9 | [Service] 10 | Environment=NODE_EXTRA_NAME= 11 | Type=notify 12 | User=leofs 13 | Group=leofs 14 | LimitNOFILE=65535 15 | 16 | TimeoutStartSec=30min 17 | ExecStart=/usr/local/leofs/current/leo_storage/bin/leo_storage foreground_start 18 | 19 | Restart=on-failure 20 | RestartSec=20 21 | 22 | TimeoutStopSec=30min 23 | ExecStop=/usr/local/leofs/current/leo_storage/bin/leo_storage stop 24 | 25 | [Install] 26 | WantedBy=multi-user.target 27 | -------------------------------------------------------------------------------- /releasenotes/leofs-0.9.md: -------------------------------------------------------------------------------- 1 | leofs-0.9.0 2 | =========== 3 | The initial public release of LeoFS. 4 | 5 | 6 | leofs-0.9.1 7 | =========== 8 | 9 | Improvements 10 | ------------- 11 | 12 | * Removed ZMQ log-appender and AMQP log-appender for leo_logger, They will be provided LeoFS's sub projects. 13 | * In order to be able to extend "LeoFS's Object Container's file format", We updated its header structure. So, There is NO comatiblity between 0.9.0 and 0.9.1. 14 | 15 | 16 | Bugs Fixed 17 | ----------- 18 | 19 | * Removed "apps" directory in leofs - Modified "reltool.config" 20 | * Fixed 'shadow vars' 21 | 22 | 23 | Known Issues 24 | ------------- 25 | 26 | * [DU comand](http://www.leofs.org/docs/admin_guide.html#du-retrieve-a-number-of-objects-from-object-storage) and [Compact command](http://www.leofs.org/docs/admin_guide.html#compact-remove-logical-deleted-objects-and-metadata-from-object-storage-and-metadata-storage-respectively) are NOT stable. We will resolve them with next version. 27 | 28 | -------------------------------------------------------------------------------- /replace_otp_vsn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . -name rebar.config|xargs sed -i 's/require_otp_vsn,\s\+"\(.\+\)"/require_otp_vsn, "19|20|21|22"/g' 3 | -------------------------------------------------------------------------------- /test/conf/leofs_16K_LOAD1M.config: -------------------------------------------------------------------------------- 1 | {mode, max}. 2 | {duration, 1000}. 3 | {concurrent, 50}. 4 | 5 | {driver, basho_bench_driver_leofs}. 6 | {code_paths, ["deps/ibrowse"]}. 7 | 8 | {http_raw_ips, ["localhost"]}. 9 | {http_raw_port, 80}. 10 | {http_raw_path, "/test"}. 11 | 12 | {key_generator, {partitioned_sequential_int, 1000000}}. 13 | {value_generator, {fixed_bin, 16384}}. 14 | {operations, [{put,1}]}. 15 | 16 | -------------------------------------------------------------------------------- /test/conf/leofs_R8W2.config: -------------------------------------------------------------------------------- 1 | {mode, max}. 2 | {duration, 60}. 3 | {concurrent, 50}. 4 | 5 | {driver, basho_bench_driver_leofs}. 6 | {code_paths, ["deps/ibrowse"]}. 7 | 8 | {http_raw_ips, ["localhost"]}. 9 | {http_raw_port, 80}. 10 | {http_raw_path, "/test"}. 11 | 12 | {key_generator, {pareto_int, 1000000}}. 13 | {value_generator, {fixed_bin, 4096}}. 14 | {operations, [{get,8},{put,2}]}. 15 | 16 | -------------------------------------------------------------------------------- /test/conf/leofs_integrity_test.config: -------------------------------------------------------------------------------- 1 | {mode, max}. 2 | {duration, 60}. 3 | {concurrent, 48}. 4 | 5 | {driver, basho_bench_driver_leofs}. 6 | {code_paths, ["deps/ibrowse"]}. 7 | 8 | {http_raw_ips, ["localhost"]}. 9 | {http_raw_port, 80}. 10 | {http_raw_path, "/bbb"}. 11 | 12 | {key_generator, {pareto_int, 1000000}}. 13 | {value_generator, {uniform_bin, 4096, 32768}}. 14 | {operations, [{get,5},{put,5}]}. 15 | {check_integrity, true}. 16 | -------------------------------------------------------------------------------- /test/test_it_compaction_during_del_bucket.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -*- tab-width:4;indent-tabs-mode:nil -*- 3 | # ex: ts=4 sw=4 et 4 | #====================================================================== 5 | # 6 | # LeoFS / A Test Tool of Deletion Bucket for #725, #150 7 | # 8 | # Copyright (c) 2017 Rakuten, Inc. 9 | # 10 | # This file is provided to you under the Apache License, 11 | # Version 2.0 (the "License"); you may not use this file 12 | # except in compliance with the License. You may obtain 13 | # a copy of the License at 14 | # 15 | # http://www.apache.org/licenses/LICENSE-2.0 16 | # 17 | # Unless required by applicable law or agreed to in writing, 18 | # software distributed under the License is distributed on an 19 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | # KIND, either express or implied. See the License for the 21 | # specific language governing permissions and limitations 22 | # under the License. 23 | # 24 | #====================================================================== 25 | 26 | # Prepare this test 27 | ./bootstrap.sh start integration-test 28 | sleep 5 29 | 30 | # Put objects under 'test' 31 | s3cmd mb s3://test 32 | s3cmd sync deps/leo_commons s3://test/ 33 | s3cmd sync deps/leo_redundant_manager s3://test/ 34 | s3cmd sync deps/leo_backend_db s3://test/ 35 | s3cmd sync deps/leo_object_storage s3://test/ 36 | 37 | # Check the current state 38 | leofs-adm du storage_0@127.0.0.1 39 | leofs-adm du storage_1@127.0.0.1 40 | leofs-adm du storage_2@127.0.0.1 41 | leofs-adm du storage_3@127.0.0.1 42 | 43 | # Remove one bucket 44 | s3cmd rb s3://test 45 | sleep 5 46 | 47 | # Execute data-compaction 48 | leofs-adm compact-start storage_0@127.0.0.1 all 49 | leofs-adm compact-start storage_1@127.0.0.1 all 50 | leofs-adm compact-start storage_2@127.0.0.1 all 51 | leofs-adm compact-start storage_3@127.0.0.1 all 52 | 53 | watch ./leofs-adm du storage_0@127.0.0.1 54 | -------------------------------------------------------------------------------- /test/test_it_del_bucket_while_one_node_is_unavailable.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -*- tab-width:4;indent-tabs-mode:nil -*- 3 | # ex: ts=4 sw=4 et 4 | #====================================================================== 5 | # 6 | # LeoFS / A Test Tool of Deletion Bucket for #725, #150 7 | # 8 | # Copyright (c) 2017 Rakuten, Inc. 9 | # 10 | # This file is provided to you under the Apache License, 11 | # Version 2.0 (the "License"); you may not use this file 12 | # except in compliance with the License. You may obtain 13 | # a copy of the License at 14 | # 15 | # http://www.apache.org/licenses/LICENSE-2.0 16 | # 17 | # Unless required by applicable law or agreed to in writing, 18 | # software distributed under the License is distributed on an 19 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | # KIND, either express or implied. See the License for the 21 | # specific language governing permissions and limitations 22 | # under the License. 23 | # 24 | #====================================================================== 25 | 26 | # Prepare this test 27 | ./bootstrap.sh start integration-test 28 | sleep 5 29 | 30 | # Put objects under 'test' 31 | s3cmd mb s3://test 32 | s3cmd sync deps/leo_commons s3://test/ 33 | s3cmd sync deps/leo_redundant_manager s3://test/ 34 | s3cmd sync deps/leo_backend_db s3://test/ 35 | s3cmd sync deps/leo_object_storage s3://test/ 36 | 37 | # Stop one storage-node 38 | ./package/leo_storage_0/bin/leo_storage stop 39 | 40 | # Remove one bucket 41 | s3cmd rb s3://test 42 | 43 | # Monitor the state of the del-bucket 44 | watch ./leofs-adm delete-bucket-stats test 45 | -------------------------------------------------------------------------------- /test/test_it_rebalance_during_del_bucket.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -*- tab-width:4;indent-tabs-mode:nil -*- 3 | # ex: ts=4 sw=4 et 4 | #====================================================================== 5 | # 6 | # LeoFS / A Test Tool of Deletion Bucket for #725, #150 7 | # 8 | # Copyright (c) 2017 Rakuten, Inc. 9 | # 10 | # This file is provided to you under the Apache License, 11 | # Version 2.0 (the "License"); you may not use this file 12 | # except in compliance with the License. You may obtain 13 | # a copy of the License at 14 | # 15 | # http://www.apache.org/licenses/LICENSE-2.0 16 | # 17 | # Unless required by applicable law or agreed to in writing, 18 | # software distributed under the License is distributed on an 19 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | # KIND, either express or implied. See the License for the 21 | # specific language governing permissions and limitations 22 | # under the License. 23 | # 24 | #====================================================================== 25 | 26 | # Prepare this test 27 | ./bootstrap.sh start integration-test 28 | sleep 5 29 | 30 | # Put objects under 'test' 31 | s3cmd mb s3://test 32 | s3cmd sync deps/leo_commons s3://test/ 33 | s3cmd sync deps/leo_redundant_manager s3://test/ 34 | s3cmd sync deps/leo_backend_db s3://test/ 35 | s3cmd sync deps/leo_object_storage s3://test/ 36 | 37 | # Stop one storage-node 38 | ./package/leo_storage_0/bin/leo_storage stop 39 | 40 | # Detach the node 41 | leofs-adm detach storage_0@127.0.0.1 42 | 43 | # Remove one bucket 44 | s3cmd rb s3://test 45 | sleep 5 46 | 47 | # Execute data-rebalance 48 | leofs-adm rebalance 49 | 50 | watch ./leofs-adm mq-stats storage_1@127.0.0.1 51 | --------------------------------------------------------------------------------