Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to connected to target cluster via pegasus shell config #2108

Open
ninsmiracle opened this issue Aug 30, 2024 · 2 comments
Open

How to connected to target cluster via pegasus shell config #2108

ninsmiracle opened this issue Aug 30, 2024 · 2 comments

Comments

@ninsmiracle
Copy link
Contributor

General Question

I have read the documentation, but can not found the way that use ./run.sh shell --config my_config.ini to connected to my target cluster. In other word, I don't know how to config it.
I tried to use the config file named my_cluster.cfg which I used to deployed cluster. But it not work,with the error like this:

W2024-08-30 11:17:43.874 (1725016663874826365 42119) : overwrite default thread pool for task RPC_CM_QUERY_PARTITION_CONFIG_BY_INDEX_ACK from THREAD_POOL_META_SERVER to THREAD_POOL_DEFAULT
Pegasus Shell 2.4.5-without-slog
Type "help" for more information.
Type "Ctrl-D" or "Ctrl-C" to exit the shell.

cannot find factory '' with factory type provider
        the following 2 factories are registered:
                nativerun (type: provider)
                simulator (type: provider)
        Please specify the correct factory name in your tool_app or in configuration file
got signal id: 11
./run.sh: line 1724: 42119 Segmentation fault      ./pegasus_shell ${CONFIG} $CLUSTER_NAM

And I read the code , I think we should get the section named[meta] to get meta list , I just konw how to write the xxxx.ini file
image

@ninsmiracle
Copy link
Contributor Author

ninsmiracle commented Aug 30, 2024

I also copy and change the config.ini file in CONFIG=${ROOT}/config-shell.ini.$PID
file like this:

[apps..default]
run = true
count = 1


[apps.mimic]
type = dsn.app.mimic
arguments =
pools = THREAD_POOL_DEFAULT,THREAD_POOL_META_SERVER
run = true
count = 1

[core]
tool = nativerun
pause_on_start = false

logging_start_level = LOG_LEVEL_DEBUG
logging_factory_name = dsn::tools::simple_logger
logging_flush_on_exit = false

enable_default_app_mimic = true

data_dir = ./pegasus_shell.data

[tools.simple_logger]
short_header = false
fast_flush = true
max_number_of_log_files_on_disk = 10
stderr_start_level = LOG_LEVEL_FATAL

[tools.simulator]
random_seed = 0

[network]
io_service_worker_count = 4

[threadpool..default]
worker_count = 4
partitioned = false
worker_priority = THREAD_xPRIORITY_NORMAL

[threadpool.THREAD_POOL_DEFAULT]
name = default
worker_count = 20

[threadpool.THREAD_POOL_META_SERVER]
name = meta_server

[task..default]
is_trace = false
is_profile = false
allow_inline = false
rpc_call_header_format = NET_HDR_DSN
rpc_call_channel = RPC_CHANNEL_TCP
rpc_timeout_milliseconds = 10000


[pegasus.clusters]
my_cluster = ip:port,ip2:port

[security]
  enable_auth = true
  krb5_keytab = /home/work/pegasus/xxxxx.keytab
  krb5_config = /etc/krb5.conf
  krb5_principal = [email protected]
  sasl_plugin_path = /home/work/pegasus/thirdparty/output/lib/sasl2
  service_fqdn = my_cluster_master_meta_host_name
  service_name = my_cluster

It worked,
But pegasus-shell connected to onebox, I am so confused , because I think I configed meta-list in [pegasus.clusters].

During my operation, the output of the shell is as follows

[root@xxxxxx pegasus]# ./run.sh shell --config ker.ini 
W2024-08-30 11:41:19.453 (1725018079453708642 42130) : overwrite default thread pool for task RPC_CM_QUERY_PARTITION_CONFIG_BY_INDEX from THREAD_POOL_META_SERVER to THREAD_POOL_DEFAULT
W2024-08-30 11:41:19.453 (1725018079453808438 42130) : overwrite default thread pool for task RPC_CM_QUERY_PARTITION_CONFIG_BY_INDEX_ACK from THREAD_POOL_META_SERVER to THREAD_POOL_DEFAULT
Pegasus Shell 2.4.5-without-slog
Type "help" for more information.
Type "Ctrl-D" or "Ctrl-C" to exit the shell.

The config file is: ker.ini
The cluster name is: onebox
The cluster meta list is: 
>>> ls
list apps failed, error=ERR_TIMEOUT
>>>

@ninsmiracle
Copy link
Contributor Author

When I change the file src/shell/main.cpp and run.sh (I want to make pegasus shell connected to target cluster forcely).
Executing any command will time out.
image

If I'm not change the file , pegasus shell will be never connected to target cluster and always connected to onebox cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant